簡體   English   中英

如何在Google中獲取用戶的出生日期和性別以及iOS中最新的SDK版本2.1.0

[英]How to get user Date of birth and gender in google plus latest SDK version 2.1.0 in ios

我正在使用Google Plus登錄,我用2.1.0更新了Google Plus SDK版本,請按照https://developers.google.com/identity/sign-in/ios/quick-migration-guide鏈接上的說明進行操作,但我沒有在用戶信息中得到用戶的DOB及其性別。

我正在使用此委托方法來獲取用戶詳細信息,

- (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user
     withError:(NSError *)error {
    // Perform any operations on signed in user here.
    NSString *userId = user.userID;                  // For client-side use only!
    NSString *idToken = user.authentication.idToken; // Safe to send to the server
    NSString *name = user.profile.name;
    NSString *email = user.profile.email;
}

如果有人知道如何獲取用戶的性別和DOB,請幫助我。

提前致謝。

您的問題可能與代碼無關。 生日和性別信息並非始終可見。 我已經使用Try It對其進行了測試。 我在所有不同的示波器上進行了測試

https://www.googleapis.com/auth/plus.login知道您的基本個人資料信息和您圈子中的人員列表。

https://www.googleapis.com/auth/plus.me知道您在Google上的身份https://www.googleapis.com/auth/userinfo.email查看您的電子郵件地址https://www.googleapis.com/ auth / userinfo.profile查看有關您帳戶的基本信息

在所有范圍內恢復生日似乎並不重要。 但是重要的是,必須在帳戶中將“用戶生日”設置為public 如果將其設置為其他任何值,您的圈子中只有您自己。 其未列出。 即使您嘗試查看自己的信息,這似乎也是正確的。 (發送給我)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM