简体   繁体   中英

Custom Facebook Login button doesn't respond in iOS

Hey so I have a custom facebook login button on my app with the following code (executed after the button is clicked):

-(void)clickedLoginButton{
    NSLog(@"clicked button");
    FBSDKLoginManager * manager = [[FBSDKLoginManager alloc]init];
    [manager logInWithReadPermissions:@[@"public_profile"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
        NSLog(@"finished");
        if (error) {
            NSLog(@"error occurred");
        } else if (result.isCancelled) {
            NSLog(@"Cancelled");
        } else {
            NSLog(@"job done");
        }
    }];
}

It prints out "clicked button" but for some reason does not print anything that happens inside the handler. However, I am confused because when you click the facebook login button it takes you to facebook where it says "You have already authorized " and then takes me back to the app screen. Not sure why it's not calling anything inside the handler.

我意识到我有多个应用程序实例下载到手机上,因此当我删除所有实例并再次尝试时,它运行良好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM