How it works...
In step 2, we defined all the links that our app uses. Each link object has a type property that we use in the handleButtonPress method defined in step 5.
This handleButtonPress function uses the link's type to determine which one of two strategies will be used. If the link's type is 'internal link', we want to open the link with the device browser as a modal that pops up within the app itself. For this purpose, we can use Expo's WebBrowser helper, passing the URL to its openBrowserAsync method. If the link's type is 'external link', we'll open the link with React Native's Linking helper. This lets you see the different ways you can open a website from your app.
The Linking helper can handle protocols other than HTTP and HTTPS ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access