2014-07-01 45 views
-1

我正在使用Parse版本1.2.19,我無法訪問Facebook用戶的姓名。當應用程序重新啓動時,Parse.com無法閱讀Facebook用戶詳細信息

if ([PFFacebookUtils isLinkedWithUser:[PFUser currentUser]]) { 
// Create Facebook Request for user's details 
FBRequest *request = [FBRequest requestForMe]; 
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { 
    if (!error) { 
    NSString *displayName = result[@"name"]; 
    if (displayName) { 
     self.title =[NSString stringWithFormat:NSLocalizedString(@"Welcome %@!", nil), displayName]; 
    } 
    }else{ 
    NSLog(@"%@",[error description]); 
    } 
}]; 
} 

我收到以下錯誤:

Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x29e24040 {com.facebook.sdk:ParsedJSONResponseKey={ 
    body = { 
    error = { 
     code = 2500; 
     message = "An active access token must be used to query information about the current user."; 
     type = OAuthException; 
     }; 
    }; 
    code = 400; 
}, com.facebook.sdk:HTTPStatusCode=400} 

這2個職位要求的問題已經在最新的解析版本:

https://www.parse.com/questions/error-when-trying-to-reauthorise-facebook-user
https://www.parse.com/questions/oauthexception-code-2500-an-active-access-token-must-be-used

回答

0

看來我需要這個:

[PFFacebookUtils initializeFacebook]; 

在調用請求之前。當應用程序剛剛重新加載時,該行代碼未被調用。

相關問題