How should friend requests and invitations be handled in firebase, flutter?

1,427

In order to achieve your goal, you can use Firebase dynamic links. A link to a tutorial you can find here: Intro

There are also some video tutorials explaining how to create and receive a dynamic link. The principle is simple. You create a link which you want to send to your friend inviting them to download your app. At the end of the link you attach the UUID of the sender. When the receiver opens it, you can reward both the sender's UUID and the receiver's UUID with some reward for sharing your app.

An advantage of using the dynamic link is that even if the receiver hasn't downloaded your app yet, the link will first redirect the user to Google Play or AppStore depending on the phone and when he gets your app, the information of the link will be automatically received. In other word the receiver doesn't need to click twice on the link. The information in your case will be the sender's UUID. Then you can reward both users.

You can find a good tutorial for iOS also here:

Integrate Firebase Dynamic Links to iOS Apps

Share:
1,427
TheEggHealer
Author by

TheEggHealer

Updated on December 12, 2022

Comments

  • TheEggHealer
    TheEggHealer over 1 year

    I'm building an app using flutter and firebase. In this app I want the users to be able to invite each other to teams or add each other as friends. To do this, the user who wants to invite has to enter some information about the other user(s), preferably email.

    One way of doing this that I thought of was to somehow get the UUID of the other user and add an invitation to a list in their user document in the database. I'm not sure about the security risks this brings though. I can't find a way of getting a UUID from an email address and I don't want the users to have to type in the UUID themselves.

    Another way could be to send an invitation link via email. The link could be a dynamic link created by firebase. Though I would prefer to do everything in-app and not having to send emails.

    What would be the best way of implementing this feature using firebase and flutter?