EddyVerbruggen / nativescript-plugin-firebase

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

onDynamicLinkCallback not called when Android app is in the background #1824

Open kajic opened 3 years ago

kajic commented 3 years ago

I've noticed that the onDynamicLinkCallback is only called when our app is not running in the background. I.e. the callback is only called when the app isn't already running. Once the Android app has been started and is running in the background, the callback doesn't get called anymore. To be clear, tapping a dynamic link switches to our app, but the callback itself is absent.

We only have this problem on Android.

We're using dynamic links for onboarding new users, so this isn't a catastrophic problem (since they typically don't have the app running when they tap a dynamic link), but I wanted to ask if this is the intended behavior anyway and hopefully understand what the problem is.

Our packages: "@nativescript/core": "~8.0.7", "@nativescript/firebase": "^11.1.3", "@nativescript/android": "8.0.0",

We're running node v14.15.1 and npm v7.5.6.

It's also worth mentioning that since our app is a game, we run with android:launchMode="singleTask". Running with launchMode standard alleviates the problem, because each dynamic link tap launches a new instance of the app inline inside the app where the dynamic link was tapped. But we would really prefer not to allow multiple instances of our app to be running, and think that the singleTask launchMode is the most appropriate in our case.

Grateful for any advice on how to troubleshoot this! Thanks!

jfrcv5 commented 2 years ago

Hello @kajic, I'm having a similar issue, the onDynamicLinkCallback isn't called when the app is running in the background. The callback is only called when the app isn't already running. Did you find a solution to this problem?. Any help will be greatly appreciated.
Best Regards.

foxgreek commented 2 years ago

Hey @jfrcv5 and @kajic - did you find any solution for this?