5

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 7

1

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>
Sign up to request clarification or add additional context in comments.

3 Comments

I did exactly what you said and I am still having problem. Did you do any thing else?
@AimnBlbol any luck? I'm facing the same issue.
@imgkl yes, I found instructions at docs.flutter.dev/cookbook/navigation/set-up-app-links. Make sure to follow it carefully and do the test at the bottom of the instructions.
0

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

Thank you for your comment. I had it on the manifest but your answer caused me to think more about it. The problem got solved by moving this 'intent-filter' inside the 'activity' and it is working now
0

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:

  1. add firebase host links to respective flavours under app level build gradle file.

     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"
        }
    }
    
  2. 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

0
<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

0

I have two problems that create this issue:

  1. I have subdomain, and I forgot to add it to the host in my manifest
  2. 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

0

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

0

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:

  1. Add android:autoVerify="true" to your intent-filter. Verify your domain using the steps outlined in the Android App Links documentation.
  2. Verify your domain using the steps outlined in the Android App Links documentation.
  3. 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>

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.