Firebase dynamic links handled twice

I have a problem that firebase dynamic link is relaunched when the android app is restarted. The following sequence produces the problem:

  • click the deep link URL
  • the app is opened at the view pointed by the deep link (as expected)
  • close the app (completely)
  • open the app from the icon
  • the app is opened at the view pointed by the deep link (even though it should not)
  • after that it works fine
  • I am using the latest (9.0.2) libraries. The code is pretty much as in the examples (eg 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) .

    链接地址: http://www.djcxy.com/p/92100.html

    上一篇: 获取数据APDU命令不同的标签和响应格式

    下一篇: Firebase动态链接处理了两次