我有一个后端服务,它将让我登录我的应用程序,并从以前的登录中返回一个扩展的 facebook 令牌,可能来自另一台设备(因此在此设备上没有缓存凭据)。我想使用这个令牌来启动 Facebook 会话。我正在使用类似的东西:
FBSession* session = [[FBSession alloc] initWithPermissions:@[@"publish_actions"]];
FBAccessTokenData* tokenData =
[FBAccessTokenData createTokenFromString:token
permissions:@[@"publish_actions"]
expirationDate:nil
loginType:FBSessionLoginTypeTestUser
refreshDate:nil];
[session openFromAccessTokenData:tokenData completionHandler:nil];
为了清楚起见,我在这里传递'nil',在我的代码中,我正在处理完成并登录返回的会话对象,该对象似乎处于打开状态,没有错误。当我尝试使用会话时,出现如下错误:
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xb8b1680 {com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 200;
message = "(#200) The user hasn't authorized the application to perform this action";
type = OAuthException;
};
};
code = 403;
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0xa2b62a0, state: FBSessionStateOpen, loginHandler: 0xa29e9b0, appID: 131721883664256, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xa273f60>, expirationDate: 4001-01-01 00:00:00 +0000, refreshDate: 2013-07-26 16:21:10 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
email,
"publish_actions"
)>}
有什么建议么...?