-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Description
After upgrading the dependency to Hotwire Native Android, it seems that proposing visits to a cross-domain URL does not trigger didOpenExternalUrl as previously.
The library seems to override didOpenExternalUrl from Hotwire Native to handle this, but this method no longer exists in Hotwire Native Android. On iOS it works.
Culprint:
The issue seems to be that the onDidOpenExternalUrl is no longer provided or invoked by Hotwire Native Android when a cross-domain navigation happen. Instead, they handle crossdomains navigations with a Route Decision Handler.
Solution:
One solution could be to implement the cross-domain check in the visitProposedToLocation and instead of sending RNVisitableViewEvent.VISIT_PROPOSAL to the RN side, we could trigger the RNVisitableViewEvent.OPEN_EXTERNAL_URL with the URL of the host of the location does not match the base URL.
Steps to reproduce
To reproduce:
- In a VisitableView, open a URL containing a link to a cross-domain URL, eg.
https://www.github.com - Tap the link
Expected behavior:
- The tapping of the external link should (per default) open a browser window using
Linking.open(..)
Actual behavior:
- A
onVisitProposalis triggered withadvanceaction andlocation=https://www.github.com
Snack or a link to a repository
React Native Turbo version
1.2.1
React Native version
0.74.7
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response