I am using firebase_dynamic_links 5.0.11 and Flutter 3.3.9. I did implement the dynamic link by firebase and it is working as it is expected on Android version 12 or less. The problem is just on Android version 13 that the link can not open the app. I did find some solutions for android 13 like adding the SHA-256 key to Firebase and adding the android:autoVerify="true" to AndroidManifest. But they do not solve the problem. Does anyone have any clue about the solution?
7 Answers
The problem got solved by moving intent-filter inside the activity.
I changed it from:
<activity>
.....
<intent-filter>
<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:host="YOUR_CONTENT_LINK_DOMAIN"
android:scheme="https"/>
</intent-filter>
</activity>
to
<activity>
<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="YOUR_CONTENT_LINK_DOMAIN"
android:scheme="https"/>
</intent-filter>
.....
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
.....
</activity>
3 Comments
check do you have in your manifest
<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="YOUR_CONTENT_LINK_DOMAIN"
android:scheme="https"/>
</intent-filter>
I had the same issue on android 13 but on 12 and lower was ok. With this intent filter working ok for me
1 Comment
For Android 13 version intent-filter some minor changes. i was facing same issue i resolved this with bellow code snippet.
if You are using flavouring in your app then you need to follow bellow steps:
add firebase host links to respective flavours under app level
build gradlefile.flavorDimensions "default" productFlavors { dev { resValue "string", "app_name", "APP_NAME-D" resValue "string", "dynamic_link_domain", "domain_url_dev" dimension "default" applicationIdSuffix ".dev" } staging { resValue "string", "app_name", "APP_NAME-S" resValue "string", "dynamic_link_domain", "domain_url_stg" dimension "default" applicationIdSuffix ".staging" } prod { resValue "string", "app_name", "APP_NAME" resValue "string", "dynamic_link_domain", "domain_url_prod" dimension "default" } }AndroidManifest.xml code under activity
intent-filter android:autoVerify="true"> // If you are using flavouring
if you not using any flavouring you can try like this just add in AndroidManifest.xml code under activity
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<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:host="DOMAIN_LINK"
android:scheme="https"/>
</intent-filter>
</activity>
Comments
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="${deeplinkHost}" android:scheme="https"/>
</intent-filter>
For android 13 add autoverify=true in android manifest file.
Comments
I have two problems that create this issue:
- I have subdomain, and I forgot to add it to the
hostin my manifest - I have not submitted my SHA256 to Firebase Console
my full URL from Firebase dynamic link has subdomain like this: https://customer.yourOwnDomain.com
so you should include your subdomain in the host, and you can also use wildcard * to make it even safer like this
<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="*.yourOwnDomain.com" // your domain + subdomain, not domain.page.link !!!
android:scheme="https"/>
</intent-filter>
you also MUST to add your SHA256 to your Firebase console. please follow this documentation: Android app lacks SHA256. AppLinks is not enabled for the app.
Comments
I had faced the same issue, and my issue has been fixed by adding the. android:autoVerify="true"
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.BROWSABLE"/>
<data
android:host="YOUR DYNAMIC LINK"
android:scheme="https"/>
</intent-filter>
Comments
I encountered this same issue recently, and after extensive troubleshooting, I found a solution that worked for me. I've detailed all the steps in another answer I posted here.
To summarize the key points:
- Add android:autoVerify="true" to your intent-filter. Verify your domain using the steps outlined in the Android App Links documentation.
- Verify your domain using the steps outlined in the Android App Links documentation.
- Separate intent-filters for each domain to avoid conflicts.
Here's the updated code for reference:
<activity
android:name=".core.MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="exampledomain.in" />
<data android:pathPrefix="/invite" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="exampledomain.page.link" />
</intent-filter>