[英]Google+ does not return user's friend's email address
I am trying to access friendslist of user's google+ account. 我正在尝试访问用户的Google +帐户的朋友列表。
I have used this code for this purpose... 我已经将此代码用于此目的......
-(void)getGooglePlusAccounts:(NSString *)notificationNameStr
{
GTLServicePlus* plusService = [[GTLServicePlus alloc] init];
plusService.retryEnabled = YES;
[plusService setAuthorizer:[[GPPSignIn sharedInstance] authentication]];
GTLQueryPlus *query =
[GTLQueryPlus queryForPeopleListWithUserId:@"me"
collection:kGTLPlusCollectionVisible];
[plusService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLPlusPeopleFeed *peopleFeed,
NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
} else {
// Get an array of people from GTLPlusPeopleFeed
NSArray* peopleList = peopleFeed.items;
NSLog(@"peopleList: %@", peopleList);
}];
}
This will gives me UserID, Image, Name but not email. 这将给我UserID,图像,名称,但不是电子邮件。
How can i find the email for the Friend. 我怎样才能找到朋友的电子邮件。
You can't get the email address for a friend if that person has not set there email address public. 如果该人未将电子邮件地址设置为公开,则无法获取该朋友的电子邮件地址。 So the reason you are not getting an email address returned for your friend is because they have not set the email address public. 因此,您没有收到为您的朋友返回的电子邮件地址的原因是因为他们没有将电子邮件地址设置为公开。
To fix this tell your friend to set his email address public. 要解决此问题,请告诉您的朋友将其电子邮件地址设置为公 :) :)
Following quote from the documentation Google+ api - People 以下引用文档Google+ api - People
emails[] list A list of email addresses that this person has, including their Google account email address, and the public verified email addresses on their Google+ profile. 电子邮件[]列表此人拥有的电子邮件地址列表,包括其Google帐户电子邮件地址以及Google+个人资料中经过公开验证的电子邮件地址。 The plus.profile.emails.read scope is needed to retrieve these email addresses, or the email scope can be used to retrieve just the Google account email address. 检索这些电子邮件地址需要plus.profile.emails.read范围,或者电子邮件范围可用于仅检索Google帐户电子邮件地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.