Configuring the Particle dashboard
Access the Particle Dashboard
Create a new project or enter an existing project
Create a new application, or skip this step if you already have one
Retrieve the project ID, the client key, and the application ID
Configuring settings.gradle
settings.gradle
file looks similar to the example shown below.Configuring build.gradle
build.gradle
file. The areas in which you’ll need to place these keys have been noted in the snippet below.Additionally, within dependencies
, you’ll need to (at a minimum) install the following:network.particle:connect
network.particle:connect-auth-core-adapter
network.particle:wallet-service
build.gradle
file should look similar to the following:Configuring AndroidManifest.xml
AndroidManifest.xml
file, ensuring your project keys are placed accordingly (handled through the previously established environment variables through build.gradle
).Below is an example of what your AndroidManifest.xml
should resemble.Initialize Particle Auth
init
on ParticleNetwork
. init
takes the following parameters:application
(this
), which represents the underlying Android application.env
, either Env.DEV
, Env.PRODUCTION
, or Env.STAGING
; this alters the information logged when using Particle Auth.chain
, a ChainInfo
object representing the primary chain you intend to use (such as ChainInfo.Ethereum
, ChainInfo.Polygon
).Facilitating social login
AuthCore.connect
. Simply, this method requires:socialType
, the specific social login you’re facilitating (this should be a SocialLoginType
object, such as SocialLoginType.GOOGLE
).SocialLoginType
; upon returning from this process, their account will be loaded and your application can handle next steps accordingly (through the callback function).AuthCore.getUserInfo
. This method will return numerous attributes based upon the login method they chose; for a full list of included properties, head over to the getUserInfo
API reference.
AuthCore.getUserInfo
will include a wallets
object with their address present; although an address can also be retrieved through AuthCore.evm.getAddress
, or if Solana is being used, AuthCore.solana.getAddress
.
ParticleNetwork
has a built-in transaction construction method, createTransaction
, which simply takes a from
, to
, and value
field (optionally, data
can be used for contract interaction) and returns a transaction object to be used with AuthCore.evm.sendTransaction
.
Below is an example of this flow.