0
我試圖使用新的Facebook 4.0 sdks,但我很困惑如何獲取名稱,一旦我成功獲得權限。由於某種原因,nslog返回空值?Facebook登錄返回空名稱結果
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logInWithReadPermissions:@[@"public_profile"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
// Process error
} else if (result.isCancelled) {
// Handle cancellations
} else {
//success
_nam = [FBSDKProfile currentProfile].name;
NSLog(@"name %@", _nam);
}}];
設置斷點和檢查什麼[FBSDKProfile currentProfile]使用LLDB –
它返回NULL以及 –
http://stackoverflow.com/questions/29292371/facebook-sdk-v4-0-就是在那個時候for-ios-fbsdkprofile-currentprofile-not-being-set看起來像是你的問題 –