Skip to content

fix(referral): mobile web deep link fallback to app store (OK-46745)#10392

Merged
revan-zhang merged 5 commits intoOneKeyHQ:xfrom
0xchloe996:fix/referral-mobile-store-redirect-v2
Feb 28, 2026
Merged

fix(referral): mobile web deep link fallback to app store (OK-46745)#10392
revan-zhang merged 5 commits intoOneKeyHQ:xfrom
0xchloe996:fix/referral-mobile-store-redirect-v2

Conversation

@0xchloe996
Copy link
Contributor

@0xchloe996 0xchloe996 commented Feb 28, 2026

Summary

  • Show invitation UI (referral code + benefits + "Join" button) on mobile web instead of auto-redirecting; deep link / store redirect triggers on user tap
  • Android: use intent:// scheme with S.browser_fallback_url for reliable store redirect — raw onekey-wallet:// caused ERR_UNKNOWN_URL_SCHEME error page, destroying JS context and fallback timers
  • iOS: replace didHide visibility guard with elapsed-time check — the old visibilitychange/pagehide listener was falsely triggered by app→Safari transitions, permanently blocking the store redirect
  • Android fallback URL points to onekey.so/download (covers both Play Store and APK)
  • iOS fallback chain: itms-apps:// → HTTPS App Store web link

Test plan

  • iOS Safari (app not installed): open /r/CODE/app/perp → see invitation page → tap "Join" → redirected to App Store
  • iOS Safari (app installed): open /r/CODE/app/perp → see invitation page → tap "Join" → app opens with referral params
  • Android Chrome (app not installed): open /r/CODE/app/perp → see invitation page → tap "Join" → redirected to onekey.so/download
  • Android Chrome (app installed): open /r/CODE/app/perp → see invitation page → tap "Join" → app opens with referral params
  • Native app: deep link onekey-wallet://invited_by_friend?code=CODE&page=perp → navigates to perp tab + shows invite modal (unchanged behavior)
  • Desktop web: open /r/CODE/app/perp → navigates to perp tab + shows invite modal (unchanged behavior)

Made with Cursor


Open with Devin

- Show invitation UI on mobile web instead of auto-redirecting;
  user taps "Join" to trigger deep link / store fallback
- Android: use intent:// scheme with S.browser_fallback_url for
  reliable store redirect (raw onekey-wallet:// caused
  ERR_UNKNOWN_URL_SCHEME, destroying JS context and timers)
- iOS: replace didHide visibility guard with elapsed-time check;
  the old guard was falsely triggered by app-to-Safari transitions
- Android fallback points to onekey.so/download (Play Store + APK)
- iOS fallback: itms-apps:// → HTTPS App Store web link

Signed-off-by: 0xchloe996 <ziying@onekey.so>
Made-with: Cursor
@revan-zhang
Copy link
Contributor

revan-zhang commented Feb 28, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

0xchloe996 and others added 3 commits February 28, 2026 10:15
Signed-off-by: 0xchloe996 <ziying@onekey.so>
Made-with: Cursor
- P0: add effect cleanup and unmount guard for pushModal setTimeout
- P1: disable Join button after first press to prevent repeated taps
- P1: validate deepLinkUrl in buildAndroidIntentUrl (handle missing ://)

Signed-off-by: 0xchloe996 <ziying@onekey.so>
Made-with: Cursor
@revan-zhang revan-zhang merged commit e627951 into OneKeyHQ:x Feb 28, 2026
6 checks passed
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