ios非对话Facebook分享失败,没有错误,没有反馈

我已经在我的iOS应用程序一年的Facebook分享工作正常,并升级(又名完全重写)使用最新的API(4.7.x),现在共享不工作。 我检查了我有publish_actions权限(我之前做这个方法被调用,我有'明确的共享'在打开的graphics设置,行动types,function检查我validation的内容(我没有得到一个错误),并有一个委托,没有任何方法被调用。

-(void)shareWithFacebook:(NSString *)message { if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"]) { NIDINFO(@"Facebook sharing has publish_actions permission"); } else { FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init]; [loginManager logInWithPublishPermissions:@[@"publish_actions"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { NIDERROR(@"Facebook sharing getting publish_actions permission failed: %@", error); } ]; } NSMutableDictionary *properties = [NSMutableDictionary dictionaryWithDictionary: @{ @"og:type": @"article", @"og:title": @"Bloc", @"og:description": message, @"og:url": @"http://getonbloc.com/download" }]; FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties]; // Create the action FBSDKShareOpenGraphAction *action = [FBSDKShareOpenGraphAction actionWithType:@"mynamespace:Share" object:object key:@"article"]; [action setString:@"true" forKey:@"fb:explicitly_shared"]; // Create the content FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init]; content.action = action; content.previewPropertyName = @"article"; // Share the content FBSDKShareAPI *shareAPI = [[FBSDKShareAPI alloc] init]; shareAPI.shareContent = content; shareAPI.delegate = self; NSError *error; if([shareAPI validateWithError:&error] == NO) { NIDERROR(@"Facebook sharing content failed: %@", error); } [shareAPI share]; } #pragma mark - FBSDKSharingDelegate - (void) sharer:(id<FBSDKSharing>)sharer didCompleteWithResults:(NSDictionary *)results { NIDINFO(@"Facebook sharing completed: %@", results); } - (void) sharer:(id<FBSDKSharing>)sharer didFailWithError:(NSError *)error { NIDERROR(@"Facebook sharing failed: %@", error); } - (void) sharerDidCancel:(id<FBSDKSharing>)sharer { NIDINFO(@"Facebook sharing cancelled."); } 

我有login工作,可以照片罚款。 我没有得到任何反馈,从Facebook的API,没有得到任何发布。 我在这里做些特别愚蠢的事吗?

只是一个可能性,但我发现,Facebook集成已经变得不方便,因为我发现每次我通过hasGranted:检查当前令牌被授予许可,几乎总是失败,即使我获得了几分钟前的权限,或从以前的应用程序发射。

看来在你的代码中,如果没有授予权限,你可以尝试login并再次获得权限。 但是,当该块返回时,无论是否授予实际权限,都会抛出错误。 相反,如果成功,你应该继续分享。