Skip to main content
The Linking API provides a general interface to interact with both incoming and outgoing app links. You can open URLs in the browser, launch other apps, and handle deep links into your app.

Import

Methods

openURL()

Attempts to open a URL with any of the installed apps.
string
required
The URL to open. Can be:
  • Web URLs: https://example.com
  • Phone numbers: tel:+1234567890
  • SMS: sms:+1234567890
  • Email: mailto:email@example.com
  • App-specific schemes: myapp://path
Returns: Promise<void> - Resolves when the URL is opened, rejects if no app can handle the URL.

canOpenURL()

Checks if an app is installed that can handle a given URL.
string
required
The URL to check.
Returns: Promise<boolean> - Resolves to true if the URL can be opened, false otherwise.
iOS: You must add URL schemes to LSApplicationQueriesSchemes in Info.plist or canOpenURL() will always return false for third-party schemes.

getInitialURL()

Returns the URL that launched the app, if any.
Returns: Promise<string | null> - The initial URL, or null if the app wasn’t launched via a link.

addEventListener()

Listens for incoming app links while the app is running.
string
required
Must be 'url'.
function
required
Callback function that receives an object with a url property.
Returns: EventSubscription - Object with a remove() method to unsubscribe.

openSettings()

Opens the operating system settings for your app.
Returns: Promise<void>

sendIntent() (Android only)

Launches an Android intent with optional extras.
string
required
The Android intent action (e.g., 'android.intent.action.VIEW').
array
Array of extra data objects with key, value properties.
Returns: Promise<void>

Examples

Opening a Web URL

Making a Phone Call

Sending an Email

Sending an SMS

Opening App Settings

Opening Maps

Opening Social Media Apps

Android Intent Example

iOS Setup

Add URL schemes to your Info.plist:

Android Setup

Add intent filters to your AndroidManifest.xml:

Common URL Schemes

Best Practices

Always check if a URL can be opened with canOpenURL() before calling openURL() to handle cases where required apps aren’t installed.
Wrap Linking.openURL() calls in try-catch blocks to handle errors gracefully.
On iOS, you must declare URL schemes you want to query in LSApplicationQueriesSchemes in Info.plist, or canOpenURL() will always return false.

Error Handling