ios - 使用电子邮件和密码的 Google Firebase 身份验证不起作用

标签 ios objective-c firebase firebase-authentication

我安装了 Google 的新 Firebase SDK,并尝试使用 Authentication SDK 创建新用户。但是,我完全按照文档中的说明进行操作,但它不起作用。有什么意见或建议吗?

我在 RegisterUserViewController.h 中有身份验证代码

在 AppDelegate.h 中,我还在 application:didFinishLaunchingWithOptions 中添加了 [FIRApp configure];

这是 RegisterUserViewController.h 的代码:

#import "RegisterUserViewController.h"
@import FirebaseAuth;
@import Firebase;
@import FirebaseMessaging;
@interface RegisterUserViewController ()

@end

@implementation RegisterUserViewController

- (void)viewDidLoad {
   [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
   [super didReceiveMemoryWarning];
   // Dispose of any resources that can be recreated.
}

- (IBAction)createUserButton:(id)sender {

[[FIRAuth auth] createUserWithEmail:self.emailTextField.text password:self.passwordTextField.text completion:^(FIRUser * _Nullable user, NSError * _Nullable error)
{
    if(error == nil)
    {
      NSLog(@"%@", user.email);
      NSLog(@"New user Created!");
      [self performSegueWithIdentifier:@"BackToLogin" sender:nil];
    }
    else
    {
      NSLog(@"%@",error);
    }
}];
}

@end

这是我得到的错误:

Error Domain=FIRAuthErrorDomain Code=17999 “发生内部错误,打印并检查错误详细信息以获取更多信息。” UserInfo=0x7f98fc4609d0 {NSUnderlyingError=0x7f98fc4cf790“操作无法完成。(FIRAuthInternalErrorDomain 错误 3.)”,error_name=ERROR_INTERNAL_ERROR,NSLocalizedDescription=发生内部错误,打印并检查错误详细信息以获取更多信息。

最佳答案

我遇到了同样的错误,并通过在 Google 控制台上激活 Identity Toolkit Api 解决了这个问题 https://console.developers.google.com/apis/api/identitytoolkit/overview?project=YOUR_PROJECT

关于ios - 使用电子邮件和密码的 Google Firebase 身份验证不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37634804/

相关文章:

ios - 断开连接时所有应用程序崩溃

ios - 如何使用搜索 Controller 更新我的表 Controller 过滤?

ios - 如何使用 cloudkit 查询获取 Assets 名称

ios - TouchesBegan 在下一个 View Controller 中被识别

ios - AVPlayer HLS 直播电平表(显示 FFT 数据)

javascript - Firebase 函数 : update all documents inside a collection

ios - 比例 View 高度和 super View 自动布局

objective-c - 在 iPad 应用程序中隐藏 UITabBar

javascript - Firebase存储,将图像检索到vue应用

swift 4 : Firebase Timestamp