[英]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): 嘿,所以我的应用程序上有一个自定义Facebook登录按钮,其中包含以下代码(单击该按钮后执行):
-(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.
但是,我很困惑,因为当您单击Facebook登录按钮时,它将带您到显示“您已授权”的Facebook,然后将我带回到应用程序屏幕。 Not sure why it's not calling anything inside the handler.
不知道为什么它没有在处理程序内调用任何东西。
我意识到我有多个应用程序实例下载到手机上,因此当我删除所有实例并再次尝试时,它运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.