react-navigation/react-navigation.github.io

Deeplinking guide has incorrect android intent-filter

OrkhanAlikhanov opened this issue · 1 comments

<activity
android:name=".MainActivity"
android:launchMode="singleTask">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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="mychat" />
<data android:scheme="https" android:host="www.example.com" />
<data android:scheme="http" android:host="www.example.com" />
</intent-filter>
</activity>

The data fields gets merged:

<data android:scheme="mychat" /> 
<data android:scheme="https" android:host="www.example.com" /> 
<data android:scheme="http" android:host="www.example.com" /> 

becomes:

<data android:scheme="mychat"
           android:scheme="https"
           android:scheme="http"
           android:host="www.example.com" /> 

And with that, only mychat://www.example.com will open the app.

Source https://stackoverflow.com/a/27321468/5555803

The solution is to use different intent-filters.

This caused me issues so I reported. I can send a PR if this is approved.