简体   繁体   English

Google+不会返回用户的朋友的电子邮件地址

[英]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.

相关问题 Google+在ios中分享特定朋友的信息流 - Google+ sharing post on specific friend's stream in ios 解析-PFTwitterUtils:获取用户的电子邮件地址 - Parse - PFTwitterUtils: get user's email address 如何从Google(而非Google+)获取用户的个人资料照片? - How to fetch user's profile photo from Google (and not from Google+)? 检索用户的电子邮件Google Login iOS - Retrieving user's email Google Login iOS 使用Google+ iOS API如何登录用户的个人资料详情? - Using Google+ iOS API how to get logged in user's profile details? 如何使用Firebase在iOS上验证用户的电子邮件地址? - How to verify a user's email address on iOS with Firebase? 在解析中使用用户的朋友列表更新Tableview - Update Tableview with user's friend list in parse 用户的朋友列表tableview为空,解析查询未返回任何数据 - User's friend list tableview is empty and parse query did not return any data 如何使用户能够通过朋友的用户名添加朋友并在表视图中快速显示用户的朋友列表 - How to enable user to add friends via friend's username and display user's friend list in tableview with swift React Native当前是否支持访问用户的地址簿 - Does React Native currently support accessing a user's Address Book
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM