Deep Linking In React Native

Jerrin Thomas
Jun 7, 2022

--

In this post, I’ll quickly walk through how to add deep linking to a React Native app for both iOS and Android.

IOS

  1. Open info.plist and at the end of the file, add new values for URL types

2. Add the below code in react native to get the url and params

Linking.getInitialURL().then(res=>{ alert(res); }).catch(err=>{ console.log(err); } });

To open the app from other app => Linking.openURL(url scheme + ‘://’ + params)

eg: Linking.openURL(‘airbnb://people/168’);

ANDROID

  1. Open AndroidManifest.xml and add android:scheme & android:host in between activity

2. Add the below code in react native to get the url and params

Linking.getInitialURL().then(res=>{ alert(res); }).catch(err=>{ console.log(err); } });

To open the app from other app => Linking.openURL(scheme + ‘://’ + host + params)

eg: Linking.openURL(‘airbnb://people/168’);

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet