react-native-webview / react-native-webview

React Native Cross-Platform WebView
https://github.com/react-native-community/discussions-and-proposals/pull/3
MIT License
6.32k stars 2.96k forks source link

Open links in supported apps on Android #3356

Closed esenbi closed 1 month ago

esenbi commented 3 months ago

Bug description:

Tapping a link that can be opened by a supported application does not launch the app on Android, whereas it works correctly on iOS.

For example, on iOS, clicking a zoom invite link in a webview opens the zoom app immediately, but on Android, it opens the link first and only then the zoom app.

With youtube links, iOS opens them in the youtube app if it's installed, but Android just opens them in a regular browser.

We fixed this by adding target="_blank" to links. Surprisingly, this solved the problem, but it's not the best solution.

Also, we tried using onShouldStartLoadWithRequest to check url and handle it with Linking.openURL() if needed. But, there is another problem, that we need to have list of urls, which is not flexible solution.

To Reproduce:

Open this website in a webview: https://fm.domme.kz/linking.html and click on the links.

Expected behavior:

Similar to iOS. If system has an app installed that can open a link, then the link should open in that app.

Screenshots/Videos:

Environment:

github-actions[bot] commented 1 month ago

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically