I have added 'Sign in with Google+' to a website, using javascript.
Using the following code
gapi.client.load('plus','v1', function(){
var request = gapi.client.plus.people.get({
'userId': 'me'
});
request.execute(function(resp) {
console.log(resp);
});
My HTML is this
<div id="gSignInWrapper"><div id="customBtn" class="customGPlusSignIn">
<span class="icon"></span> <span class="buttonText"><strong>Login</strong> with Google+</span>
</div>
</div>
I have this at the bottom of my page:
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
//po.src = 'https://apis.google.com/js/client:plusone.js';
po.src = 'https://apis.google.com/js/client:plusone.js?onload=render';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
function render() {
gapi.signin.render('customBtn', {
'callback': 'signinCallback',
'clientid': '410303772734-t1k0lsm5f83lvrpbglgdbu71kj8gqsdv.apps.googleusercontent.com',
'cookiepolicy': 'single_host_origin',
'requestvisibleactions': 'http://schema.org/AddAction',
'scope': 'https://www.googleapis.com/auth/plus.profile.emails.read'
});`
This all creates the button and I can login ok.
The login response includes
..."emails":[{"value":"mine@gmail.com","type":"account"}], ...
The data return from Google includes an array called Emails. The array contains only the Primary email address associated with my account. How do i get all the other emails associated with the account? There are definitely other emails, I have added them today myself.
I have checked the following, but none seem to have the answer: