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.71k stars 3.97k forks source link

🐛 [firebase_dynamic_links] Not receiving anything in "PendingDynamicLinkData" callback #11467

Closed Faiza-Farooqui closed 1 year ago

Faiza-Farooqui commented 1 year ago

Bug report

Describe the bug Not receiving anything in "PendingDynamicLinkData" callback. I have generated links from firebase, it is opening my app but i am not receiving anything in the callback

Steps to reproduce

Steps to reproduce the behavior:

  1. write the below code
  2. Future initDynamicLinks() async { FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) { print("deeplink ${ dynamicLinkData.link.path}"); }).onError((error) { print('onLink error'); print(error.message); }); }
  3. and receive nothing in print

Expected behavior

should print the link

Sample project

Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix. Please link to the public repository URL.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

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

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

Thanks for the report @Faiza-Farooqui Using the plugin example, I do see that Future<void> initDynamicLinks() async { method does get called, but it doesn't print the dynamicLinkData inside the method.

The below code snippet also prints null indicating deep link is null:

ElevatedButton(
                        onPressed: () async {
                          final PendingDynamicLinkData? data =
                              await dynamicLinks.getInitialLink();
                          final Uri? deepLink = data?.link;
                          print(deepLink);

                          if (deepLink != null) {
                            // ignore: unawaited_futures
                            Navigator.pushNamed(context, deepLink.path);
                          } else {
                            print('deepLink is null');
                          }
                        },
                        child: const Text('getInitialLink'),
                      )
I/flutter (26453): I am called
D/EGL_emulation(26453): app_time_stats: avg=898.31ms min=2.04ms max=33476.76ms count=38
I/flutter (26453): null
I/flutter (26453): deepLink is null

Although it points me to a similar issue https://github.com/firebase/flutterfire/issues/8926#issuecomment-1196653932 for which can you try this and check if it helps in your case or not ?

Faiza-Farooqui commented 1 year ago

I am getting this error in my android app, please let me know here where Am I doing wrong. need to deliver the app by tomorrow

On Tue, Aug 15, 2023 at 3:59 AM darshankawar @.***> wrote:

Thanks for the report @Faiza-Farooqui https://github.com/Faiza-Farooqui Using the plugin example, I do see that Future initDynamicLinks() async { method does get called, but it doesn't print the dynamicLinkData inside the method.

The below code snippet also prints null indicating deep link is null:

ElevatedButton( onPressed: () async { final PendingDynamicLinkData? data = await dynamicLinks.getInitialLink(); final Uri? deepLink = data?.link; print(deepLink);

                      if (deepLink != null) {
                        // ignore: unawaited_futures
                        Navigator.pushNamed(context, deepLink.path);
                      } else {
                        print('deepLink is null');
                      }
                    },
                    child: const Text('getInitialLink'),
                  )

I/flutter (26453): I am called D/EGL_emulation(26453): app_time_stats: avg=898.31ms min=2.04ms max=33476.76ms count=38 I/flutter (26453): null I/flutter (26453): deepLink is null

Although it points me to a similar issue #8926 (comment) https://github.com/firebase/flutterfire/issues/8926#issuecomment-1196653932 for which can you try this https://github.com/firebase/flutterfire/issues/8926#issuecomment-1196653932 and check if it helps in your case or not ?

— Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/11467#issuecomment-1678753514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXVPK2B3SE56MPIHQ74CS3XVNJB3ANCNFSM6AAAAAA3QEBC3Y . You are receiving this because you were mentioned.Message ID: @.***>

Faiza-Farooqui commented 1 year ago

[image: image.png]

this is my whole code but it only print the first print statement "================== initDynamicLinks called" , after this nothing is happening or print

On Tue, Aug 15, 2023 at 4:14 AM Faiza Farooqui @.***> wrote:

I am getting this error in my android app, please let me know here where Am I doing wrong. need to deliver the app by tomorrow

On Tue, Aug 15, 2023 at 3:59 AM darshankawar @.***> wrote:

Thanks for the report @Faiza-Farooqui https://github.com/Faiza-Farooqui Using the plugin example, I do see that Future initDynamicLinks() async { method does get called, but it doesn't print the dynamicLinkData inside the method.

The below code snippet also prints null indicating deep link is null:

ElevatedButton( onPressed: () async { final PendingDynamicLinkData? data = await dynamicLinks.getInitialLink(); final Uri? deepLink = data?.link; print(deepLink);

                      if (deepLink != null) {
                        // ignore: unawaited_futures
                        Navigator.pushNamed(context, deepLink.path);
                      } else {
                        print('deepLink is null');
                      }
                    },
                    child: const Text('getInitialLink'),
                  )

I/flutter (26453): I am called D/EGL_emulation(26453): app_time_stats: avg=898.31ms min=2.04ms max=33476.76ms count=38 I/flutter (26453): null I/flutter (26453): deepLink is null

Although it points me to a similar issue #8926 (comment) https://github.com/firebase/flutterfire/issues/8926#issuecomment-1196653932 for which can you try this https://github.com/firebase/flutterfire/issues/8926#issuecomment-1196653932 and check if it helps in your case or not ?

— Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/11467#issuecomment-1678753514, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXVPK2B3SE56MPIHQ74CS3XVNJB3ANCNFSM6AAAAAA3QEBC3Y . You are receiving this because you were mentioned.Message ID: @.***>

darshankawar commented 1 year ago

I am getting this error in my android app,

Can you provide the actual error ?

google-oss-bot commented 1 year ago

Hey @Faiza-Farooqui. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@Faiza-Farooqui if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.