328
0

What is deep linking and why your app needs it – how deep linking works

328
0
deep linking for mobile apps
Reading Time: 6 minutes

We easily share different web pages by just copying the URL and sending it. We can share a playlist page, social media post or a video link. This process is quite straightforward for websites, but how can we share pages in mobile apps?

At Vialma, we now have deep linking integrated and marketing campaigns for mobile apps now can target specific screens in the mobile app. Deep linking is used to generate links that navigate to the app. If the app is already installed on the device it will open the app or a specific screen inside the app, if it is not installed the link will redirect to the corresponding store based on the OS (Google Play or App Store).

Note the guides and examples in this article are for react native apps, but they also support native apps.

What is deep linking

Deep linking enables us to generate links/URLs for mobile apps, which open the app if it is installed and pass the data included in the deep link to the mobile app, which then can be parsed and used to navigate to a specific screen. If the app is not installed on the device yet, the deep link will open the app download page on the corresponding store (Google Play, App Store) based on the device OS.

There are multiple options for deep linking that you can use. If you have low budget and a lot of time, you can choose to go with native implementation and build everything by yourself, for example identifying the phone OS and navigating to the app page in the store, etc.

However, if you want to get a more sophisticated solution that provides link navigation logic built-in and save some time, you can choose a third party service and integrate it into your project. Some third-party services maintain the link if the app is not installed and pass it to the app after install, so the redirection to the desired page will still happen. Some examples of third party services are Appsflyer, Branch.io, Firebase.

How deep linking works

Before diving deeper into the specifics of the options, let’s check out this video by Firebase which explains deep linking (a.k.a. dynamic links) in a very interactive way – https://www.youtube.com/watch?v=LvY1JMcrPF8 .

Deep linking for mobile apps is different from web URLs in a way that you have to create those links first and specify logic in your app when and how to redirect to that link. You will either specify a general pattern like playlist/:id and handle the rest in your app, or you will have to manually create all the links for each screen (for example when using Firebase). The link that the user clicks usually includes deep link data which is then passed to the mobile app to parse and navigate to the desired screen. So the deep link can look like a random URL like domain.com/272/a6hU8 and then when clicking on it it will open the app and pass the deep link data that you specify when creating links, for example playlist/5 and navigate to the corresponding screen. So there are two layers when it comes to deep linking – what the user sees and what is hidden inside that link for the app to parse.

Source: https://www.appsflyer.com/products/customer-experience-deep-linking/

Now let’s talk about more details of some options that you can choose from.

Native implementation

There is an option to integrate custom deep linking with native libraries (react-navigation) without using any third-party services. However, in this case the URL will be something like this appName://playlist/5, not an HTTP URL. This article shows some instructions on how to do this. You will need to do some server work to connect these deep links to your domain to make them a valid URL, as this format is not recognized as a URL and safari may even block it. In case of native implementation, you will also need to add some logic to identify if the app is installed and redirect to the deep link, if not redirect to the store to download the app (this is behavior is already handled by the solutions offered by third party services).

So choosing native implementation would make sense if you don’t have any third party service already integrated and you want to save money as the third party services are paid. But consider that this solution will require much more time to make it stable and working.

Appsflyer implementation

Appsflyer offers OneLink service which creates custom links to redirect to the app. When the app is not installed it redirects user to the specific store (apple/google) to download it.

User journey after clicking a deep link

After it is installed and opened, most of the time the link will be maintained which means that your app will get the deep link data to navigate to the desired screen instead of generic homepage even after going to the store and freshly installing the app. However, as the user is not going to be logged in, you may need to hold the link data until they sign up or login. This depends on your product specifics.

Creating links

In the picture below you can see the link generation screen from the dashboard, where it has Deep Linking field which is exactly what we will check to redirect to a specific screen, it will be something like playlist/5. Appsflyer will generate unique short URL, which you can change and make it more understandable, for example .../2KKw/playlist5. However, note that you will need to generate new link for each content. You cannot specify generic field like :id that you can just change on the URL and it will redirect to another content like web. Each new content screen should have new URL as the deep linking data is what is parsed by the app.

The other option to generate links is to do from the app using the Appsflyer SDK. This can be helpful for adding share feature in the app. Technical documentation for generating links.

Deep linking data requirements should be shared with other team members to follow the same format as defined in the app.

Source: https://hq1.appsflyer.com/onelink

Firebase implementation

Firebase also has a service for deep linking called Dynamic links. You need to integrate Firebase SDK and the remaining part of integration will be the same as Appsflyer. As in case of most of the third-party services that provide deep linking feature, if the app is not installed it will open the store, if it is installed, it will open the app. The link format will be https://rnfbtestapplication.page.link or you can connect your own domain and have a nicer URL like yourdomain.com/app/link.

Another advantage of using Firebase integration is the access to the dashboard, where you will see stats about deep links performance in Firebase dashboard.

Creating links

The logic for generating the links is similar to Appsflyer. When generating links from the Firebase dashboard (screenshot below), you will choose the short URL which is the one that the users should click on, and the next step is to add deep link data which is what the app will have access to, in order to navigate to the desired screen. You can add link creation logic in the app as well for sharing feature. Also, Firebase provides API to generate links via REST API. More details here – https://firebase.google.com/docs/dynamic-links/create-links

Source: https://console.firebase.google.com/

Summary

If you are serious about promoting your app and sharing it with others, you definitely need deep linking. You can follow native implementation if you have enough time and want to save money, or if you can choose one of the third-party services that have deep linking feature, to save time and get a sophisticated solution. I talked about Appsflyer and Firebase in this post but there are more options that you can choose from. The choice depends on what your project is already using and what is your budget for this service.

Leave a Reply

Your email address will not be published.