我想在我的iOS应用程序中喜欢和评论。但问题是每当我调用我的API时,响应就会以“错误:消息:(#200)”的形式出现。应用程序没有权限进行此调用,有时它会提供输入参数是必需的。我给出的权限是'basic_info','email','user_likes'和'read_stream'。我在我的喜欢和评论API中传递对象ID和访问令牌。
与API代码类似:
NSString *theWholeUrl = [NSString stringWithFormat:@"https://graph.facebook.com/%@/likes?access_token=%@",self.friendId,[FBSession activeSession].accessTokenData.accessToken];
NSLog(@"Value of theWholeUrl%@",theWholeUrl);
NSURL *facebookUrl = [NSURL URLWithString:theWholeUrl];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:facebookUrl];
[req setHTTPMethod:@"POST"];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&err];
NSString *content = [NSString stringWithUTF8String:[responseData bytes]];
答案 0 :(得分:0)
您需要publish_actions权限才能通过API以编程方式对内容进行评论和评论。