我安装了 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/