Link Mode
WalletKit link mode is a low latency mechanism for transporting One-Click Auth requests and session requests over universal links, reducing the need for a WebSocket connection with the Relay. This significantly enhances the user experience when connecting native dApps to native wallets by reducing the latency associated with networking connections, especially when the user has an unstable internet connection.
To support link mode add universal link for your wallet in Cloud project configuration dashboard, configure your AppMetaData appLink
with a valid universal link and set the linkMode
property to true
:
val appMetaData = Core.Model.AppMetaData(
...
appLink = "https://example.com/example_wallet",
linkMode = true
)
CoreClient.initialize(
metaData: appMetaData,
...
)
Web3Wallet.initialize(Wallet.Params.Init(core = CoreClient))
Once link mode and app link are properly configured and the user interacts with a link mode supporting dApp, your wallet will receive requests over app links. You must pass these requests to WalletKit so it can process them:
val url = intent.dataString
Web3Wallet.dispatchEnvelope(url) { error ->
//handle error
}
Ensure to handle incoming app links in your Activity onCreate method and in onNewIntent callback.
Ensure that your App Link is properly configured in your app's Manifest file with the autoVerify
set to true
:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your_host"
android:scheme="https">
</intent-filter>
For more information on how to configure app links for your app, refer to the Android Documentation.
For enabling links to app content check this documentation page.
For more information on how to interact with other apps using intents, see Android Intent Documentation.