react native how to open a link in default browser from android and ios without using Linking.openURL

Viewed 35

I have a website, an ios app and android app.

Some deeplinks to the website I catch in the deeplink handling. However some I can't handle in the app so have to redirect the user back to the website. but in doing this I retrigger the deeplinks because for android the intent filter catches it again and in ios the same url is in the site-association so it retriggers the deeplink in the app again, causing an infinite loop.

Can I force opening the default browser without using Linking.openURL(url) ?

Is there perhaps some kind of intent I can send to open a browser? Linking.sendIntent(...)

I have many paths on www.mydomain.com/foo/bar which I handle in the deeplinking in the app via intent filters for android and site association for ios. but there many paths which I don't handle e.g. www.mydomain.com/foo/not-this and which i want redirect the user back to the browser.

I have too many paths to hard code them all and they change frequently, only a regex might help but as far as I understand it neither the android intent filters nor the site association file for ios have much in the way of regex handling so it limits you to using a small subset with wildcards etc. so I end up capturing more urls than can be handled in the app.

0 Answers
Related