我想知道是否有人知道在swift3中更新的代碼以下。我從Parse Server github得到了這個(下面的鏈接)。解析Facebook登錄集成處理失效會話
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
// handle successful response
} else if ([[error userInfo][@"error"][@"type"] isEqualToString: @"OAuthException"]) { // Since the request failed, we can check if it was due to an invalid session
NSLog(@"The facebook session was invalidated");
[PFFacebookUtils unlinkUserInBackground:[PFUser currentUser]];
} else {
NSLog(@"Some other error: %@", error);
}
}];
具體來說,我想明白了什麼,以檢查
"[[error userInfo][@"error"][@"type"] isEqualToString: @"OAuthException"]".
我明白,如果swift3我想設置爲
"if error = (error as? NSError!).userInfo[something]"
但我不知道我需要哪個參數在userinfo []中傳遞。例如。 FBSDKGraphRequestErrorCategoryKey,FBSDKGraphRequestErrorGraphError等
https://github.com/ParsePlatform/ParseUI-iOS/wiki/Integrate-Login-with-Facebook
對不起,我想知道你在哪裏問! – Cliffordwh
@Cliffordwh沒問題! – DevKyle