Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter how to get firebase dynamic link if app is already running?

I receive a firebase dynamic link in initState.

This works great if the app is completely off. But if the app was running before clicking the link, initState is not called again, thus the dynamiclink is not processed.

Should I try to process the firebase dynamic link through WidgetsBindingObserver (for a similar effect to onResume in Android)? If not, what would be the proper way?

like image 779
Gabeloooooo Avatar asked Aug 21 '18 17:08

Gabeloooooo


People also ask

How do you get a dynamic link in flutter?

In the Firebase console, open the Dynamic Links section. If you have not already set up a domain for your Dynamic Links, click the Get Started button and follow the prompts. If you already have a Dynamic Links domain, take note of it.

How do I make Firebase dynamic links in flutter?

Set Up URL Prefix in the Firebase ConsoleOpen the Firebase console and select your Firebase project in which you want to add deep linking. Create an Android and IOS app in the Firebase project. Open Dynamic Links from the side drawer's Grow section. For creating a domain for the link, click on the Get Started button.

What is difference between deep link and dynamic link?

Dynamic Links are deep links into an app that work whether or not users have installed the app yet. When users open a Dynamic Link into an app that is not installed, the app's Play Store page opens, where users can install the app. After users install and open the app, the app displays the deep-linked content.

Do Firebase dynamic links expire?

The created short Dynamic Link will not expire. Repeated calls with the same long Dynamic Link or Dynamic Link information will produce the same short Dynamic Link. The Dynamic Link domain in the request must be owned by requester's Firebase project.


1 Answers

I had the same problem and I solved using WidgetsBindingObserver to listen when the app is foreground, but I found an issue on iOS.

I wrote a post about it, you can check it:

https://medium.com/@diegoveloper/flutter-firebase-dynamic-link-6f1b79278ce0

like image 147
diegoveloper Avatar answered Sep 28 '22 20:09

diegoveloper