question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OriginWhitelist isn't working for deeplinks on Android

See original GitHub issue

Bug 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:

IMG_4E6127203179-1

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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:16

github_iconTop GitHub Comments

11reactions
gabimonchacommented, Mar 14, 2021

Don’t close

4reactions
a613commented, Apr 22, 2021

how can all these fundamental critical bugs go ignored so long…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found