Flutter firebase dynamic link not listening

525

There is an open issue here https://github.com/FirebaseExtended/flutterfire/issues/8261 where a few others are having the same problem including myself.

It seems for now the temporary solution to at least getting things working again is posted by odlund. If you make these changes the listener should work again until we have more of an official fix: https://github.com/FirebaseExtended/flutterfire/commit/8bb4bee7e678241e75ab37a2bcfa0831426b91fa

Share:
525
Joris
Author by

Joris

Updated on January 04, 2023

Comments

  • Joris
    Joris over 1 year

    I am trying to implement Firebase Dynamic links in a flutter app. When I click on the link it opens the app but doesn't call the listen functions.

    I reconfigured step by step according to FlutterFire, so I don't think the issue is in configuration, but maybe in the way I'm using the plugin as there is no documentation on the last version of the plugin.

    Firebase is correctly initialised in my app as I'm using other services.

    I'm doing tests on android simulator

    I'm trying to listen the dynamic link from a stateful widget with the following code

    I'm first navigating to the page containing this widget, then I background the app, I click on the link, the app opens at the same place and nothing happens.

      @override
      void initState() {
        super.initState();
        initLink();
      }
    
      void initLink() {
        FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) {
          print('dynamic link');
          print(dynamicLinkData.toString());
          // Navigator.pushNamed(context, dynamicLinkData.link.path);
        }).onError((error) {
          // Handle errors
        });
      }