1

I'm having some issue with Firebase Dynamic Links in combination with my Flutter app. I run into the issue below when running the the Flutter app. This only happens on Android 13 all version below work fine.

Activity not found to handle Intent action [CONTEXT service_id=77 ]
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.foo.bar/com.foo.bar.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?

Now Android is since version 13 handling the intents more strictly. So I think I might have a small configuration mistake somewhere only I just cannot find it. Already had contact with Firebase Support but they tell me that this issue is out of scope.

I was hoping maybe someone here knows what is configured incorrectly.

The link I'm using is:

https://foobar.page.link/?link=https://foo-bar-a5111.firebaseapp.com/__/auth/action?apiKey%3DAIzaSyDHlkdWSvP0RLERv3dYszCB6rJG66CL49c%26mode%3DsignIn%26oobCode%3Di9r0XZY8GjHNlvZbEeoAwhGkPCpwsT_m43AIt-gFnDIAAAGGgGtBOQ%26continueUrl%3Dhttps://foo.bar/registration_email_verification?id%253D123%26lang%3Den&apn=com.foo.bar&amv&afl=https://foo-bar-a5111.firebaseapp.com/__/auth/action?apiKey%3DYIzaSyDXlkdWSvP8RLERv3dYszCB6rJ666CL49c%26mode%3DsignIn%26oobCode%3Di9r0XZY8GjHNlvZbEeoAwhGkPCpwsT_m43AIt-gFnDIAAAGGgGtBOQ%26continueUrl%3Dhttps://foo.bar/registration_email_verification?id%253D123%26lang%3Den

AndroidManifest.xlm (from the APK):

<?xml version="1.0" encoding="utf-8"?>

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="1"
    android:versionName="1.0.0"
    android:compileSdkVersion="33"
    android:compileSdkVersionCodename="13"
    package="com.foo.bar"
    platformBuildVersionCode="33"
    platformBuildVersionName="13">

    <uses-sdk
        android:minSdkVersion="21"
        android:targetSdkVersion="33" />

    ...

    <application
        android:label="fdl_issue"
        android:icon="@ref/0x7f080000"
        android:name="android.app.Application"
        android:debuggable="true"
        android:appComponentFactory="androidx.core.app.CoreComponentFactory">

        <activity
            android:theme="@ref/0x7f0b0000"
            android:name="com.foo.bar.MainActivity"
            android:exported="true"
            android:launchMode="1"
            android:configChanges="0x40003fb4"
            android:windowSoftInputMode="0x10"
            android:hardwareAccelerated="true">

           ...

            <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"
                    android:host="foo.bar" />
            </intent-filter>

            <intent-filter>
                <action
                    android:name="android.intent.action.MAIN" />
                <category
                    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

        ...

    </application>

    ...

</manifest>

/android/app/src/main/kotlin/com/foo/bar/MainActivity.kt:

package com.foo.bar

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

1 Answers1

0

Firebase is opening the app with the https://foo-bar-a5111.firebaseapp.com/__/auth/action... URL as configured in the link query parameter. This meant that I needed to update my <intent-filter> allow the host from that link to 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="foo.bar" />
                <data android:host="foo-bar-a5111.firebaseapp.com" />
            </intent-filter>

I hope this saves you guys some time!