OriginWhitelist isn't working for deeplinks on Android
See original GitHub issueBug description:
Adding the url scheme of the app in originWhitelist
didn’t prevent the WebView to throw the loading page error.
Having a deeplink inside a webview will always throw the following error on Android.
Encountered an error loading page {"canGoBack": true, "canGoForward": false, "code": -10, "description": "net::ERR_UNKNOWN_URL_SCHEME", "loading": false, "target": 163, "title": "Webpage not available", "url": "urbanair://whereTo"}
The workaround for this was to call Linking.openURL()
and then return false
inside onShouldStartLoadWithRequest
when the request.url
starts with the url scheme. The error will still show in the webview, but shortly after it opens the deeplink.
To Reproduce:
Add the apps deeplink inside the webview and then press it.
Expected behavior:
The webview should open the app directly through the deeplink.
Screenshots/Videos:
Environment:
- OS: MacOS
- OS version:
10.15.7 (19H2)
- react-native version:
0.63.3
- react-native-webview version:
10.9.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:16
Top Results From Across the Web
Your Deep Links Might Be Broken: Web Intents and Android 12
Get ahead of the behavior changes in the latest Android 12 update by fixing deep links with web intents in this guide.
Read more >Prevent react-native-webview to open another app when ...
On my device I already have an app related to one of the links. When I open this link, it opens the app....
Read more >Create Deep Links to App Content - Android Developers
To allow users to enter your app from links, you must add intent filters for the relevant activities in your app manifest. These...
Read more >How to use WebView in React Native - Educative.io
Create a React Native project · Add dependencies · Link native dependencies · For iOS and macOS · For Android · Implementing a...
Read more >Part 3: Troubleshooting your deep links - YouTube
In this video we'll use the command line tools and the Android debug bridge to diagnose and debug common issues with Deep Links....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t close
how can all these fundamental critical bugs go ignored so long…