I faced a similar issue where Firebase Dynamic Links were not working on Android 13. I tried numerous solutions from StackOverflow and GitHub issues, but none resolved the problem. After extensive debugging and multiple attempts, I finally discovered the solution.
To help others facing the same challenge, I’m sharing all the steps that worked for me. Follow these steps carefully to ensure Firebase Dynamic Links function correctly on Android 13:
1. Add android:autoVerify="true" to your intent-filter
Ensure your intent-filter for handling dynamic links includes the android:autoVerify="true" attribute to enable automatic verification of App Links.
2. Verify your domain
You must verify your domain to ensure it complies with Android's App Links requirements. Follow the official Android guide for verifying App Links:
Verify Android App Links
3. Use separate intent-filters for each domain
Define distinct intent-filter sections for each domain you want to handle. Below is an example of how to update your code.
Old Code (Single intent-filter for multiple domains):
<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:host="exampledomain.in" android:pathPrefix="/invite" android:scheme="http" />
<data android:host="exampledomain.page.link" android:scheme="https" />
</intent-filter>
New Code (Separate intent-filters for each domain):
<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>