as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support

expo-linking

@amazon-devices/expo-linking provides utilities for your app to interact with other installed apps using deep links. This library provides helper methods for constructing and parsing deep links into your app. This module is an extension of the React Native Linking module.

Installation

  1. Add the JavaScript library dependency in the package.json file.

    Copied to clipboard.

     dependencies: {
         ...
         "@amazon-devices/expo-linking": "~2.0.1",
         "expo": "~50.0.0",
         ...
     }
    
  2. Reinstall dependencies using the npm install command.

Examples

Copied to clipboard.

import * as Linking from '@amazon-devices/expo-linking';
import React, {useEffect, useState} from 'react';
import {Button, StyleSheet, Text, View} from 'react-native';

const URL = 'pkg://com.amazondeveloper.uisvg-demo.main';

export const App = () => {
  const [parsedUrl, setParsedUrl] = useState<string | null>(null);

  useEffect(() => {
    const parsed = Linking.parse(URL);
    setParsedUrl(JSON.stringify(parsed, null, 2));
  }, []);

  const onLinking = async () => {
    const supported = await Linking.canOpenURL(URL);
    if (supported) {
      await Linking.openURL(URL);
    }
  };

  return (
    <View style={styles.container}>
      {parsedUrl && <Text style={styles.text}>{parsedUrl}</Text>}
      <Button title="Link to application" onPress={onLinking} />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    backgroundColor: 'white',
    flex: 1,
  },
  text: {
    color: 'black',
    fontSize: 32,
  },
});

API reference

See the documentation page for information about this library and API reference: Official Expo documentation for expo-linking.

Hooks

Hook Description
useURL Returns the initial URL followed by any later changes to the URL.

Methods

Method Description
canOpenURL Determines whether or not an installed app can handle a given URL. On the web this always returns true because there is no API for detecting which URLs can be opened.
collectManifestSchemes Collects a list of platform schemes from the manifest. Based on the Scheme modules from @expo/config-plugins, which are used for collecting the schemes before prebuilding a native app.
createURL Helper method for constructing a deep link into your app, given an optional path and set of query parameters. Creates a URI scheme with two slashes by default. The scheme in bare and standalone must be defined in the Expo config (app.config.js or app.json) under expo.scheme.
getInitialURL Gets the URL that launches the app if launched by a link.
hasConstantsManifest Ensures the user has linked the expo-constants manifest in the bare workflow.
hasCustomScheme Returns whether the application is configured with a custom scheme.
openSettings Opens the operating system settings app and displays the app’s custom settings, if it has any.
openURL Attempts to open the given URL with an installed app.
parse Helper method that parses out deep link information from a URL.
parseInitialURLAsync Helper method that wraps React Native's Linking.getInitialURL() in Linking.parse(). Parses the deep link information out of the URL that opens the experience initially. If no link opened the app, all the fields are null.
resolveScheme Returns a string representing the resolved scheme. If a custom scheme is configured, it returns that scheme.

Event subscriptions

Subscription Description
addEventListener Adds a handler to Linking changes by listening to the URL event type and providing the handler. However, use the useURL() hook instead.

Supported versions

Package Version Based On @amazon-devices/react-native-kepler version
2.0.x 6.1.1 2.0.x

Supported Third-Party Libraries and Services.


Last updated: Sep 30, 2025