Link Mode
AppKit 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 network connections, especially when the user has an unstable internet connection.
By enabling it, the wallet and dapp will communicate through declared Universal Links on iOS and/or App Links on Android even without an internet connection.
In order to fully works, Link Mode requires you to also enable One-Click Auth + Sign In With Ethereum feature.
This feature is compatible only with EVM blockchains, so if you decide to included non-EVM blockchains Link Mode mechanism is going to be disabled internally.
How to enable it:
-
Add a Universal Link for your wallet in the Explorer tab of your Cloud project configuration, under the Mobile Linking section
-
Configure your
PairingMetadata
'sredirect:
object with that Universal Link -
Set the
linkMode
property totrue
:
final _appKitModal = ReownAppKitModal(
context: context,
projectId: '{YOUR_PROJECT_ID}',
metadata: const PairingMetadata(
name: 'Example App',
description: 'Example app description',
url: 'https://example.com/',
icons: ['https://example.com/logo.png'],
redirect: Redirect(
native: 'exampleapp://',
universal: 'https://reown.com/exampleapp',
linkMode: true,
),
),
);
Once everything is properly configured, and the user interacts with a Link Mode-supporting Wallet, your dApp will receive responses through it.
In Flutter, there are several plugins that can help you integrate Universal/App Links. However, regardless of which one you choose, it is crucial that, when capturing an incoming link, you pass it to AppKit so it can process the request.
void _onLinkCaptured(String link) async {
await _appKitModal.dispatchEnvelope(link);
}
Platform specifics:
- iOS
- Android
- Ensure that you handle incoming Universal Links in the appropriate methods of
AppDelegate
orSceneDelegate
. - Ensure that you have enabled the Associated Domains Capability in your XCode project and that your Universal Link is properly configured. (Depending on the previous states of your Provisioning Profiles it may be necessary to update or create new ones)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:your_dapp_universal_link.com</string>
</array>
</dict>
</plist>
- Update/Create your domain's
.well-known/apple-app-site-association
file accordingly.
For more information on how to configure universal links for your app, refer to the Apple Documentation.
For a debugging guide, visit the Debugging Universal Links page.
You can check our Flutter's AppKit sample AppDelegate file as a reference.
- Ensure that you handle incoming App Links in your Activity's
onCreate
method and inonNewIntent
callback. - Ensure that your App Link is properly configured in your app's
AndroidManifest.xml
file with theautoVerify
set totrue
:
<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:scheme="https" />
<data android:host="your_wallet_universal_link.com" />
<data android:pathPattern="/open" />
</intent-filter>
- Update/Create your domains's
.well-known/assetlinks.json
file accordingly
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.
You can check our Flutter's AppKit sample MainActivity file as a reference.