使用Graph API发布图像时出现权限问题。但我正在publish_actions。我需要什么许可才能获得更多。我根据登录权限使用了以下代码
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc]init];
[loginManager logInWithPublishPermissions:[NSArray arrayWithObject:@"publish_actions"] fromViewController:rootVC handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if(!error) {
if ([result.declinedPermissions containsObject:@"publish_actions"]) {
// TODO: do not request permissions again immediately.
} else {
NSLog(@“got permisssion");
}
}
}];
然后我要使用Graph API发布
FBSDKGraphRequestConnection *connection =[[FBSDKGraphRequestConnection alloc]init];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
image, @"picture",
status_message,@"message",
nil];
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST"];
[connection addRequest:request completionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc]init];
[loginManager logOut];
if(result)
{
NSLog(@"Posting the image is success, the result is%@",result);
}
else if(error)
{
NSLog(@"Error occured while posting image %@",error);
}
}];
[connection start];
我的帖子出错了
Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={com.facebook.sdk:FBSDKGraphRequestErrorCategoryKey=0, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=403, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=(#200) Requires extended permission: publish_actions, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCode=200, com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 200;
"fbtrace_id" = GuPKBCyqoc4;
message = "(#200) Requires extended permission: publish_actions";
type = OAuthException;
};
};
code = 403;
}}
帖子图片的那些扩展权限是什么?
谢谢!