Skip to content

feat: add experimental_preferUniversalLinks property to switch to Universal Links by default for mobile linking #4294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Apr 29, 2025

Description

Introduces enableUniversalLinks property to let users default to Universal Link as a first approach to trigger mobile wallet links.

  • Updates connecting WC mobile UI to have similar experience with web wallets.
    • There is an "Open" button instead of "Try again" and this button gets enabled when the WC connection established.
  • Adds experimental_preferUniversalLinks property where uses link_mode property of the wallets if enabled and if that value exist.
    • If this enabled and the wallet doesn't have UL, it'll fallback to deep link as default method.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

In App Browser when the deep link is allow listed:

regular-deeplink-allowed.MP4

In App Browser when the deep link is not allow listed and Universal Link is not enabled:

binance-with-ul.MP4

In App Browser when the deep link is not allow listed and Universal Link is enabled:

zerion-ul.MP4

Default OS browser, using "Open" function to re-trigger the deeplink (or UL if enabled):

os-browser-open-button.MP4

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Apr 29, 2025

Copy link

changeset-bot bot commented Apr 29, 2025

🦋 Changeset detected

Latest commit: 4aa3266

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

This PR includes changesets to release 21 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button 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

Copy link

vercel bot commented Apr 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 6:59am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 6:59am
11 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-basic-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-basic-up-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-ethers5-bera ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-nansen-demo ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-vue-solana ⬜️ Ignored (Inspect) May 13, 2025 6:59am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am
vue-wagmi-example ⬜️ Ignored (Inspect) May 13, 2025 6:59am

Copy link
Contributor

@arein arein left a comment

Choose a reason for hiding this comment

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

Universal Link shouldn't be the "default" most likely. Instead only the fallback. Universal Links only work proper if triggered immediately after user interaction. When using Wagmi this is unpredictable as often there are network calls before triggering the Universal Link. That's why a few years back we defaulted to Deep Links.

@enesozturk enesozturk changed the title feat: call universal link as secondary action if deeplink fails feat: add enableUniversalLinks property to switch to Universal Links by default for mobile linking Apr 30, 2025
Copy link
Contributor

github-actions bot commented Apr 30, 2025

Warnings
⚠️ File apps/laboratory/src/utils/DataUtil.ts contains a KEY or SECRET
⚠️ File apps/laboratory/tests/shared/validators/ModalValidator.ts contains a KEY or SECRET
⚠️ File packages/appkit/src/client/appkit-base-client.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/OptionsController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/ConstantsUtil.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/CoreHelperUtil.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/TypeUtil.ts contains a KEY or SECRET
⚠️ File packages/controllers/tests/utils/CoreHelperUtil.test.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/partials/w3m-connecting-wc-mobile/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/partials/w3m-connecting-wc-web/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/utils/w3m-connecting-widget/index.ts contains a KEY or SECRET
⚠️ File packages/scaffold-ui/src/views/w3m-connect-view/index.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 4aa3266

Copy link
Contributor

github-actions bot commented Apr 30, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.23% 26822 / 35184
🔵 Statements 76.23% 26822 / 35184
🔵 Functions 67.85% 2261 / 3332
🔵 Branches 83.75% 5315 / 6346
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/client/appkit-base-client.ts 74.89% 88.2% 77.15% 74.89% 163, 215-216, 218-219, 224-225, 304-305, 341-347, 381-382, 403-409, 412-413, 430-431, 435, 442-443, 474-478, 491-505, 530-536, 540-552, 555-557, 560-562, 565-567, 570-572, 575-581, 584-586, 589-595, 611-623, 629-662, 665-675, 727-728, 734, 745-759, 765, 769-776, 789-793, 834, 876-880, 886-887, 899, 922-927, 998, 1002-1003, 1009, 1030-1031, 1041, 1043-1059, 1064, 1103-1104, 1117-1128, 1160-1167, 1211, 1217-1221, 1250-1253, 1257, 1273-1283, 1305-1316, 1345-1346, 1352-1378, 1541-1542, 1574-1575, 1578-1579, 1594-1597, 1600-1601, 1621-1622, 1625-1626, 1648-1649, 1663, 1671, 1674, 1678, 1683-1702, 1705-1714, 1729-1730, 1773-1776, 1779-1780, 1868-1869, 1872-1875, 1878-1879, 1882-1883, 1886-1887, 1890-1891, 1894-1898, 1907-1916, 1925-1936, 1312, 1685-1706
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/src/controllers/OptionsController.ts 85.88% 97.87% 51.94% 85.88% 229, 238-239, 290, 294, 348-351, 355-358, 362-365, 369-372, 409, 335, 404
packages/controllers/src/utils/ConstantsUtil.ts 100% 0% 100% 100%
packages/controllers/src/utils/CoreHelperUtil.ts 67% 88.97% 58.33% 67% 14-21, 25, 50-51, 67, 71, 78-79, 87, 110-111, 147, 163-164, 182-188, 197-201, 218-219, 228-236, 256-271, 291-296, 304, 309, 320, 328, 330, 332-333, 343-348, 352-355, 365, 370, 375, 394-405, 436, 439-441, 445-460, 463-488, 397-415
packages/scaffold-ui/src/partials/w3m-connecting-header/index.ts 92.85% 94.44% 66.66% 92.85% 22-23, 33
packages/scaffold-ui/src/partials/w3m-connecting-wc-desktop/index.ts 89.18% 77.77% 75% 89.18% 11-12, 41-42
packages/scaffold-ui/src/partials/w3m-connecting-wc-mobile/index.ts 91.35% 83.33% 66.66% 91.35% 36-37, 48, 60-62, 105
packages/scaffold-ui/src/partials/w3m-connecting-wc-web/index.ts 88.37% 66.66% 75% 88.37% 21-22, 32, 59-60
packages/scaffold-ui/src/utils/w3m-connecting-widget/index.ts 80% 74.19% 80% 80% 79-83, 91-92, 94-95, 104-107, 184, 202-203, 218-226
packages/scaffold-ui/src/views/w3m-connect-view/index.ts 84.15% 83.33% 88.88% 84.15% 78, 82, 102, 149-150, 159, 193, 207, 218, 257, 261, 273, 284, 298-299, 302-303, 313, 334-335, 347, 362-363, 368-392, 402-403
Generated in workflow #11771 for commit 4aa3266 by the Vitest Coverage Report Action

@enesozturk enesozturk requested review from arein and tomiir April 30, 2025 12:43
@enesozturk enesozturk force-pushed the enes/apkt-2684-universal-link-fallback-when-deeplink-fails-2 branch from 661105f to e6df959 Compare May 7, 2025 10:39
@enesozturk enesozturk marked this pull request as ready for review May 7, 2025 10:40
@enesozturk enesozturk changed the title feat: add enableUniversalLinks property to switch to Universal Links by default for mobile linking feat: add experimental_preferUniversalLinks property to switch to Universal Links by default for mobile linking May 8, 2025
@enesozturk enesozturk added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit d23248f May 13, 2025
38 checks passed
@enesozturk enesozturk deleted the enes/apkt-2684-universal-link-fallback-when-deeplink-fails-2 branch May 13, 2025 07:44
Dargon789 pushed a commit to Dargon789/appkit that referenced this pull request May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants