Mesh Connect Android SDK
Android library for integrating with Mesh Connect.Installation
Add dependency to yourbuild.gradle
:
Getting Link token
ThelinkToken
should be obtained from
the /api/v1/linktoken
endpoint.
The request must be performed from the server side as it risks exposing your API secret.
You will get the response in the following format:
Launching Link
Create a LinkConfiguration
Each time you launch Link, you have to get a newlinkToken
from your backend and build a new
LinkConfiguration
object:
LinkConfiguration
object parameters:
-
accessTokens
to initialize crypto transfers flow at the ‘Select asset step’ using previously obtained integrationauth_token
. It can be used if you have a validauth_token
and want to bypass authentication to jump right into a transfer. -
transferDestinationTokens
for crypto transfers flow. It is an alternative way of providing target addresses for crypto transfers by using previously obtained integrationauth_tokens
. -
disableDomainWhiteList
is a flag that allows to disable origin whitelisting. By default, it’s enabled with the predefined domains.
Register an Activity Result callback
The Link UI runs in a separate Activity within your app. To return the result you can use Activity Result APIs.Launch Link
LinkSuccess
object if the user successfully
completes the flow.
LinkSuccess
When a user successfully links an account or completes the transfer, theLinkSuccess
object is
received. It contains a list of payloads that represent the linked items:
LinkExit
When a user exits Link without successfully linking an account or an error occurs, theLinkExit
object is received:
LinkPayloads
ASharedFlow
emits payloads immediately:
LinkEvents
ASharedFlow
emits events that happen at certain points in the Link flow:
Deeplink navigation (recommended solution)
Standard deep links always create a new task or activity, unless you handle the back stack yourself. To resume the previous state, consider these steps:- Define a custom URI scheme that is handled by a “No-op” activity.
- No-op activity checks if the app is already running. If so, it finishes itself.
- If your app is in the background: it’s brought to the foreground.
- If it’s not running: the default launcher activity is opened.