Linking

Linking gives you a general interface for securely opening external URLs from JavaScript.

import { Linking } from 'react-native';

API #

Static methods #

canOpenURL (url) => Promise<boolean>

Returns a Promise that resolves to a boolean indicating whether the app can open the URL.

getInitialURL () => Promise<string>

Returns a Promise that resolves to the string of the URL that initially loaded the app.

openURL (url) => Promise<>

Try to open the given url in a secure fashion. The method returns a Promise object. If the url opens, the promise is resolved. If not, the promise is rejected.


Examples #

Updated
Edit
React Native for WebCopyright © Nicolas Gallagher and Facebook Inc.