当我尝试加载我所有的 Facebook 朋友时,出现时间请求超时错误。
我有 FBSessionOpen 状态。我的代码:
[FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, id data, NSError *error) {
if(error) {
NSLog(@"Error: %@", error);
[self.delegate didFinishLoadingFriendsWithResult:[ErrorResponse errorResponseWithMessage:@"Failed to load user friends from Facebook"] succes:NO];
return;
}
NSArray* friends = (NSArray*)[data data];
NSLog(@"You have %d friends", [friends count]);
NSLog(@"Friends: %@", friends);
[self.delegate didFinishLoadingFriendsWithResult:friends succes:YES];
}];
错误信息:
Error: Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1d1e3a30 {com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x1d1e16a0 {NSErrorFailingURLStringKey=https://graph.facebook.com/me/friends?sdk=ios&fields=id%2Cname%2Cusername%2Cfirst_name%2Clast_name&migration_bundle=fbsdk%3A20130120&format=json&access_token=CAAHyDtIdIi0BAM6ZCtXb3Yb5jzuPQ7Tvc6mYg1zO1ZBjoEqZBI5sB5eFYQiTp6s0euVhMTQcl1yqXnaLT118BIBaaEtY1hLEpKq1ptG6y4dHR8BknAOTZCpRUvYlJlT6KbL42MXk2VaMZBvGRwIvs1644FSxy5vVRBSTIFsNZAzIyRpQjjhIA1, NSErrorFailingURLKey=https://graph.facebook.com/me/friends?sdk=ios&fields=id%2Cname%2Cusername%2Cfirst_name%2Clast_name&migration_bundle=fbsdk%3A20130120&format=json&access_token=CAAHyDtIdIi0BAM6ZCtXb3Yb5jzuPQ7Tvc6mYg1zO1ZBjoEqZBI5sB5eFYQiTp6s0euVhMTQcl1yqXnaLT118BIBaaEtY1hLEpKq1ptG6y4dHR8BknAOTZCpRUvYlJlT6KbL42MXk2VaMZBvGRwIvs1644FSxy5vVRBSTIFsNZAzIyRpQjjhIA1, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x1d1e3800 "The request timed out."}, com.facebook.sdk:HTTPStatusCode=200, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x1d1b0c90, state: FBSessionStateOpen, loginHandler: 0x1d1b0db0, appID: 547620445299245, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x1d1afdd0>, expirationDate: 2013-09-28 09:49:39 +0000, refreshDate: 2013-07-30 14:08:31 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
"read_friendlists"
)>}
知道我做错了什么吗?