我正在使用以下内容针对Facebook分数API发布分数
- (IBAction)postScoreClicked:(id)sender
{
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSMutableDictionary * dict = [[NSMutableDictionary alloc]init];
[dict setObject:@"1" forKey:@"score"];
[[delegate facebook] requestWithMethodName:@"/563645402/scores" andParams:dict andHttpMethod:@"POST" andDelegate:self];
NSLog(@"Posting a new score...");
}
但是,覆盖request didFailWithError
我可以清楚地看到记录以下错误:
Error Domain=facebookErrDomain Code=3 "The operation couldn’t be completed. (facebookErrDomain error 3.)" UserInfo=0x68982d0 {request_args=(
{
key = method;
value = "/563645402/scores";
},
{
key = sdk;
value = ios;
},
{
key = score;
value = 1;
},
{
key = "sdk_version";
value = 2;
},
{
key = format;
value = json;
},
{
key = "access_token";
value = VALUE-REMOVED-FROM-POST;
}
), error_msg=Unknown method, error_code=3}
您可以通过发出HTTP POST请求来发布分数或用户 / USER_ID /得分与app access_token,只要你有 publish_actions权限
在我的登录控制器中,我设置了publish_actions
权限,如下所示:
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_games_activity",
@"friends_games_activity",
@"publish_actions",
nil];
[[myDelegate facebook] authorize:permissions];
不太确定我在这里缺少什么想法?
在Facebook应用控制中心,我的应用已注册为原生/桌面,并归类为游戏