Android Deeplinking does not work with multiple schemes

I adhere to the following scenario. I have defined the following semantic link filters in AndroidManifest.xml

Expected behavior, when I found a URL of the format http://โ€‹www.domain.com/a/blabla or when there is a link in the SMS / eMail format of the domain/xyz format, the system should initiate my activity.

Case # 1: Works fine

  <activity android:name=".MYActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="xyz" android:scheme="domain" /> </intent-filter> </activity> 

Case # 2: Works fine

  <activity android:name=".MYActivity"> <intent-filter> <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" android:host="www.domain.com" android:pathPrefix="/a" /> </intent-filter> </activity> 

Case 3: DOES NOT WORK

  <activity android:name=".MYActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="xyz" android:scheme="domain" /> <data android:scheme="http" android:host="www.domain.com" android:pathPrefix="/a" /> </intent-filter> </activity> 

Any suggestions / points / help really appreciated

+6
source share
3 answers

I placed both depiplanes in two different intent filters, and it works !!!.

+10
source

See the <data> documentation: it states that:

All <data> elements contained in the same <intent-filter> element contribute to the same filter.

Hence

 <intent-filter> <data android:host="xyz" android:scheme="domain" /> <data android:scheme="http" android:host="www.domain.com" android:pathPrefix="/a" /> <intent-filter> 

interpreted equivalently as (not real code)

 <intent-filter> <data android:host="xyz" android:scheme="domain" android:scheme="http" android:host="www.domain.com" android:pathPrefix="/a" /> <intent-filter> 

which obviously has some inconsistencies, for example, host xyz VS www.domain.com .

+5
source

Here is a tutorial in which I say it helps Link to Tutorial

0
source

Source: https://habr.com/ru/post/979183/


All Articles