Flutterfire: [firebase_dynamic_link] listener not being called on iOS

Created on 3 Oct 2019  路  17Comments  路  Source: FirebaseExtended/flutterfire

I have tried both on iOS 12 and 13 and FirebaseDynamicLinks.instance.onLink listener is not being called at all... App is opened just fine, but like I said, the listener is not being called...

bug

Most helpful comment

So, finally I found the solution... In Dynamic Link firebase docs you will find this:

Captura de Pantalla 2019-10-03 a la(s) 17 49 18

I must say this is not mentioned in the flutter plugin README doc
https://pub.dev/packages/firebase_dynamic_links#-readme-tab-

So adding that key I solved the issue...

Here it is the doc https://firebase.google.com/docs/dynamic-links/custom-domains?authuser=0

All 17 comments

I debugged my Dynamic Link and it looks fine...
Captura de Pantalla 2019-10-03 a la(s) 17 00 09
Captura de Pantalla 2019-10-03 a la(s) 17 00 27

So, finally I found the solution... In Dynamic Link firebase docs you will find this:

Captura de Pantalla 2019-10-03 a la(s) 17 49 18

I must say this is not mentioned in the flutter plugin README doc
https://pub.dev/packages/firebase_dynamic_links#-readme-tab-

So adding that key I solved the issue...

Here it is the doc https://firebase.google.com/docs/dynamic-links/custom-domains?authuser=0

Hi @quetool,

Just wondering what you exactly managed to solve by adding the FirebaseDynamicLinksCustomDomains key. Did you manage to read the dynamic link, and its path, in flutter?

@HofmannZ yes, before I realize I needed to add that key on the info.plist dynamic links were not being readed at all, not from FirebaseDynamicLinks.instance.getInitialLink() nor even from FirebaseDynamicLinks.instance.onLink

@quetool managed to get that working, though the onLink seems to subscribe multiple times and has no dispose method :s Did you get that to work?

@HofmannZ you need to add the onLink listener once in an initState() method or in a singleton class. I think you are instantiating the FirebaseDynamicLinks more than one time.

@quetool Yeah came to that conclusion as well. The only problem I had was that I was calling onLink from inside each page, without the puttingFirebaseDynamicLinks inside a singleton. Puting it inside a singleton should solve the issue.

Also using initState outside MaterialApp is not ideal because you don't have to context of the Navigator

I have a main container class (a stateful widget) that contains the entire app. On its initState method I instantiate the FirebaseDynamicLinks.instance with its onLink method. Then I use streams to communicate the link parsing result wherever I want to. But that's my approach.

@quetool how did you solve getting the Navigator context? Using navigatorKey I'm guessing?

Maybe is better if you provide some code and an explanation on what you need to do... I do not have problem getting current context becauase like I said I manage everything inside a stateful widget... Anyway, this is just for issues, maybe you can open a question on SO

PR #255 managed to fix my issue, thanks!

I do not have that sort of problems described on that PR but ok

So, finally I found the solution... In Dynamic Link firebase docs you will find this:

Captura de Pantalla 2019-10-03 a la(s) 17 49 18

I must say this is not mentioned in the flutter plugin README doc
https://pub.dev/packages/firebase_dynamic_links#-readme-tab-

So adding that key I solved the issue...

Here it is the doc https://firebase.google.com/docs/dynamic-links/custom-domains?authuser=0

This MUST be included on pub.dev I feel a large amount of developers will want to use custom domains and will have to dig through hundreds of issues to find this.

Please guys update the doc. So hard to find this!

Thanks @emmett-deen for your comment. This problem still exists and your comment helped to solve the problem. I can't believe the plugin's readme is still not updated.

@surpriso1997 uhm... I think you are talking about MY comment :P

@quetool oops sorry, didn't realise that was quoted comment from @emmett-deen
Thanks a lot man for mentioning that.

Was this page helpful?
0 / 5 - 0 ratings