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.

Deep Link cannot be intercepted in method onShouldStartLoadWithRequest

See original GitHub issue

Bug description: Deep Link cannot be intercepted in method onShouldStartLoadWithRequest. Although it returned false, the application was called up.

<WebView
    ...
    onShouldStartLoadWithRequest = {this._onShouldStartLoadWithRequest.bind(this)}
    />
    _onShouldStartLoadWithRequest = (event) => {
        let url =event.url;
        if(url.indexOf("alipay://")>-1 || url.indexOf("alipays://")>-1) {
            Log.info("-----------------------------------_onShouldStartLoadWithRequest return false url = " + url);
            return false;
        }
        return true;
    }

To Reproduce:

Expected behavior: I need to intercept deep link and deal with them myself.

Screenshots/Videos:

Environment:

  • OS: Android
  • OS version: Android 8.0 Oreo
  • react-native version: 0.59.8
  • react-native-webview version: 5.12.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

7reactions
Overtormentcommented, Sep 3, 2020

someone mentioned in other ticket that you should whitelist your scheme first, and then it will work

originWhitelist={['*']}
1reaction
manoj-fareyecommented, Jan 13, 2021

@Overtorment tried with your suggestion. It works, Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deep Link cannot be intercepted in method ... - GitHub
Bug description : Deep Link cannot be intercepted in method onShouldStartLoadWithRequest. Although it returned false, the application was called ...
Read more >
React Native - open links in browser - Stack Overflow
I call the browser to open on onNavigationStateChange when the URL changes. The thing now is that the WebView still continues to process...
Read more >
Implementing Deep Linking in React Native apps - VentureDevs
This article complements the Webinar on Deep Linking that can be found ... to try to intercept information transmitted to your application via...
Read more >
Deep Linking Your React Native App | by Nader Dabit - Medium
In this post, I'll quickly walk through how to add deep linking to a React Native app for both iOS and Android using...
Read more >
Your Deep Links Might Be Broken: Web Intents and Android 12
In practice, this means the Android system will securely verify ownership of the link you are trying to process. The system uses a...
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