简体   繁体   中英

utmParameters is always empty for a Firebase Dynamic Link

I've created several dynamic links with UTM parameters using the Firebase console. Yet, the utmParameters field is always empty.

By the time the intent is received the UTM parameters have been stripped off. We want to use these parameters for additional tracking and decision-making in the app.

Any ideas what could be going wrong here? Thanks

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    Firebase.dynamicLinks
        .getDynamicLink(intent)
        .addOnSuccessListener(this) { pendingDynamicLinkData ->
            var deepLink: Uri? = null
            if (pendingDynamicLinkData != null) {
                deepLink = pendingDynamicLinkData.link

                Timber.tag("XXX").d("UTM :${pendingDynamicLinkData.utmParameters}")
            }
        }
        .addOnFailureListener(this) { e -> Timber.e(e, "Failed to process Dynamic Link") }
}

I find the same problem and what solve it for me is start using the method that expects an Uri instead of Intent.

intent.data?.let {
    Firebase.dynamicLinks.getDynamicLink(it)
        .addOnSuccessListener(this) {
            ......
}

The URI worked for me. The Java equivalent code:

FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent().getData())

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