I have a problem that firebase dynamic link is relaunched when the android app is restarted. The following sequence produces the problem:
I am using the latest (9.0.2) libraries. The code is pretty much as in the examples (e.g. here: https://firebase.google.com/docs/dynamic-links/android#add-an-intent-filter-for-deep-links), autoLaunchDeepLink being false.
I noticed that there has been a bug causing this, but it should be fixed in the current release: https://github.com/googlesamples/google-services/issues/141
I tried a workaround by calling AppInvite.AppInviteApi.getInvitation twice, as instructed in github error report. No success.
In onCreate I am checking that savedInstance is null and checking deep link only if it is.
I am checking deep link also in onNewIntent in order to handle it while the app is running, however this is not called when the problem occurs.
In my manifest, the intent-filter with the specific protocol and host are included only in the main activity. The protocol is used also in other filters in other activities, but I tried also using different protocol in those with no effect. Only the main activity uses AppInvite.AppInviteApi.getInvitation to get the intent. The problem occurs even if I remove other intent filters from all activities.
Any ideas what could be wrong or what I should still check?
You need to call getInvitation()
both in your launcher activity, and in the activity which you declared to handle the dynamic link.
But in the activity which handles the dynamic link, you need to pass null instead of passing the activity as second parameter of getInvitation()
,
like this AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, null, autoLaunchDeepLink)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With