我正在尝试检查用户是否已授予发布权限。如果他之前没有授予权限,我会通过以下方式将他导航到权限屏幕:requestNewPublishPermissions
-(void)checkPermissions
{
// Get the most recent status
[FBRequestConnection
startWithGraphPath:@"me/permissions"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (!error) {
//This Condition Never Executed
if([[result objectForKey:@"data"] objectForKey:@"publish_actions"])
{
//permissions exist
}
else
{
[self openSessionForPublishPermissions];
}
NSString *permission = [[result objectForKey:@"data"] objectForKey:@"publish_actions"];
NSLog(@"permissions data = %@",data);
}
else
{
NSLog(@"error"); //Control goes to this block
}
}];
}
在上面的代码中 if(!error) 块永远不会执行,它总是返回错误
我哪里错了?我错过了什么吗?