Firebase kicks out current user

前端 未结 14 1785
一个人的身影
一个人的身影 2020-11-22 01:42

So I have this issue where every time I add a new user account, it kicks out the current user that is already signed in. I read the firebase api and it said that \"I

14条回答
  •  情歌与酒
    2020-11-22 02:08

    I got André's very clever workaround working in Objective-C using the Firebase iOS SDK:

    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
    FIROptions *secondaryAppOptions = [[FIROptions alloc] initWithContentsOfFile:plistPath];
    [FIRApp configureWithName:@"Secondary" options:secondaryAppOptions];
    FIRApp *secondaryApp = [FIRApp appNamed:@"Secondary"];
    FIRAuth *secondaryAppAuth = [FIRAuth authWithApp:secondaryApp];
    
    [secondaryAppAuth createUserWithEmail:user.email
                                 password:user.password
                               completion:^(FIRUser * _Nullable user, NSError * _Nullable error) {
                                    [secondaryAppAuth signOut:nil];
                              }];
    

提交回复
热议问题