Add 'inAppIfPossible' argument to Linking.openURL

(Aaron Brager) #1

I wanted to briefly discuss a feature before I open a PR. Currently I can open a link in a web browser using:


This eventually calls openURL on the UIApplication object (e.g. [RCTSharedApplication -openURL:]). I would like to add an argument allowing us to call:

Linking.openURL(url, true);

If true is passed, on iOS, we would attempt to initialize and present an SFSafariViewController with this URL.

More robust customization (e.g. enabling Safari Reader, adjusting the tint color, etc.) would be out of scope for this proposal. Users can still write a native module for this or if there is sufficient demand it could be a follow-on PR.

(Brent Vatne) #2

i think Linking has a clear purpose and we shouldn’t overload it. in expo we have an api called WebBrowser that uses SFSafariViewController / SFAuthenticationSession / Chrome Custom Tabs, and i think using this or some other similar native module is sufficient to solve this problem