我有一个 Facebook 页面,我是管理员。我已登录 Facebook 并获得了FBSession.actionSession
. IEisOpen = YES
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"access_token", @"fields",
nil];
FBRequest *req = [FBRequest requestWithGraphPath:myPageID parameters:params HTTPMethod:@"POST"];
[req startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Result: %@", result);
});
}];
但是我nil
进去了result
。我知道我必须添加manage_pages
权限,但是在哪里添加呢?
注意:我使用的是 Facebook SDK 3.5.3
调试日志记录的附加信息:
2013-06-27 12:18:34.722 TestFBPostPage[13224:19a03] FBSDKLog: Request <#1113>:
URL: https://graph.facebook.com/MY_PAGE_ID?sdk=ios&fields=access_token&migration_bundle=fbsdk%3A20130409&format=json&access_token=ACCESS_TOKEN_REMOVED
Method: POST
UserAgent: FBiOSSDK.3.5.3
MIME: multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f
Attachments:
sdk: ios
fields: access_token
migration_bundle: fbsdk:20130409
format: json
access_token: ACCESS_TOKEN_REMOVED
2013-06-27 12:18:34.952 TestFBPostPage[13224:19a03] FBSDKLog: Error: HTTP status code: 403
2013-06-27 12:18:34.954 TestFBPostPage[13224:19a03] FBSDKLog: Response <#1113> <Error>:
The operation couldn’t be completed. (com.facebook.sdk error 5.)