zrhl
zrhl

Reputation: 117

Flutter - Create sharable profile link

I am trying to create a Social media kind of networking Flutter app in which user can share his profile link. That link must redirect directly to user's profile if app is installed else redirect to link to download app. I am using Firebase as backend. Any resources or packages to work with?

Upvotes: 1

Views: 1197

Answers (2)

mrgnhnt96
mrgnhnt96

Reputation: 3945

You can use the package Share to enable the user to share their profile themselves. Its really easy to use.
If you would like to share a profile you will need to provide the navigational route to get to the profile screen, then provide the user's ID/data to get/view the desired data.

As far as getting a deep link to get the user to download the app if it is not installed, you can use firebase's dynamic link feature. You can customize what the link preview looks like and says. They have really good docs that you can follow.

Upvotes: 2

Luan Naufal
Luan Naufal

Reputation: 1424

You could use a Firebase dynamic link.

A dynamic link is basically a link pointing to possibly 3 resources:

  1. Web URL
  2. Android (Google Play) App ID
  3. iOS (App Store) App ID

So once you configure it on Firebase (it's simple to configure), when the user access the link, Firebase will employ a decision tree to decide where to send the user.

In case the access is done on a mobile device, but if the app is not downloaded, it'll send the user to the store, and after returning from the store, will send the user to the correct path you've configured, following the link.

And on the app, you can implement the SDK to handle this link and when receiving this route request, redirect the user to the right profile they want to access.

I could go through the whole process, but I suggest you check the whole Firebase documentation: https://firebase.google.com/docs/dynamic-links

In case you have a question on that where I can explain further, just let me know.

Upvotes: 1

Related Questions