यदि आप विशेष रूप से अपने एप्लिकेशन को अपना ईमेल पता देखने के लिए अधिकृत करते हैं तो आप उपयोगकर्ता का ईमेल पता पुनर्प्राप्त कर सकते हैं।
करने के लिए अपने कार्यक्षेत्र सेट करें:
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/auth/userinfo.email
जावास्क्रिप्ट कॉल इस तरह दिखेगा:
gapi.client.load('oauth2', 'v2', function() {
gapi.client.oauth2.userinfo.get().execute(function(resp) {
// Shows user email
console.log(resp.email);
})
});
gapi.client.load('plus', 'v1', function() {
gapi.client.plus.people.get({'userId' : 'me'}).execute(function(resp) {
// Shows other profile information
console.log(resp);
})
});
अधिक जानकारी https://developers.google.com/+।
ध्यान दें कि आपको plus.me या userinfo.profile के लिए स्कोप की आवश्यकता नहीं है।
स्रोत
2013-03-13 12:20:15
धन्यवाद कार्टलैंड – srp
धन्यवाद कार्टलैंड ......... :) –