我已经编写了以下代码在Facebook页面上发布但收到此错误消息:“(#200)未发布的帖子必须作为页面本身发布到页面。”;
NSString *accesstoken = @"EAACEdEose0cBAAe49xNZBS5MqswXkRptXgLDRuZBZBPZCZCVl5rxW6Bt0jthaHXMACNTiUWePg9XkVTpttDNsLyWYBaEkQaUCm5vbSJQh8zGwkegAcQRjRggAJajunmMyg0jVIKZAZBzMjbZCKWUv1Tie1UzF8gJCpIxACIVgqx7SqKdPZBnIUaElk3meB7SYo6AZD";
NSString *pageId = [dic valueForKey:@"id"];
NSDictionary *dicPara=@{@"message": @"Hello",@"access_token":accesstoken,@"scheduled_publish_time": [NSNumber numberWithInt:timestamp],@"published": @"false"};
NSLog(@"%@",dicPara);
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:[NSString stringWithFormat:@"/%@/feed",pageId]
parameters:dicPara
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
if (error)
{
NSLog(@"%@",error);
}
else
{
[arrPostId addObject:[result valueForKey:@"id"]];
}
}];
现在我已经搜索了这个错误,发现你必须设置页面的accessstoken而不是用户的令牌。那么如何才能将用户的访问令牌更改为页面访问权限?