我正在尝试从我的 iOS 游戏中发布一个对象。我仔细检查了权限,然后复制并粘贴了 Facebook 给我的代码,但它不起作用:S
任何想法?
NSMutableDictionary<FBGraphObject> *object =
[FBGraphObject openGraphObjectForPostWithType:@"game:level"
title:@"Sample Level 2"
image:@"https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png"
url:@"http://samples.ogp.me/367110273423562"
description:@""];;
object[@"create_object"] = @"1";
object[@"fbsdk:create_object"] = @"1";
[FBRequestConnection startForPostWithGraphPath:@"me/objects/game:level"
graphObject:object
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
// handle the result
NSLog(@"Result: %@",error);
}];
错误回调:
Result: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1690d1d0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 2500;
message = "Cannot specify type in both the path and query parameter.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0xae21820, state: FBSessionStateOpen, loginHandler: 0xc1279f0, appID: 358605784274011, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xae227a0>, expirationDate: 2013-12-07 05:14:08 +0000, refreshDate: 2013-10-08 14:48:02 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
"basic_info",
installed,
"user_location",
email,
"user_friends",
"user_birthday",
"publish_actions"
)>}
我尝试搜索解决方案,但在 iOS 上找不到
谢谢