【发布时间】:2023-03-26 07:22:01
【问题描述】:
GPPSignIn *signIn;
在我的 iOS 应用中,我将范围设置为:
signIn.scopes = @[@"https://www.googleapis.com/auth/plus.login",
@"https://www.googleapis.com/auth/plus.me",
@"https://www.googleapis.com/auth/plus.profile.emails.read",
@"email",
@"profile",
@"https://www.googleapis.com/auth/user.birthday.read"];
还有,
signIn.shouldFetchGoogleUserEmail = YES;
signIn.shouldFetchGooglePlusUser = YES;
并试图从 Google 获取 access_token。我获取并发送到服务器。
现在,我的服务器正在这样做:
client = OAuth2::Client.new('app_id', 'app_secret')
access_token = OAuth2::AccessToken.new(client, access_token)
profile_api_url = 'https://www.googleapis.com/plus/v1/people/me'
response = access_token.get(profile_api_url)
google_profile_res_body = JSON.parse(response.body)
这里,google_profile_res_body 有许多属性,但没有生日和性别。
有人知道吗?请建议。提前致谢。
干杯, 拉胡尔
【问题讨论】:
-
更新:创建的新帐户没有这些属性,但我用一年和 4 年前创建的帐户进行了测试,google apis 返回了这两个字段,很奇怪吧?!!
标签: ios objective-c ruby google-api google-people-api