如何在 url 模式中修复 Firebase 动态链接白名单错误?
我收到了如上图所示的错误。
我的firebase控制台url模式
^https://my-website/share?category=community&id=.*$
^https://my-website/share?category=.*&id=.*$
^https://.*.com/.*$
我的动态链接代码
Firebase.dynamicLinks.shortLinkAsync {
link = Uri.parse("https://my-wabsite/share?category=community&id=${item.communityId}")
domainUriPrefix = "https://nodeline.page.link"
// Open links with this app on Android
androidParameters("my-package") {
minimumVersion = 220
fallbackUrl = Uri.parse("https://my-website/share?category=community&id=${item.communityId}")
socialMetaTagParameters {
title = " "
description = "${item.content}"
imageUrl = if (item.images.isNullOrEmpty()) {
Uri.parse("https:/.amazonaws.com/dsfsdf.jpeg")
} else {
Uri.parse(item.images[0])
}
}
}
iosParameters("my-my-package") {
appStoreId = "1521778128"
minimumVersion = "1.4.8"
setFallbackUrl(Uri.parse("https://my-website/share?category=community&id=${item.communityId}"))
socialMetaTagParameters {
title = " !"
description = "${item.content}"
imageUrl = if (item.images.isNullOrEmpty()) {
Uri.parse("https:// .amazonaws.com/dsfsdf.jpeg")
} else {
Uri.parse(item.images[0])
}
}
}
buildShortDynamicLink()
}.addOnSuccessListener { result ->
val shortLink = result.shortLink
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"
intent.putExtra(Intent.EXTRA_TEXT, shortLink.toString())
Timber.d("Test Checked asdf \n $shortLink")
(context as Activity).startActivity(Intent.createChooser(intent, "Share Link"))
}.addOnFailureListener {
Log.d("log_tag", "==> ${it.localizedMessage}", it)
}
在ios中,可以使用我创建的链接进入应用程序,但是在aos中,当我单击我创建的链接时,会出现这样的白名单错误。
看错误内容,看来是我设置的url模式不正确。你能告诉我问题是什么吗?
错误
400: We could not match param 'https://my-website/share?category=community&id=615129' with whitelisted URL patterns in this Google project.
I am getting an error like the picture above.
my firebase console url pattern
^https://my-website/share?category=community&id=.*$
^https://my-website/share?category=.*&id=.*$
^https://.*.com/.*$
my dynamic link code
Firebase.dynamicLinks.shortLinkAsync {
link = Uri.parse("https://my-wabsite/share?category=community&id=${item.communityId}")
domainUriPrefix = "https://nodeline.page.link"
// Open links with this app on Android
androidParameters("my-package") {
minimumVersion = 220
fallbackUrl = Uri.parse("https://my-website/share?category=community&id=${item.communityId}")
socialMetaTagParameters {
title = " "
description = "${item.content}"
imageUrl = if (item.images.isNullOrEmpty()) {
Uri.parse("https:/.amazonaws.com/dsfsdf.jpeg")
} else {
Uri.parse(item.images[0])
}
}
}
iosParameters("my-my-package") {
appStoreId = "1521778128"
minimumVersion = "1.4.8"
setFallbackUrl(Uri.parse("https://my-website/share?category=community&id=${item.communityId}"))
socialMetaTagParameters {
title = " !"
description = "${item.content}"
imageUrl = if (item.images.isNullOrEmpty()) {
Uri.parse("https:// .amazonaws.com/dsfsdf.jpeg")
} else {
Uri.parse(item.images[0])
}
}
}
buildShortDynamicLink()
}.addOnSuccessListener { result ->
val shortLink = result.shortLink
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"
intent.putExtra(Intent.EXTRA_TEXT, shortLink.toString())
Timber.d("Test Checked asdf \n $shortLink")
(context as Activity).startActivity(Intent.createChooser(intent, "Share Link"))
}.addOnFailureListener {
Log.d("log_tag", "==> ${it.localizedMessage}", it)
}
In ios, it is possible to enter the app with the link I created, but in aos, when I click the link I created, a white list error appears like that.
Looking at the error content, it seems that I have set the url pattern incorrectly. Can you tell me what the problem is?
error
400: We could not match param 'https://my-website/share?category=community&id=615129' with whitelisted URL patterns in this Google project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就我而言,我删除了一些斜杠并且它起作用了。这是我当前使用的模型:
为了匹配子域,我使用这个...
请尝试一下,让我知道它是否适合您。
For my part, I removed some slashes and it worked. Here is the model I am currently using :
To match subdomains I use this...
Please give it a try and let me know if it works for you.