1

我正在尝试使用 Facebook 的 Score Api 为我的 iOS 游戏创建排行榜,但我坚持将分数发布到 /USER_ID/scores。

这是我的代码:

NSMutableDictionary *params =  [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                @"2000", @"score",
                                self.facebook.accessToken, @"access_token",
                                nil];

[self.facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/scores", self.userId]
                          andParams:params 
                      andHttpMethod:@"POST" 
                        andDelegate:delegate];

但是,我收到此错误:

Domain=facebookErrDomain Code=10000 “操作无法完成。(facebookErrDomain 错误 10000。)” UserInfo=0x6ba2fd0 {error={type = mutable dict, count = 3, entries => 2 : {contents = "type"} = {contents = "OAuthException"} 3 : {contents = "message"} = {contents = "(#15) 必须使用应用程序访问令牌调用此方法。"} 6 : {contents = "code"} = 15 } }

我还尝试使用应用访问令牌。没有解决

publish_actions 权限已授予应用程序。

文档中提到应该使用应用访问令牌,但使用应用访问令牌出现此错误

 error =     {
    code = 102;
    message = "A user access token is required to request this resource.";
    type = OAuthException;
};

使用用户访问令牌给了我这个错误:

error =     {
    code = 15;
    message = "(#15) This method must be called with an app access_token.";
    type = OAuthException;
};
4

0 回答 0