简体   繁体   中英

Custom Dynamic Links in Firebase that goes to user profile

Im pretty new to Firebase, so please bear with me on this one. This problem has been stuck in my head for the past days.

I have seen some videos on Dynamic Links, but i havent seen some clear answers to what im hoping to achieve. I want to create a Dynamic Link, that allow users to share their account with their friends (through a link).

So my question is how can i manually construct a dynamic link (with User A´s uid), so when User B clicks on that link (and has the app) it will go straight into the profile of User A?

Should i create a link when a user signs up and store it under their profile in the database?

Looking forward to hearing how you guys would go about solving this problem im having.

You essentially want to create link where the link parameter (what's called the "Deep link URL" in the Firebase console) looks something like https://www.example.com/userProfile?uid=314159 . (The full deep link will look different than this.)

When your app opens up this dynamic link, it will convert the incoming URL to a Dynamic Link object, and that object will have a url property that equals this link parameter. Your app will have to do the work to analyze this url and say, "Oh, this appears to be a request to view a user's profile, so I'm going to redirect to that part of my app". It won't happen automatically.

Whether you create it when the user first signs up, or when they decide to share their profile is kinda up to you. I'm generally not a fan of pre-generating deep links ahead of time, because you might realize later you want to change an aspect of these links, and that's easier to do if you don't have thousands of pre-generated DLs. Keep in mind that either way, there is a network call required to convert these longer URls into a prettier short URL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM