firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.63k stars 3.95k forks source link

🐛 [firebase_dynamic_links] FirebaseDynamicLinks.instance.onLink.listen is not triggering on migrating to Android 33 Flutter 3.10 #11518

Closed anovis closed 1 year ago

anovis commented 1 year ago

Bug report

Firebase deeplinking was working great before targeting Android 31 with Flutter 3.7, firebase_dynamic_links 5.0.11 but is not working on Android after upgrading to targeting Android 33 and Flutter 3.10, firebase_dynamic_links: 5.0.11 or 5.3.5. It is working correctly on IOS.

The deeplink correctly opens the app, but never triggers the instance.onLink.listen listener.

While debugging the code the listener is correctly instantiated during app init.

Steps to reproduce

Expected behavior

Deeplinking into the app should trigger the instance.onLink.listen

Sample project

  void initState() {
    super.initState();
    FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) {
      String goingTo = dynamicLinkData.link.path;
      widget.router!.push(goingTo);
    }).onError((error) {
      widget.router!.push("/error");
    });
  }

android manifest

            <meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
            <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" android:host="${host}" />
            </intent-filter>
        </activity>

Additional context

Add any other context about the problem here.


Flutter doctor

[!] Flutter (Channel stable, 3.10.6, on Ubuntu 22.04.2 LTS 5.15.0-78-generic, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code [✓] Connected device (3 available) [✓] Network resources


Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` PASTE OUTPUT INSIDE HERE ```

darshankawar commented 1 year ago

@anovis Thanks for the report. Can you take a look at this and see if it helps in your case or not ?

anovis commented 1 year ago

wow @darshankawar that worked. thank so much!!!! I can't believe I didn't come across that change anywhere. Really appreciate it!