0

We developed a flutter app for Android and iOS, with different flavors: dev, test and prod, so we have 6 apps in total. To on-board the user, we send a firebase dynamic link via Email (with a deep link inside it) to navigate the user to a specific screen when it is tapped.

The expected behavior is that when the user taps on a dynamic link of - say - the dev app, it opens a screen in the dev app. Similar for the other flavors.

Now this works just fine on Android. On iOS it works fine if only one app is installed, but if for example the dev and the test apps are installed, then tapping on the dynamic links always opens the test app. This is also true when dev, test and prod are installed: test is opened.

This is a development issue and not relevant for production as the user will never have the test or dev app installed, but it is annoying us as we have to uninstall and reinstall flavors all the time.

Our dynamic links have the following format (values in '<>' are placeholders):

Dev:  https://<app_id>.page.link/?link=http://dev.<mydomain>.com/reset?token=token1&apn=<mypackage>.dev&isi=<isiNumber1>&ibi=<mypackage>.dev
Test: https://<app_id>.page.link/?link=http://test.<mydomain>.com/reset?token=token2&apn=<mypackage>.test&isi=<isiNumber2>&ibi=<mypackage>.test
Prod: https://<app_id>.page.link/?link=http://<mydomain>.com/reset?token=token3&apn=<mypackage>&isi=<isiNumber3>&ibi=<mypackage>

The behavior is the same for all iOS versions I could get my hands on on real devices, i.e. iOS 11, 12 and 13. We're using Flutter 1.9.1-hotfix6 and firebase_dynamic_links 0.5.0+1

Any ideas what this might be caused by?

SOERGI
  • 193
  • 2
  • 13
  • Have you checked the bottom section of [this page](https://firebase.google.com/docs/dynamic-links/ios/create)? [These instructions](https://firebase.google.com/docs/dynamic-links/ios/receive) might also be helpful. – phi Dec 05 '19 at 16:24
  • @phi To my understanding, most of those points on this page that touch swift code need to be done by the flutter library as it needs to forward the dynamic link to the dart code. I followed the instructions on the [flutter dynamic links library](https://pub.dev/packages/firebase_dynamic_links#-readme-tab-), which just mentions setting up the configuration without any changes in the swift part – SOERGI Dec 06 '19 at 09:17
  • If you go to Target Settings / Info / URL Types, do you see any entries there? If so, are they different for your flavors? – phi Dec 06 '19 at 11:05
  • Yes, every flavor has its own identifier – SOERGI Dec 06 '19 at 15:17
  • @SOERGI Did you get any solution for this? I am also looking for same feature in my app. – Janmenjaya Feb 11 '20 at 13:49
  • @Janmenjaya unfortunately not, it's still open. But we haven't investigated any further as it is "only" a problem for developers not for the customer – SOERGI Feb 12 '20 at 09:20
  • @SOREGI, I found one solution for me like as I have different target, I created multiple domain for dynamic link and that works for me as far as my requirement – Janmenjaya Feb 12 '20 at 17:41
  • Does this answer your question? [Firebase Dynamic-Links is not working for different target in same project in iOS](https://stackoverflow.com/questions/41582867/firebase-dynamic-links-is-not-working-for-different-target-in-same-project-in-io) – Johnson_145 Apr 14 '20 at 13:32
  • @Johnson_145 thanks for your suggestion. Unfortunately, I cannot verify it as I am not in that project anymore. – SOERGI Apr 15 '20 at 06:35

3 Answers3

2

Firebase Dynamic Links do not support using the same URL prefix for multiple iOS apps/targets contained in the same Firebase project.

You can workaround this in multiple ways though:

  1. Using multiple (sub)domains (as already suggested by Janmenjaya)

  2. Use a custom domain

  3. Using multiple Firebase projects (as already suggested by Aleksandr)


On Android it works out of the box, because you are in charge of matching paths with particular apps within the Manifest file. On iOS it doesn't work, because Firebase is in charge of such matches within the hosted apple-app-site-association file.


For further information, I've written an extensive answer here.

Johnson_145
  • 1,994
  • 1
  • 17
  • 26
1

Do not use one project in the firebase console, it is better to split and use different url in <key>com.apple.developer.associated-domains</key>

Aleksandr
  • 11
  • 1
1

In Firebase under dynamic link, we can create multiple url domain. And these url domain we need to add in the associated domain of different target.

Steps

Let’s assume I have two target test and production.

I created two domain link like “test.page.link” and production.page.link

In test target in Xcode under Signing & Capabilities -> Associated Domain, use the “test.page.link”

And for production target set the production.page.link

halfer
  • 19,824
  • 17
  • 99
  • 186
Janmenjaya
  • 4,149
  • 1
  • 23
  • 43