我的创建动态链接代码
Firebase.dynamicLinks.shortLinkAsync {
link = Uri.parse("https:// ?recommenderCode=" + URLEncoder.encode(MyApplication.prefs.recommenderCode))
domainUriPrefix = "https:// "
// Open links with this app on Android
androidParameters(" ") {
minimumVersion = 220
fallbackUrl = Uri.parse("intent://#Intent;scheme=choice;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package= ;S.market_referrer=recommenderCode=" +
URLEncoder.encode(MyApplication.prefs.recommenderCode) + ";end;")
socialMetaTagParameters {
title = " "
description = " "
imageUrl = Uri.parse("https:// .ap-northeast-2.amazonaws.com/ ")
}
}
buildShortDynamicLink()
}.addOnSuccessListener { result ->
val shortLink = result.shortLink
sendMsg = " \n" + shortLink
}.addOnFailureListener {
}
获取动态链接代码
Firebase.dynamicLinks
.getDynamicLink(intent)
.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
}
if (deepLink != null && deepLink.getBooleanQueryParameter("recommenderCode", false)) {
}
如果您在安装应用程序时单击该链接,您可以正常接收推荐代码。
但是,如果您通过该链接安装并运行该应用程序,则无法收到推荐代码。
我想知道哪里出了问题。如果方法不对,请至少告诉我一个关键字。谢谢
我参考了这篇文章,但是和这里的评论和文章是一样的情况