On this page
Mobile & Deeplinks
Open OneKey from a mobile dApp with a WalletConnect pairing URI. A deep link opens the wallet app; connection succeeds only after the user approves the WalletConnect session.
Overview
Create a fresh pairing URI with your WalletConnect integration, then open one of the links below from a user action. Keep the session proposal active and wait for its approval or rejection. Inside the OneKey dApp browser, use the injected provider for the target chain instead.
Deeplink Formats
Custom Scheme
onekey-wallet://wc?uri={encodeURIComponent(wcUri)}Universal Link
https://app.onekey.so/wc/connect/wc?uri={encodeURIComponent(wcUri)}Test app opening and the fallback on the iOS/Android versions and browsers you support. App installation, operating-system link settings, and embedded browser restrictions affect the result.
Usage Example
// Generate WalletConnect URI from your dApp
const wcUri = 'wc:a281...' // Your WalletConnect URI
// Option 1: Custom scheme
const customSchemeLink = `onekey-wallet://wc?uri=${encodeURIComponent(wcUri)}`
// Option 2: Universal link (recommended)
const universalLink = `https://app.onekey.so/wc/connect/wc?uri=${encodeURIComponent(wcUri)}`
// Call this from the user's Connect button.
function openOneKey() {
window.location.href = universalLink
}Connection and fallback handling
- Open the link from an explicit Connect button. Some browsers block app launches without a user action.
- Handle WalletConnect session approval, rejection, expiration, and disconnect events. Returning to the browser alone does not prove that a session was approved.
- Offer a QR code on desktop and an install or retry option when app opening fails. Do not assume a universal link always redirects to an app store.
- Generate a new pairing URI when the old one expires. Do not put a live pairing URI in analytics or application logs.
- Prefer your wallet connection library’s mobile flow when available; it manages the pairing and session lifecycle.
Related
- RainbowKit - Handles mobile detection automatically
- Web3Modal - Built-in mobile support
- Provider API - Direct provider integration
Last updated on