Search code examples
flutterflutter-webdynamic-linkingfirebase-dynamic-links

Flutter: Dynamic link in notification


I am getting dynamic link in notification and I want to open dynamic link on notification click.

I am using url_launcher for this purpose but it takes me first to default browser and process the link there and take me back to app.

Is it possible we can process the link inside the app only. I have tried Webview but webview is not opening with dynamic link.


Solution

  • As far as I understand you want to read data from uri link which is generated by firebase in that situation, below code should work :

    PendingDynamicLinkData? data =
        await FirebaseDynamicLinks.instance.getDynamicLink("Your url here");
    String? strLinkData = data.link.toString();
    

    Once you get strLinkData you can move further and do your action.