如何在 url 模式中修复 Firebase 动态链接白名单错误?

发布于 2025-01-17 11:22:38 字数 4009 浏览 0 评论 0原文

输入图片此处描述

我收到了如上图所示的错误。

我的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. 

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

絕版丫頭 2025-01-24 11:22:38

就我而言,我删除了一些斜杠并且它起作用了。这是我当前使用的模型:

^https://example.com.*$

为了匹配子域,我使用这个...

^https://.*example.com.*$

请尝试一下,让我知道它是否适合您。

For my part, I removed some slashes and it worked. Here is the model I am currently using :

^https://example.com.*$

To match subdomains I use this...

^https://.*example.com.*$

Please give it a try and let me know if it works for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文