GPPSignIn *signIn;
获取Google的个人配置文件API不返回出生日期和性别键值
在我的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年前的帐户,谷歌apis返回这两个领域,怪异吧? –