I am trying to use Facebook's Score Api to create a leaderboard for my iOS game but I am stuck at posting score to /USER_ID/scores.
here's my code:
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];
however, I get this error:
Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x6ba2fd0 {error={type = mutable dict, count = 3, entries => 2 : {contents = "type"} = {contents = "OAuthException"} 3 : {contents = "message"} = {contents = "(#15) This method must be called with an app access_token."} 6 : {contents = "code"} = 15 } }
I also tried it with app access token. didn't resolve
publish_actions permission is given to the app.
It's mentioned in the document that app access token should be used but I get this error using app access token
error = {
code = 102;
message = "A user access token is required to request this resource.";
type = OAuthException;
};
using user access token gives me this error:
error = {
code = 15;
message = "(#15) This method must be called with an app access_token.";
type = OAuthException;
};