将分数发布到图表Api - 分数

时间:2012-07-06 00:11:54

标签: ios facebook api leaderboard

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

这是我的代码:

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)必须使用app access_token调用此方法。”}     6:{contents =“code”} = 15 } }

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

发布了应用程序的发布权限。

文档中提到应该使用app访问令牌,但我使用app access token获取此错误

 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;
};

0 个答案:

没有答案