How can I send parameters to deep links in Flutter?

3,672

If you need more advance Deep linking experience with specific domain name, Google firebase has a great product named Dynamic links and it is free.

There is an official package for Flutter to use as firebase_dynamic_links.

Dynamic Links eliminates DeepLink weaknesses. With Dynamic Links, you treat on all platforms such as Android, iOS and web in a similar way. It seamlessly transits users from your mobile website to the equivalent content within your app (if the user has not installed your app on her/his device, the content would be shown after app installation). Furthermore, you can see the log of a Dynamic Link in the Firebase console. Another feature is to find out where the user clicked on the link.more info

Share:
3,672
maxcodemachine
Author by

maxcodemachine

Updated on December 26, 2022

Comments

  • maxcodemachine
    maxcodemachine over 1 year

    I've managed to set up a deep link on Flutter for my app (currently only on android), here is the intent filter in the AndroidManifest.xml file to set up the deep link (using example host name and prefix):

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" android:host="example.com" android:pathPrefix="/prefix"/>
    </intent-filter>
    

    This works, whenever I access http://example.com/prefix on my phone, it suggests to open my app.

    Now, I want to be able to pass in parameters to the deep link, maybe a URL parameter like http://example.com/prefix?code=abc123. So I can read it from my Flutter app like getParam('code') returns abc123 for example.

    Is this possible?

  • maxcodemachine
    maxcodemachine over 3 years
    Thank you for the information. Dynamic Links sound interesting, will look into them.
  • RamithDR
    RamithDR almost 3 years
    Were you able to get data from clicked web link using Firebase dynamic links?
  • A.J Alhorr
    A.J Alhorr almost 3 years
    really stupid question, do you need to be using firebase db to use dynamic links or are they unrelated?
  • Beginner_
    Beginner_ over 2 years
    I think Firebase Dynamic Links is not useful for including parameters in URL.