How to implement Deep-linking and deferred deep-linking in your app

What is deep linking ?

In the context of the mobile apps, deep linking consists of using a uniform resource identifier (URI) that links to a specific location within a mobile app rather than simply launching the app. Deferred Deep Linking allows users to deep link to content even if the app isn’t already installed. Depending on the mobile device platform, the URI required to trigger the app may be different.


Where to use ?

Sometimes at app promotions time we directly post a url on social networking sites and directly sends a url via SMS.
In this case two conditions can occur

1>User already installed that app.
If user have app in device then deep-linking works.

2>User haven’t app inside device.
In this case deferred deep-linking works


Where we use deep-linking and deferred deep-linking?

When you want to open the particular screen of item of your app then you can use this.
E.g. Suppose You are using facebook (on browser or app) , and you click on url posted by flipcart/snapdeal for any item detail then flipcart/snapdeal app opens with item’s detail.
>When we click url of youtube video from google or from anywhere, then video opens on youtube app.


How it works ?

In Android, it’s a simple configuration in the manifest. Just define intent filters in the app manifest, and make sure you have at least one intent filter per deeplinkable activity. The intent filter should have a data tag with at least the android:scheme attribute set. You also need to handle the intent in the activity.

1:- Add Intent Filters for Your Deep Links

* action
* data
* category

example :-

intent-filter android:label="@string/filter_title_viewgizmos"
action android:name="android.intent.action.VIEW"
category android:name="android.intent.category.DEFAULT"
category android:name="android.intent.category.BROWSABLE"

data android:scheme="http"

data android:scheme="example"


2:-Read Data from Incoming Intents.


public void onCreate(Bundle savedInstanceState) {

Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();

Another code

In the below example we are opening different activities for different path/pathPrefix

as :-

data android:scheme="http"

path is /gizmos

data android:scheme="http"

path is /video

data android:scheme="http"

path is /songsDetail

When we install app(with above Added Intent Filters) then system save these url entries with activity(inside which we implement intent-filter), and on click on url , system suggest our app to open.

private void openDeepLink(Uri deepLink) {
String path = deepLink.getPath();

if ("gizmos".equals(path)) {
// Launch preferences
startActivity(new Intent(this, PushPreferencesActivity.class));
} else if ("video".equals(path)) {
// Launch the inbox activity
startActivity(new Intent(this, InboxActivity.class));
} else {
// Fall back to the main activity
startActivity(new Intent(this, MainActivity.class));

We can also get values from that url:-

We will get the value of name as:-

String urltextboxname=data.getQueryParameter(“name”);

How deferred deep-linking works ?

Deferred deep linking improves a user’s first-time experience with your app and increases app engagement. For example, say that a customer clicks on a link with a promo code or other offer to install an app. After the app is installed, the best experience would be to direct the customer to the promo code or offer page within the app. Deferred deep linking sends the customer to the right page after installation. You can even access the promotional code to populate forms in your app.

>In order to place a user in the proper location or screen within an app, the deep link must be passed through the app store into the app at install. To do this, the install needs to be attributed to its source so the app developer will need to use an install matching attribution platform to connect the install to the link clicked.

In deferred deep-linking case url can be same

but in this case app is not installed in device so this url will open in browser and url will redirect to market url with some data and then will be something like that :-

You can made your deferred url from here:-

In this case we have a install referral broadcast receiver in our app.
And when user install app after clicking the deeplinking url then url redirect to market url with some values .
and we get those values inside install referral receiver class from intent .




Linchpin Technologies Pvt Ltd, a mobile app development company Noida , is globally recognised as a enterprise app development company
references :-

for iOS.

Linchpin Technologies Pvt Ltd, a mobile app development company India , is globally recognized as enterprise app development company

12,991 total views, 2 views today

Share this OnShare on FacebookTweet about this on TwitterShare on LinkedInShare on Google+

Leave a Reply