35

Here is an explanation of using deep links in navigation component:

https://developer.android.com/guide/navigation/navigation-deep-link

It says:

An explicit deep link is a single instance of a deep link that uses a PendingIntent to take users to a specific location within your app. When a user opens your app via an explicit deep-link, the task back stack is cleared and replaced with the deep link destination.

Now the question is what are the differences between Deep Links, Android App Links, App Indexing, and Firebase Dynamic Links and when should we use each one of them?

Also, there is another point that should we set up all of them?

aminography
  • 21,986
  • 13
  • 70
  • 74
Etienne Lawlor
  • 6,817
  • 18
  • 77
  • 89
  • check [this](https://stackoverflow.com/questions/43635420/difference-between-firebase-app-indexing-and-app-links/43635548#43635548) for app indexing and deep links – Maddy Nov 03 '18 at 11:33
  • 1
    Seems like Google has deprecated Dynamic Links as of Q2 2023 https://firebase.google.com/support/dynamic-links-faq – Vering Jun 01 '23 at 08:22

2 Answers2

72

Deep Links:

As you know a Deep Link is the simplest one which is totally local in your app. Activities can be triggered by clicking on a specific pattern URI. The pattern is defined in android Manifest using intent-filter. If multiple handlers existed for a URI, the Android system allows the user to select the target app from a dialog. It is obvious that if your app is not installed on the device, the Deep Link does not work. Additional data which is used by the app carried by URL query params.

  • To see its usage example, refer to this.

Android App Links:

Android App Links are the same as Deep Links with a small difference. Your app can introduce itself as the default handler of specific pattern links. So when there are several apps to handle the target link, your app handles it without showing app-selection dialog. Furthermore, if the user doesn't want the app to be the default handler, they can override this behavior from their device's system settings. Android App Links feature is only available on Android 6.0 (API level 23) and higher.

  • To see its usage example, refer to this.

Dynamic Links:

Dynamic Links eliminates DeepLink weaknesses. With Dynamic Links, you treat on all platforms such as Android, iOS and web in a similar way. It seamlessly transits users from your mobile website to the equivalent content within your app (if the user has not installed your app on her/his device, the content would be shown after app installation). Furthermore, you can see the log of a Dynamic Link in the Firebase console. Another feature is to find out where the user clicked on the link. (Places you share the link)

  • To see its usage example, refer to this and this.

App Indexing:

App Indexing is a bit different thing. Its focus is on google search results. Using App Indexing, Google indexes the content of your app as well as your website. If the existing URLs in-app and website are the same, Google verifies that you own both of them. Then in Google's search results, users who have installed your app on their devices go directly to the content in your app when they click on a link. Furthermore, it's possible to index personal contents in the app by Google. So when the user searches a keyword in Google, related in-app contents will be shown in search results.

  • To see its usage example, refer to this.
aminography
  • 21,986
  • 13
  • 70
  • 74
  • What about Android app links? Also what do you provide for the deeplink in the Navigation architecture component? – Etienne Lawlor Nov 03 '18 at 06:48
  • Thanks for adding that bit of info. But how does this work with the Navigation architecture Component? – Etienne Lawlor Nov 03 '18 at 07:10
  • 1
    If you are using Navigation architecture components, the best option to open your app by an external link is to use Firebase Dynamic Links. When you receive a `PendingDynamicLinkData` in the listener defined in main activity, you can decide to show what page you want using navigation controller. – aminography Nov 03 '18 at 07:52
  • _Furthermore, if the user doesn't want the app to be the default handler, they can override this behavior from their device's system settings._ --- what does it mean? So anybody can hijack the call into my app?? – Zoli May 25 '21 at 08:16
  • Seems like Google has deprecated Dynamic Links as of Q2 2023 https://firebase.google.com/support/dynamic-links-faq – Vering Jun 01 '23 at 07:59
2


1)Deep links:
For example when go to you tube and select share video option by link.

Then copy the link and paste in note pad and save it .Then open the file in android device (tablet/mobile,etc).
Then click the link then see what happens .
If there is a youtube app means the android os asks user to choose an option youtube app or browser,etc.
If user clicks youtube app then the link is processed in the you tube app .

.
Deep link is a link that make the android OS to search the suitable app which is capable to process the text/link and if more than 1 found means it ask to select which is want.

We can make our app will use deep link.
Make the required activity of the app (which activity you need to open when the link is clicked) as a browsable via intent in the android manifest and action as View.


Refer:

1)https://developer.android.com/training/app-links/deep-linking

sample code:

<activity
    android:name="com.example.android.GizmosActivity"
    android:label="@string/title_gizmos" >
    <intent-filter android:label="@string/filter_view_http_gizmos">
        <action **android:name="android.intent.action.VIEW**" />
        <category android:name="android.intent.category.DEFAULT" />
        <**category android:name="android.intent.category.BROWSABLE**" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="/gizmos" />
        <!-- note that the leading "/" is required for pathPrefix-->
    </intent-filter>
    <intent-filter android:label="@string/filter_view_example_gizmos">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "example://gizmos” -->
        <data android:scheme="example"
              android:host="gizmos" />
    </intent-filter>
</activity>
SIVAKUMAR.J
  • 4,258
  • 9
  • 45
  • 80