0

I created a dynamic link in Firebase, and I'm adding a query parameter ("id") to the shortened URL afterwards, in order to retrieve it in the app activity and open a specific screen

FirebaseDynamicLinks.getInstance()
            .getDynamicLink(getIntent())
            .addOnSuccessListener(this, object: OnSuccessListener<PendingDynamicLinkData> {
                override  fun onSuccess(pendingDynamicLinkData : PendingDynamicLinkData?) {


                    val id = intent.data.getQueryParameter("id").toInt()

The thing is, intent.data returns the dynamic link without the query parameters added. Is there a way to retrieve the short link in its entirety?

Petermonteer
  • 296
  • 4
  • 17

1 Answers1

1

You can retrieve the URL from the opening intent directly: Uri uri = getIntent().getData();, but the intended way of passing data in is add the ID parameter to the link you are making dynamic, before it is shortened: https://firebase.google.com/docs/dynamic-links/android/create

Ian Barber
  • 19,765
  • 3
  • 58
  • 58