android - Firebase 对列入白名单的链接说“域未列入白名单”
问题描述
我正忙于使用电子邮件魔术链接设置 Firebase 身份验证并使用此处的指南:
https://firebase.google.com/docs/auth/android/email-link-auth
它说我需要将域列入白名单,但除了我创建的动态链接之外,我在控制台中找不到任何地方可以做到这一点。我尝试运行下面的代码,但我得到了
[ UNAUTHORIZED_DOMAIN:域未被项目列入白名单]
val actionCodeSettings = ActionCodeSettings.newBuilder()
// URL you want to redirect back to. The domain (www.example.com) for this
// URL must be whitelisted in the Firebase Console.
.setUrl("https://myapphere.page.link/register") //I created this dynamic link in the firebase console
.setHandleCodeInApp(true)
.setAndroidPackageName(
"com.myapphere",
true,
"1")
.build()
val auth = FirebaseAuth.getInstance()
auth.sendSignInLinkToEmail(email, actionCodeSettings)
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
// Sign in success, update UI with the signed-in user's information
} else {
// If sign in fails, display a message to the user.
}
}
我不应该使用动态链接进行 Firebase 身份验证吗?如果是这样,我在控制台的哪个位置将域列入白名单,因为我找不到它。
解决方案
推荐阅读
- excel - Excel VBA替换字符串中的问号
- python - 为什么一等函数符号在类方法中不起作用?
- python-3.x - 通过对自身执行计算从 1dim numpy 数组创建 numpy 矩阵?
- java - Eclipse 2020.12 现在包括一个 JVM。如何在其中添加公司证书?
- react-native - 如何将 React_Editor 设置为 PhpStorm,以便在单击错误时跳转到代码?
- angular - 通过父集合firebase angular 9获取数据子集合和分组
- c++ - 为 MFC 自动化实现 IDispatch 接口
- ios - 如何使用 SwiftUI 向 Apple Watch 的 NowPlayingView 添加按钮
- javascript - 在可以运行 javascript 的文档中制作 microsoft word 按钮
- azure-devops - 当第一次执行还没有结束时,有没有办法防止计划的管道再次执行?