加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift – Firebase“登录方法已禁用”,尽管已启用它

发布时间:2020-12-14 04:43:03 所属栏目:百科 来源:网络整理
导读:我正在为我的应用配置我的登录页面,并尝试添加一个用户可以连接到firebase的部分…我试图使用firebase auth注册新用户,但是在运行此代码时出现此错误 if (newRegistrationEmail.text != "" newRegistrationUsername.text != "" newRegistrationPassword.text
我正在为我的应用配置我的登录页面,并尝试添加一个用户可以连接到firebase的部分…我试图使用firebase auth注册新用户,但是在运行此代码时出现此错误

if (newRegistrationEmail.text != "" && newRegistrationUsername.text != "" && newRegistrationPassword.text != "" && newRegistrationRepeatedPassword.text != "")
 {
    FIRAuth.auth()?.createUser(withEmail: newRegistrationEmail.text!,password: newRegistrationPassword.text!,completion: 
    {
       user,error in

       if error != nil {
            print(error)
       }

错误:

Optional(Error Domain=FIRAuthErrorDomain Code=17006 “The given sign-in
provider is disabled for this Firebase project. Enable it in the
Firebase console,under the sign-in method tab of the Auth section.”
UserInfo={NSLocalizedDescription=The given sign-in provider is
disabled for this Firebase project. Enable it in the Firebase console,
under the sign-in method tab of the Auth section.,
error_name=ERROR_OPERATION_NOT_ALLOWED})

我已经检查了我的Firebase控制台,并且启用了电子邮件选项,所以我不确定为什么它不允许我在我的代码中使用电子邮件.关于如何解决它的任何想法?非常感谢!!

解决方法

刚刚遇到同样的问题.我试图添加到现有的Firebase项目,因此我假设我的项目只是因为它已经启用而跳过所有设置步骤.这对我有用:

>删除项目文件夹中的GoogleService-Info.plist文件.
>在Firebase上,导航到项目的“设置”页面.
>重新下载GoogleService-Info.plist
>将其拖到项目文件夹中.

希望这可以帮助!这是一个非常令人沮丧的错误!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读