1
votes

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.}

2
What is not working ? What is the error message ? - Sudo
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.} - Jorge A Gomez
Fixed the problem I had. I just deleted the GoogleService-Info.List and downloaded a new one and it fixed the problem. Everything works now. - Jorge A Gomez

2 Answers

0
votes

I had the same error and solved it by activating the Identity Toolkit Api on Google Console https://console.developers.google.com/apis/api/identitytoolkit/overview?project=YOUR_PROJECT

-1
votes

Below solution worked for me.

Goto Firebase app and re-download the GoogleService-Info.plist file.

Ref: Related Article