Skip to content
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

Fix app store deep links in dapp browser #6267

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

maxbbb
Copy link

@maxbbb maxbbb commented Nov 15, 2024

Fixes APP-1833

What changed (plus any additional context for devs)

  • handleOnOpenWindow checks if url is app store link and prevents browser navigation if so, opening the link natively instead
  • consolidated url protocol prefix validation logic

This does not handle

  • if the user directly inputs an app store link to the address bar, as this would require more extensive changes and is a very unlikely user behavior
  • specific app deep link schemes (e.g metamask://route)

Screen recordings / screenshots

RPReplay_Final1731628405.mov

What to test

on iOS, must test on physical device.

Copy link

linear bot commented Nov 15, 2024

@@ -6,6 +6,11 @@ export const HTTP = 'http://';
export const HTTPS = 'https://';
export const RAINBOW_HOME = 'RAINBOW_HOME';

export const IOS_APP_STORE_URL_PREFIXES = ['itms-apps://', 'itms-appss://', 'https://itunes.apple.com', 'https://apps.apple.com'];
export const ANDROID_APP_STORE_URL_PREFIXES = ['market://', 'https://play.google.com/store', 'https://play.google.com/store/apps'];
Copy link
Author

Choose a reason for hiding this comment

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

redundant prefix only need https://play.google.com/store

Comment on lines +15 to +18
export function isMissingValidProtocol(url: string): boolean {
return !url.startsWith(HTTP) && !url.startsWith(HTTPS);
}

Copy link
Member

Choose a reason for hiding this comment

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

Can remove this version and use isMissingValidProtocolWorklet everywhere. Don't need to duplicate it as the 'worklet'; directive just gets ignored if a worklet is called from the JS thread.

Could do the same for isValidURL, normalizeURL, and generateUniqueId while you're in here.

@brunobar79
Copy link
Member

Launch in simulator or device for c51c5ef

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.

3 participants