React-native-firebase: Can't open dynamic link from react-native-webview

Created on 13 May 2020  路  5Comments  路  Source: invertase/react-native-firebase

I'm trying to run a firebase dynamic link from a webview inside the app itself to navigate to a different screen on the same app. It gives up the following error when the url inside webview was clicked.

Can't open url: intent://ncelltest.page.link/getapp#Intent;package=com.google.android.gms;action=com.google.firebase.dynamiclinks.VIEW_DYNAMIC_LINK;scheme=https;S.browser_fallback_url=https://play.google.com/store/apps/details%3Fid%3Dcom.mventus.ncell.activity;end;

Most helpful comment

So, have you asked in react-native-webview? If the link works in the browser, it seems the link works, and that's react-native-firebase's job. If it doesn't work in react-native-webview perhaps there is something missing there.

All 5 comments

Does that same link work if you cut and paste it in a mobile browser? I'm not sure the 'intent://' protocol works in general but I'm not sure (sorry)

Yes it works in the mobile browser, problem comes when try to navigate same url in the WebView

So, have you asked in react-native-webview? If the link works in the browser, it seems the link works, and that's react-native-firebase's job. If it doesn't work in react-native-webview perhaps there is something missing there.

There is a solution, But more like a work around so it seems like webview blocking up requests with "intent://" head, as a solution "intent://" can be added to whitelist of the WebView. check the code below,

 <WebView      
      originWhitelist={['intent://']}
      source={{ uri: 'http://10.0.2.2:3000/' }}/>  

But the user experience might not be that great as this makes the URL to be opened from the web browser and web browser will the one doing the navigation to the page inside the app.

This has nothing to do with react-native-firebase

Was this page helpful?
0 / 5 - 0 ratings