2
我有一個Facebook頁面,我是管理員。我已登錄Facebook &獲得FBSession.actionSession
。即isOpen = YES
在Facebook iOS SDK 3.5.x中獲取Facebook頁面訪問令牌
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);
});
}];
但我在result
了nil
。我知道我必須添加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.)
我也有這個問題。 – Banshi