Skip to main content

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 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.

How to enable it:

  1. Add a Universal Link for your wallet in the Explorer tab of your Cloud project configuration, under the Mobile Linking section

  2. Configure your PairingMetadata's redirect: object with that Universal Link

  3. Set the linkMode property to true:

final _walletKit = ReownWalletKit(
core: ReownCore(
projectId: '{YOUR_PROJECT_ID}',
),
metadata: PairingMetadata(
name: 'Example Wallet',
description: 'Example wallet description',
url: 'https://example.com/',
icons: ['https://example.com/logo.png'],
redirect: Redirect(
native: 'examplewallet://',
universal: 'https://example.com/wallet',
linkMode: true,
),
),
);

Once everything is properly configured, and the user interacts with a Link Mode-supporting dApp, your wallet will receive requests 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 WalletKit so it can process the request.

void _onLinkCaptured(String link) async {
await _walletKit.dispatchEnvelope(link);
}

Platform specifics:

  1. Ensure that you handle incoming Universal Links in the appropriate methods of AppDelegate or SceneDelegate.
  2. 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_wallet_universal_link.com</string>
</array>
</dict>
</plist>
  1. 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 WalletKit sample AppDelegate file as a reference.