有时,动态链接效果很好。但是有时候,它只是打开了Google Play商店,这就是问题所在。
特别是,当应用未运行时,它会更频繁地显示Google Play商店。
任何建议将不胜感激。
编辑:
我尝试了以下顺序,但失败了:
但是按此顺序,它是成功的。
这是我的意图过滤器。
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="truebalance.io/products"
android:scheme="https" />
</intent-filter>
这是我的Google Play商店网址。
https://play.google.com/store/apps/details?id=com.stanleyko.fdl
答案 0 :(得分:2)
关键是添加应用程序ID。使用此选项,该链接将直接启动应用程序,并且如果已安装应用程序,则不会打开Google Play商店。
Firebase.dynamicLinks.shortLinkAsync {
domainUriPrefix = MY_PREFIX
androidParameters(BuildConfig.APPLICATION_ID) {
minimumVersion = MY_MIN_VERSION
}
link = myDeepLink // My deep link
}.addOnSuccessListener { result ->
val shortLink = result.shortLink
// Use shortLink
}.addOnFailureListener {
// Do something
}
我从下面找到了答案。详细信息:
https://stackoverflow.com/a/51224484/850347