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
});
}