Thomas
Thomas

Reputation: 2560

Firebase Dynamic Link on Flutter

I currently struggle with Firebase Dynamic Links on Flutter. I followed the documentation and ended up with my own version:

final DynamicLinkParameters parameters = DynamicLinkParameters(
    uriPrefix: 'https://myapp.page.link',
    link: Uri.parse('https://myapp.page.link/'+Provider.of<FirebaseUser>(context).uid),
    androidParameters: AndroidParameters(
        packageName: 'com.me.myapp',
        minimumVersion: 0,
    ),
    iosParameters: IosParameters(
        bundleId: 'com.me.myapp',
        minimumVersion: '0',
        appStoreId: '123456789',
    ),
    socialMetaTagParameters:  SocialMetaTagParameters(
        title: 'Yay',
        description: 'Click me'
    ),

);

final Uri dynamicUrl = await parameters.buildUrl();

Now I got few questions:

  1. What is the uriPrefix? Does it need to be a legit one?
  2. Can I just use the required information in the link, or does it also need to contain the namespace?
  3. The minimumVersion is defined by Flutter. In my case it is 1.0.0+9, but the field for Android is expecting a number, while iOS is expecting a String. What should I place in there?
  4. What is the disadvantage of using ShortDynamicLink?
  5. Do I also need the parameters for Google Analytics and iTunes? What are they for?
  6. Where is the correct place to read the data from the link? The initState() method of my LandingPage (which is the home-property of my ThemeData) is not called when the link opens the app.

Upvotes: 2

Views: 2316

Answers (1)

Priyankchoudhary
Priyankchoudhary

Reputation: 826

  1. uriPrefix - This is your apps unique link which you can find on firebase console. Just browse to Firebase console > Dynamic link > and you get a link with something like https://xcvnm.app.goo.gl/ .That is the uriPrefix.

  2. You should only use the required information in your app. All the fields are there for different behaviours and use case.

  3. MinimumVersion The versionCode of the minimum version of your app that can open the link. If the installed app is an older version, the user is taken to the Play Store to upgrade the app. ( So if you are making a new app then you don't need to use this property.)

  4. There is not much difference in short dynamic link

  5. The correct place depends on your apps structure and your preference, so can't suggest that.

For more detail visit - https://firebase.google.com/docs/dynamic-links/android/create

Upvotes: 4

Related Questions