问题描述
我还希望从电话。我收到很多信息,但没有收到电子邮件。有人可以帮忙吗?
i want to get also the email from https://www.googleapis.com/plus/v1/people/me call. I receive a lots of informations, but not the email. Can anyone help?
HttpGet request = new HttpGet("https://www.googleapis.com/plus/v1/people/me?scope=https://www.googleapis.com/auth/userinfo.email");
request.setHeader("Authorization", "Bearer <access_token>");
HttpResponse response = client.execute(request);
推荐答案
编辑:已作为改进的Google+登录的一部分进行了更新在2013年12月的选项中-您现在可以获取包含Google+个人资料回复的电子邮件地址。
Updated as part of the improved Google+ Sign-In options in December 2013 - you now can get the email address with the Google+ profile response.
只要拥有电子邮件或范围。请参见了解详情。
You will get the email from this endpoint as long as you have the email or https://www.googleapis.com/auth/plus.profile.emails.read scopes. See https://developers.google.com/+/web/people/#retrieve_an_authenticated_users_email_address for details.
var request = gapi.client.plus.people.get( {'userId' : 'me'} );
request.execute(function(person) {
if(person['emails']) {
console.log(person['emails'][0].value);
}
});
这篇关于如何使用google +令牌从https://www.googleapis.com/plus/v1/people/me电话获取电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!