I am trying to open an Activity using Android App Links. Activity is in a dynamic feature module, in the Google's Sample project.
I haven't uploaded the project to the Google Play, so I am testing using the debug build type, with a run configuration that includes the all dynamic features to the APK.
The code I want to test is:
private fun openUrl(url: String) { // url will be "http://uabsample-405d6.firebaseapp.com/url"
var intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
intent.setPackage(packageName)
intent.addCategory(Intent.CATEGORY_BROWSABLE)
startActivity(intent)
}
But when I try to navigate to the URL Feature, Android shows the application chooser dialog showing the same app twice:
Do you know why this is happening? Is this an intended behaviour?
Android Manifest of Url Module:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.android.samples.instantdynamicfeatures">
<dist:module
dist:instant="true"
dist:onDemand="false"
dist:title="@string/title_url_instant_module">
<dist:fusing dist:include="true" />
</dist:module>
<application>
<activity
android:name="com.android.samples.instantdynamicfeatures.UrlInstantModuleActivity"
android:label="@string/title_activity_url_instant_module"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter
android:autoVerify="true"
android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="uabsample-405d6.firebaseapp.com"
android:path="/url"
android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
</application>
</manifest>
<resources>
...
<string name="title_url_instant_module">url</string>
<string name="title_activity_url_instant_module">url_instant_module_activity</string>
</resources>
Update: I forgot to mention: I changed the sample project's application id with mine and placed the well-known Json on my website. I checked using App Links Assistant and it was fine.