linkUserInBackground返回成功为NO

时间:2015-05-21 17:14:25

标签: ios facebook parse-platform

我尝试发帖时有一个非常奇怪的行为。 (ipad 2,ios8.3,解析1.7.4)

(从我的设备,一切正常)。

bGranted_publish_actions =总是假的 bGranted_user_photos =始终为假

当我调用linkUserInBackground时,我可以看到facebook app打开(很长),然后直接关闭(不是事件看到权限屏幕的时间),我的ios应用程序重新打开。 误差=零 成功=否

有什么想法吗?

-(void)postShareToFacebookWithDescription:(NSString *)description andBlock:(void (^)(NSError *))completionBlock{
    NSLog(@"ℹ️--[%s:%d]",__PRETTY_FUNCTION__,__LINE__);
    bool bGranted_publish_actions=[[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions"];
    bool bGranted_user_photos=[[FBSDKAccessToken currentAccessToken] hasGranted:@"user_photos"];
    if (!bGranted_user_photos || !bGranted_publish_actions ){
        //withPublishPermissions:@[@"publish_actions", @"user_photos"
        [PFFacebookUtils linkUserInBackground:[PFUser currentUser] withPublishPermissions:@[@"publish_actions"] block:^(BOOL succeeded, NSError *error) {
            if (succeeded) {
                NSLog(@"User now has read and publish permissions!");
                [self postDataWithPhoto:nil];
            } else {
                if (completionBlock) {
                    completionBlock(error);

                }
            }
        }];
    } else {
        NSLog(@"Got Facebook publish permissions and about to share");
        [self postDataWithPhoto:nil];
    }
}

1 个答案:

答案 0 :(得分:0)

我得到了答案: FBSDKLoginManager logInWithPublishPermissions always returns isCancelled=YES

  

“当您的Facebook应用程序没有”publish_actions“时,可能会发生这种情况   权限,或者您没有使用测试用户。“