How to Deep Link in React Native for iOS and Android

Traditional URLs can navigate to websites, but not to apps. Mobile deep linking fixes this problem by enabling links to install, open, and pass data into your app. Deep linking will help increase discovery and overall user engagement for your app.

This is part of a blog series on deep linking in Unity, deep linking in React Native, and deep linking in Xamarin for iOS and Android. 

 

How Does Deep Linking Work

Deep linking into your app is made possible by internal functionalities of the device’s operating system. After configuring your app for deep linking, both iOS and Android will allow users to navigate into your app using a custom URI Scheme like my-app-scheme://data=123. Early deep linking systems worked by wrapping these custom URI scheme links inside a standard https:// or https:// link, and then using the device’s web browser to redirect users back to your app.

Unfortunately, as of iOS 9.2, Apple has deprecated URI schemes for a more powerful method called Universal Links. Employing Universal Links allows you to open your app directly without first having to open a mobile browser. This method is more user-friendly and more secure, as your app cannot be hijacked by malicious Javascript on websites (which was a possibility with URI schemes). The downside: Universal Links are harder to configure. You will need to host a custom Apple App Site Association file on your Universal Link domain (for example https://branchster.app.link/apple-app-site-association), as well as add special method calls within your app to interpret the Universal Link.

Android has also implemented a way to open the app directly with a method called App Links. App Links behave very similarly to Apple’s Universal Links: you will need to host a special file on your link domain (for example https://branchster.app.link/.well-known/assetlinks.json), as well as have custom methods in your app to interpret the App Link. However, unlike iOS, Android still supports URI scheme deep linking.

Once deep linking is configured, all three methods of deep linking (URI schemes, Universal Links, App Links) will give your users a better experience as they can easily enter your app from deep links they find on the web.

 

What React Native Plugins Enable Deep Linking

Fortunately, you don’t have to set up all of this yourself—the React Native platform has plugins that help with the technical configuration.

React Native Deep Linking Native Support Branch
Number of downloads link unclear link
Free service
Handles URI Scheme linking [1]
Handles iOS Universal Links [2]
Handles Android App Links [3]
Hosts AASA and assetlinks files [4]
Passes any custom data from deep link into app
Tracks install attribution
Tracks deep link analytics with a dashboard
Tracks users and custom events
Has user referral program with credit tracking
Enables you to create and share deep links inside the app
Supports desktop to app deep linking [5]
Supports linking in social media and ad platforms
Supported by a full-time integration team

[1] URI Schemes will open the app, but cannot pass data discreetly.
[2] URI Schemes have been deprecated and replaced by Universal Links after iOS 9.2.
[3] Android App Links allow for direct app opens without needing to open the browser first.
[4] The AASA and assetlinks files are needed for Universal Links and App Links to work.
[5] Made possible with Branch’s free Text Me The App, Journeys, and Deep View features.

 

How to Deep Link with Branch

While all of these plugins help configure your app project, Branch also does all the heavy lifting of remote server configuration for you. Branch’s SDKs are built off multiple hooks that compile your app and prepare it for deep linking in both Android and iOS. Additionally, Branch’s Dashboard configures your links and domain files according to your customizations and industry standards.

All you have to do is set up your Branch Dashboard and modify your app to configure routing. That’s it. Integration complete. Deep linking enabled. Then, you’ll be able to create and share deep links based on your campaigns and content, and watch your app grow as your users become more engaged. Click here to request a Branch demo, and click here to start deep linking with Branch!