4

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?

Mohsen Namazi
  • 71
  • 1
  • 6

5 Answers5

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

  • 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 – Mohsen Namazi Jan 12 '23 at 09:28
0

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>
Mohsen Namazi
  • 71
  • 1
  • 6
  • 1
    I did exactly what you said and I am still having problem. Did you do any thing else? – Aimn Blbol Mar 11 '23 at 02:57
  • @AimnBlbol any luck? I'm facing the same issue. – imgkl Mar 15 '23 at 13:25
  • @imgkl yes, I found instructions at https://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. – Aimn Blbol Mar 16 '23 at 06:41
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>
Vishal Zaveri
  • 1,372
  • 2
  • 5
  • 12
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.

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.

Alexa289
  • 8,089
  • 10
  • 74
  • 178