5

我正在尝试使我的应用程序像 facebook 页面。为此,我请求publish_actions权限调用:

[[FBSession activeSession] requestNewPublishPermissions:@[@"publish_actions"]
                                          defaultAudience:FBSessionDefaultAudienceFriends
                                        completionHandler:nil];

然后为了喜欢我调用的页面:

[FBRequestConnection startWithGraphPath:@"PAGE_ID/likes"
                           parameters:@{@"access_token" : [FBSession activeSession].accessTokenData.accessToken}
                           HTTPMethod:@"POST"
                    completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                      NSLog(@"%@", error);
                    }];

问题是当我查看时[FBSession activeSession].permissions,它只包含@"email我之前请求的内容。

类似调用打印的错误是:

permissions:(
email
)>, com.facebook.sdk:ParsedJSONResponseKey=<CFBasicHash 0x944ee10 [0x214eb48]>{type = mutable dict, count = 2,
entries =>
1 : <CFString 0x27c2cc [0x214eb48]>{contents = "code"} = <CFNumber 0x9446260 [0x214eb48]>{value = +400, type = kCFNumberSInt32Type}
2 : <CFString 0x273e1c [0x214eb48]>{contents = "body"} = <CFBasicHash 0x944e650 [0x214eb48]>{type = mutable dict, count = 1,
entries =>
11 : <CFString 0x944ed50 [0x214eb48]>{contents = "error"} = <CFBasicHash 0x944e3f0 [0x214eb48]>{type = mutable dict, count = 3,
entries =>
2 : <CFString 0x943c0c0 [0x214eb48]>{contents = "type"} = <CFString 0x944e890 [0x214eb48]>{contents = "OAuthException"}
3 : <CFString 0x944e830 [0x214eb48]>{contents = "message"} = <CFString 0x944e7a0 [0x214eb48]>{contents = "(#3) Application does not have the capability to make this API call."}
6 : <CFString 0x944ec70 [0x214eb48]>{contents = "code"} = 3

但是,我可以在用户时间轴上发布内容。

我怎样才能使类似的电话有效?

4

0 回答 0