EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

onDynamicLinkCallback is never called #1543

Open AntJW opened 4 years ago

AntJW commented 4 years ago

Hi,

I set up Email-Link login and Dynamic Links. After clicking the link in received email from auth, the app opens, but while observing the log output, onDynamicLinkCallback is never called and therefore I cannot route the user accordingly. This is especially problematic if users click on the same email link, because the Email-Link seems to expire after the first click (as it should IMO). I would need to route and/or notify users in the case they are logged in our not after clicking the link, but I cannot do this if onDynamicLinkCallback is never called. I am currently testing with a physical ios device (version 13.3). Please help.

firebase.init({
    onDynamicLinkCallback: function (result) {
      console.log("Dynamic Link: " + result.url+ ", matchConfidence: "+ result.matchConfidence); 
    }
  });

It looks like this issue may be related to the TODO item you noted regarding the "data" param here. Can someone confirm?

AntJW commented 4 years ago

Hi @EddyVerbruggen, I thought is issue is important enough to ping you directly. Forgive me if this is not the right procedure.

maxorlovsky commented 4 years ago

Experienced same bug on iOS onDynamicLinkCallback and addOnDynamicLinkReceivedCallback is not getting triggered, on Android works fine. Even though configuration seems fine.

maxorlovsky commented 4 years ago

Checked this https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/master/src/firebase.d.ts#L166-L170 Unfortunately even alternative, which is addOnDynamicLinkReceivedCallback, does not work

EddyVerbruggen commented 4 years ago

It would be extremely useful to have this reproduced in a small demo app.

juanpicuervo commented 4 years ago

Hi, its happening to me too! It never calls onDynamicLinkCallback :(

manojdcoder commented 4 years ago

@juanpicuervo Please share a sample project where issue can be reproduced.

erkanarslan commented 4 years ago

I am not an iOS expert but it seems that this problem occurs when the app or another plugin defines a custom App Delegate.

When my app starts, onDynamicLinkCallback is not called but applicationOpenURLOptions function in the app delegate is called and I can get url from that.

davidmhHuenei commented 4 years ago

Any solution?

befirst commented 4 years ago

@erkanarslan is right: https://github.com/hypery2k/nativescript-urlhandler/issues/88#issuecomment-570327185

For anyone that would be still stuck with this : the plugin is working, even with iOS 13. The problem is related to plugins conflicts. In my case, for instance, it was related to nativescript-plugin-firebase, which overrides the "UIApplicationDelegate" to insert its own callback. Both nativescript-plugin-firebase and this plugins uses the same approach to catch the "open app from url" event. The plugins maintainers should align themselves and find a way to listen for AppDelegate events without conflicting with each others. The same problem occurs with the nativescript-facebook plugin.