Android Deeplinking not working with multiple schemes

prago picture prago · Dec 5, 2014 · Viewed 9.3k times · Source

I am stuck with the following scenario. I defined the following deep link intent filters in the AndroidManifest.xml

Expected behavior is when I found a url of format http://​www.domain.com/a/blabla or when there is link in SMS/eMail of format domain/xyz the system should trigger my activity.

Case #1: Working 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: Working 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: NOT working

    <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 is really appreciated

Answer

prago picture prago · Dec 5, 2014

I placed both the deeplinks in two different intent filters and it worked!!!.