Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is host a required configuration for deep linking in Android?

My question is the exact of the title:

Is host a required configuration for deep linking in Android ?

I have deep linked to Google Play to an uri like this :

"market://details?id=com.facebook.katana" their AndroidManifest had:

                    <data
                    android:scheme="market"
                    android:host="details"
                    android:path=""/>

But now I am required to deep link to some other app that doesn't have any host config:

Is this even posible?

I went to the docs(https://developer.android.com/training/app-indexing/deep-linking.html#handling-intents) and I see they are also using host config:

<activity
    android:name="com.example.android.GizmosActivity"
    android:label="@string/title_gizmos" >
    <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" />
        <!-- Accepts URIs that begin with "example://gizmos” -->
        <data android:scheme="example"
              android:host="gizmos" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="gizmos" />
    </intent-filter>
</activity>

BUT IT ALSO SAYS:

"At minimum, the tag must include the android:scheme attribute."

So I am wondering is the host config mandatory for deep linking ?

like image 737
code4jhon Avatar asked Mar 18 '23 21:03

code4jhon


1 Answers

Short answer: NO

Any application can still provide deep link support without specifying a host, although is way more clear specifying it.

like image 80
code4jhon Avatar answered Apr 27 '23 07:04

code4jhon