I am writing a App for a Open Source Conference.
Originally each attendees will receive different link via email or SMS like
https://example.com/?token=fccfc8bfa07643a1ca8015cbe74f5f17
then use this link to open app, we can know the user is which attendee by the token.
Firebase release a new feature Dynamic Links in I/O 2016, it provide better experience for users.
I had try that, but I can't find any way to pass the custom parameters (the token) in dynamic links, how to use the same link with different parameters to my users?
Thanks.
Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your iOS or Android app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time. Dynamic Links are no-cost forever , for any scale.
As far as I know, dynamic links work for as long as your firebase project active. I used some dynamic links more than one year after they were created. I didn't see anything about any time limits in the documentation.
To help you debug your Dynamic Links, you can preview your Dynamic Links' behavior on different platforms and configurations with an automatically-generated flowchart. Generate the flowchart by adding the d=1 parameter to any short or long Dynamic Link. For example, example. page.
I don't think you can use the short url:
https://<my app>.app.goo.gl/Gk3m
unless you create one for each user, but you can use the long url:
https://<my app>.app.goo.gl/?link=https://example.com/?token=fccfc8bfa07643a1ca8015cbe74f5f17 ...(add other parameters as needed)
and set new token for each user.
I assume you generate the tokens automatically. In that case you can use this to shorten the links.
1) From https://console.firebase.google.com/
(no need for custom parameter here.)
2) Create link somewhere, f.e. on your confluence page (here we add our parameter):
https://PROJECTNAME.page.link/?link=https://PROJECTNAME.page.link/LINKNAME?PARAMETER=1&ofl=https://www.PROJECTNAME.com/
PARAMETER is your custom parameter.
ofl is a link where to go if click the link from another platform (PC, Mac).
3) Getting link data from android project Kotlin code:
Firebase.dynamicLinks
.getDynamicLink(intent)
.addOnSuccessListener { pendingDynamicLinkData ->
val parameter: String =
pendingDynamicLinkData?.link?.getQueryParameter("PARAMETER").orEmpty()
}
If you want to use dynamic links with custom arguments with REST, here is an example of a payload:
{
"dynamicLinkInfo": {
"dynamicLinkDomain": "example.app.goo.gl",
"link": "http://someurl.com?my_first_param=test&my_second_param=test2"
},
"suffix": {
"option":"UNGUESSABLE"
}
}
Make sure your remove 'https://' from your dynamicLinkDomain
Julien
Case A. If you want the short link to expand to a link with multiple parameters:
In the part where you setup a dynamic link, any parameter you append to the deep link URL will go on all platforms (web, iOS, android)
Case B. If you want to use dynamic parameters, you should use the api to create a short link
see documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With