flutterfirebasedartdynamic-linkingfirebase-dynamic-links

firebase_dynamic_links in Flutter does not work on Android version 13


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?


Solution

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