'Dynamic link receive in different format in android and not able to extract payload

Step 1: Describe your environment

Android Studio version: Arctic Fox 2020.3.1, Firebase Component: firebase-dynamic-links-ktx:21.0.1

Step 2: Describe the problem

Below are two different links received in the android app.

Relevant Code:

Firebase.dynamicLinks
                .getDynamicLink(myNewIntent)
                .addOnSuccessListener(this) { pendingDynamicLinkData ->
                    // Get deep link from result (may be null if no link is found)
                    var deepLink: Uri? = null
                    if (pendingDynamicLinkData != null) {
                        deepLink = pendingDynamicLinkData.link
                    }
                    val userid= deepLink?.getQueryParameter("userid")
                    
                    handleIntentLink(deepLink, userid)
                }
                .addOnFailureListener(this) { e ->
                    Log.e("addOnFailureListener", "$e.message")
                }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source