我使用此代码在Facebook用户墙上上传照片,但结果字典只返回给我photoid和postid,我需要知道我刚刚分享的帖子的权限级别(在本地应用程序中分享过程中,用户可以选择Public、friends、only me…),有办法知道这个权限吗?
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"", @"message", nil];
[params setObject:Picture forKey:@"source"];
[FBRequestConnection startWithGraphPath:@"me/photos"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error)
{
if (error)
{
//showing an alert for failure
}
else
{
//showing an alert for success
NSString *phoId=[NSString stringWithFormat:@"%@",[result valueForKey:@"id"]];
NSString *PostId=[NSString stringWithFormat:@"%@",[result valueForKey:@"post_id"]];
}
}];
您可以使用刚刚上传的照片的post id执行另一个Graph API调用。您要询问的特定字段称为"隐私"。此字段是一个对象。它的属性之一是"值",可以是以下属性之一:
- 每个人
- 所有好友
- 朋友的朋友
- Self
- 自定义
由此,你可以检查人们在你的帖子中指定的隐私,并进行相应的调整。
更多信息请点击此处:https://developers.facebook.com/docs/graph-api/reference/v2.3/post