3

I use dynamic links in my Flutter app. My dynamic links won't open on Android 13, on all other api levels and on iOS the links work --> lead back into the app to the specified screen.

I already checked the Android Manifest and made sure that the intent-filter is correctly set.

So did anyone experience the same issue and did solve it? Is it necessary to verify Dynamic Links as Android App Links?

2 Answers 2

7

I found the issue. A Firebase Dynamic Link is a wrapper for an actual link.

Here's how it is build in my Flutter Web project:

service.generateDynamicLink(
  key: Keys.firebaseApi,
  dynamicLinkInfoWrapper: DynamicLinkInfoWrapper(
    dynamicLinkInfo: DynamicLinkInfo(
      domainUriPrefix: 'company.page.link',
      link: 'https://company.de',
      androidInfo: AndroidInfo(androidPackageName: 'de.company.app'),
      iosInfo: IosInfo(iosBundleId:'de.company.app'),
    ),
  ),
)

On API levels below 33 it was perfectly fine to declare the intent-filter for the domainUriPrefix 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:scheme="https"/>
  <data android:host="company.page.link"/>
</intent-filter>

so to declare the Dynamic Link itself. But in API 33 upwards it is also necessary now to declare what's inside the Dynamic Link, the link which looks 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:scheme="https"/>
  <data android:host="company.de"/>
</intent-filter>
Sign up to request clarification or add additional context in comments.

Comments

0

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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.