Skip to content

fix: use Android intent URL for Phantom deeplinks#5493

Merged
0xmkh merged 5 commits intomainfrom
fix/phantom-android-intent-deeplink
Jan 23, 2026
Merged

fix: use Android intent URL for Phantom deeplinks#5493
0xmkh merged 5 commits intomainfrom
fix/phantom-android-intent-deeplink

Conversation

@enesozturk
Copy link
Copy Markdown
Contributor

@enesozturk enesozturk commented Jan 23, 2026

Summary

  • Uses Android intent URLs for Phantom deeplinks on Android devices instead of Universal Links
  • Keeps Universal Links for iOS (well supported by Safari)
  • Fixes Phantom wallet connection issues on Android browsers that don't properly support Universal Links

Problem

Phantom's browse deeplink only supports Universal Links (https://phantom.app/ul/browse/...). Many Android browsers don't properly implement Android App Links verification:

Browser Universal Link Intent URL
Chrome ✅ Works ✅ Works
Firefox ✅ Works ✅ Works
Opera ❌ Broken ✅ Works
UC Browser ❌ Broken ✅ Works
Samsung Internet ⚠️ Partial ✅ Works
Facebook in-app ❌ Broken ✅ Works
Instagram in-app ❌ Broken ✅ Works

Solution

Use Android intent URLs on Android devices which bypass browser app link verification and trigger OS-level intent resolution:

// iOS - Universal Link (well supported by Safari)
https://phantom.app/ul/browse/${encodedUrl}?ref=${encodedRef}

// Android - Intent URL (works on all browsers)
intent://ul/browse/${encodedUrl}?ref=${encodedRef}#Intent;scheme=https;host=phantom.app;package=app.phantom;end

Changes

  • packages/controllers/src/utils/MobileWallet.ts: Added Android detection and intent URL generation for Phantom
  • packages/controllers/tests/utils/MobileWallet.test.ts: Updated tests to cover both iOS (Universal Link) and Android (Intent URL) scenarios

Testing

  • Unit tests pass (24 tests)
  • TypeScript compiles without errors
  • Linting passes

Related


🤖 Generated with Claude Code


Note

Improves Phantom mobile redirect reliability by using Android intent URLs on Android while retaining Universal Links on iOS.

  • Adds androidPackage to CUSTOM_DEEPLINK_WALLETS.PHANTOM and Android detection via CoreHelperUtil.isAndroid()
  • Updates MobileWalletUtil.handleMobileDeeplinkRedirect to build Phantom intent URL on Android and fallback to Universal Link elsewhere
  • Expands tests in MobileWallet.test.ts to cover iOS UL vs Android intent flows and preserves existing behaviors for Solflare, Coinbase, and Binance
  • Adds a changeset documenting the patch

Written by Cursor Bugbot for commit 70e93f0. This will update automatically on new commits. Configure here.

Universal Links don't work reliably on many Android browsers (Opera,
UC Browser, Samsung Internet, in-app browsers like Facebook, Instagram).
This change uses Android intent URLs on Android devices which bypass
browser app link verification and work on all Android browsers.

- iOS continues to use Universal Links (well supported by Safari)
- Android now uses intent URLs that trigger OS-level intent resolution
- Added androidPackage constant for Phantom
- Updated tests to cover both iOS and Android scenarios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 70e93f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-ton Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-ui Patch
@reown/appkit-core Patch
@reown/appkit-utils Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet-button Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-cdn Patch
@reown/appkit-universal-connector Patch
@reown/appkit-testing Patch
@reown/appkit-common Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
appkit-basic-html Ready Ready Preview, Comment Jan 23, 2026 0:19am
appkit-demo Ready Ready Preview, Comment Jan 23, 2026 0:19am
appkit-gallery Ready Ready Preview, Comment Jan 23, 2026 0:19am
appkit-headless-sample-app Ready Ready Preview, Comment Jan 23, 2026 0:19am
appkit-laboratory Ready Ready Preview, Comment Jan 23, 2026 0:19am
10 Skipped Deployments
Project Deployment Review Updated (UTC)
appkit-basic-example Ignored Ignored Jan 23, 2026 0:19am
appkit-basic-sign-client-example Ignored Ignored Jan 23, 2026 0:19am
appkit-basic-up-example Ignored Ignored Jan 23, 2026 0:19am
appkit-ethers5-bera Ignored Ignored Jan 23, 2026 0:19am
appkit-nansen-demo Ignored Ignored Jan 23, 2026 0:19am
appkit-vue-solana Ignored Ignored Jan 23, 2026 0:19am
appkit-wagmi-cdn-example Ignored Ignored Jan 23, 2026 0:19am
ethereum-provider-wagmi-example Ignored Ignored Jan 23, 2026 0:19am
next-wagmi-solana-bitcoin-example Ignored Ignored Jan 23, 2026 0:19am
vue-wagmi-example Ignored Ignored Jan 23, 2026 0:19am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

Visual Regression Test Results ✅ Passed

⚠️ 15 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=712
Storybook Preview: https://6493191bf4b10fed8ca7353f-scdahqbcon.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

Warnings
⚠️

🌐 Non-company domain introduced (host: phantom.app) in packages/controllers/src/utils/MobileWallet.ts (line 15): https://phantom.app

⚠️

🌐 Non-company domain introduced (host: developer.chrome.com) in packages/controllers/src/utils/MobileWallet.ts (line 113): https://developer.chrome.com/docs/android/intents

⚠️

🌐 Non-company domain introduced (host: example.com) in packages/controllers/tests/utils/MobileWallet.test.ts (line 9): https://example.com

Generated by 🚫 dangerJS against 70e93f0

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

📦 Bundle Size Check

All bundles are within size limits

📊 View detailed bundle sizes

> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit


> size-limit

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         75.49 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 503 ms   on Snapdragon 410
Total time:   2 s
@reown/appkit/react
Size limit:   235 kB
Size:         233.34 kB with all dependencies, minified and gzipped
Loading time: 4.6 s     on slow 3G
Running time: 679 ms    on Snapdragon 410
Total time:   5.3 s
@reown/appkit/vue
Size limit:   80 kB
Size:         75.49 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 181 ms   on Snapdragon 410
Total time:   1.7 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         213.36 kB with all dependencies, minified and gzipped
Loading time: 4.2 s     on slow 3G
Running time: 587 ms    on Snapdragon 410
Total time:   4.8 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.16 kB with all dependencies, minified and gzipped
Loading time: 258 ms   on slow 3G
Running time: 27 ms    on Snapdragon 410
Total time:   284 ms

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.66% 39474 / 50182
🔵 Statements 78.66% 39474 / 50182
🔵 Functions 76.34% 4250 / 5567
🔵 Branches 86.74% 9615 / 11084
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/src/utils/MobileWallet.ts 97.39% 94.87% 100% 97.39% 62, 109, 119
Generated in workflow #16782 for commit 70e93f0 by the Vitest Coverage Report Action

The host must be part of the path after intent://, not a parameter in
the Intent fragment. The host= parameter is metadata for Android's
intent resolver, not the URI host.

Before: intent://ul/browse/...#Intent;scheme=https;host=phantom.app;...
After:  intent://phantom.app/ul/browse/...#Intent;scheme=https;...

The previous format constructed https://ul/browse/... (wrong)
The corrected format constructs https://phantom.app/ul/browse/... (correct)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Update Android intent URL format to use the host= parameter in Intent fragment
instead of including the host in the path.

Before: intent://phantom.app/ul/browse/...#Intent;scheme=https;package=...;end
After:  intent://ul/browse/...#Intent;scheme=https;host=phantom.app;package=...;end

This follows the correct Android intent URL specification where the host
should be specified in the Intent parameters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update Android intent URL to use the phantom:// scheme which works correctly
on Android devices.

Before: intent://ul/browse/...#Intent;scheme=https;host=phantom.app;package=app.phantom;end
After:  intent://browse/...#Intent;scheme=phantom;package=app.phantom;end

The phantom scheme directly triggers the Phantom app's intent filter without
requiring host parameter matching.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@enesozturk enesozturk enabled auto-merge January 23, 2026 12:35
@enesozturk enesozturk added this pull request to the merge queue Jan 23, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@0xmkh 0xmkh removed this pull request from the merge queue due to a manual request Jan 23, 2026
@0xmkh 0xmkh merged commit 1c7540f into main Jan 23, 2026
45 checks passed
@0xmkh 0xmkh deleted the fix/phantom-android-intent-deeplink branch January 23, 2026 12:36
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants