Firebase simple login in iOS

2020-06-29 02:15发布

问题:

I am using FirebaseSimpleLogin for authenticating my app via facebook. I have updated .plist file with facebookapp id and display name. I have also registered bundle id of my app. As suggested in docs, i have also implemented openUrl in AppDelegate and following method in my login with Facebook button. But console is showing third party provider error occurred. Anyone have any clue??

    - ( IBAction ) onBtnFacebook : ( id ) sender {
      [self.authClient loginToFacebookAppWithId:@"767056019984823" permissions:@[@"email"] audience:ACFacebookAudienceOnlyMe withCompletionBlock:^(NSError *error, FAUser *user) {
          if (error != nil) {
              NSLog(@"%@",error);
              UIAlertView *message = [[UIAlertView alloc] initWithTitle:@""
                                                          message:@"There was an error in opening your account. Please try again."
                                                          delegate:nil
                                                          cancelButtonTitle:@"OK"
                                                          otherButtonTitles:nil];

              [message show];

           } else {
               UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Welcome"
                                                           message:self.email
                                                           delegate:nil
                                                           cancelButtonTitle:@""
                                                           otherButtonTitles:nil];

               [message show];
               [ self dismissViewControllerAnimated : YES completion : ^{

             } ] ;

         }
       }];
     }

In Appdelegate.m

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
       BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
       NSLog(@"hello");
       // add any app-specific handling code here
       return wasHandled;
     }