Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
741 views
in Technique[技术] by (71.8m points)

ios - Google Firebase Authentication with email and password does not work

I installed the new SDK of Firebase by Google and I am trying to create a new user using the Authentication SDK. However, I did exactly what the documentation says, but it does not work. Any comments or suggestions?

I have the code for Authentication in RegisterUserViewController.h

In AppDelegate.h I also added the [FIRApp configure] in application:didFinishLaunchingWithOptions;

Here is the code for 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

This is the error I get:

Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo=0x7f98fc4609d0 {NSUnderlyingError=0x7f98fc4cf790 "The operation couldn’t be completed. (FIRAuthInternalErrorDomain error 3.)", error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information.}

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...