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 "The operation could not be completed. (facebookErrDomain error 10000.)" UserInfo=0x6ba2fd0 {error={type = mutable dict, count = 3, entries => 2 : {contents = "type"} = {contents = "OAuthException"} 3 : {contents = "message"} = {contents = "(#15) このメソッドは、アプリの access_token で呼び出す必要があります。"} 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;
};