How to generate a dynamic link for a specific post in android firebase
Asked Answered
V

1

6

am developing an e-commerce app with android and firebase. I understand how to create dynamic link with firebase console. However I want to be able to create dynamic links for each product when a user click on the share button. I mean when a user clicks on the share button they should be able to share a link that contains some details of that specific product so that when someone clicks on the link they can be taken to the product details activity if they have the app installed. I have tried to look at the documentation but am not able to find what I want.l exactly. Can someone help me?

Virelay answered 16/8, 2017 at 0:2 Comment(0)
H
14

Firebase Dynamic Links is the framework to deliver your deep link to iOS App, Android App or your website. Question you asking is about deep link itself. That's why this is not covered in Firebase documentation. As documentation assumes that developers aware how to create deep links.

Let me guess how you can accomplish sharing specific products.

In order to display products in your App you probably have some way of identifying the products. For example, Amazon have product id. In this deep link https://www.amazon.com/gp/product/B00FRDUZXM , B00FRDUZXM is the product id.

Assuming you have product id's as well. In this case when user want to share the product, you creating deep link like: https://your_company_name.com/product?id=XYZ , where XYZ is product id. Then you wrapping the deep link in the Firebase Dynamic Link. Then user will share the dynamic link via Facebook, email etc.

On receiving side, you receive Firebase Dynamic Link according to Firebase docs, unpack deep link, extract product id from deep link and display the product.

Makes sense?

Homopterous answered 16/8, 2017 at 3:19 Comment(5)
Yes A lot of sense. This is the best answer I have received from all my searchesVirelay
@Oleksiy Ivanov If I the product id differs user by user e.g. promo code or referral code for app invites then how can we achieve it as we can wrap only one deep link to dynamic link.Bleeding
@Bleeding You can create new Dynamic Link for each "sending" user (for each user who are referring new user). You can use Dynamic Links iOS or Android API to create links inside your App. So you do not need to create single link in Firebase Console for this cases. Keep in mind that this discussion mostly applicable to Firebase Dynamic Links. Firebase Invites have a bit different and less flexible feature set.Homopterous
how i can add more information (data) when i'm using buildDynamicLink(); method? I can't add append on the method setDomainUriPrefix(domain)Webbing
@OleksiyIvanov so the conclusion is we have to create dynamic link for each product on firebase console?Proprietor

© 2022 - 2024 — McMap. All rights reserved.