IOS Google+ 登录获取人员列表 return 空姓名 属性

IOS Google+ Login fetch people list return null name property

我正在使用以下函数从用户的圈子中检索人员列表。但是,当我的应用程序试图访问每个人时。似乎只有 displayName 有效,person 下的名称 属性 为空。并且电子邮件 属性 也为空。任何人都知道我错过了什么?

提前感谢您的帮助。

  for (GTLPlusPerson *person in _googlePeopleList) {
      NSString *name = person.displayName;
      NSString *firstName = person.name.givenName;
      NSString *lastName = person.name.familyName;
}

 (void)listPeople:(NSString *)collection {
    _googlePeopleList = nil;
    _googlePeopleImgList = nil;

    // 1. Create a |GTLQuery| object to list people that are visible to this
    // sample app.
    GTLQueryPlus *query = [GTLQueryPlus queryForPeopleListWithUserId:@"me"
                                                          collection:collection];

    // 2. Execute the query.
    [[[GPPSignIn sharedInstance] plusService] executeQuery:query
                           completionHandler:^(GTLServiceTicket *ticket,
                                     GTLPlusPeopleFeed *peopleFeed,
                                      NSError *err){
                                        _googlePeopleList = peopleFeed.items;
                                         }];
}

people.list is a truncated person resource. Try it to see it live. If you want more details you'll have to query people.get 个人的回复。

{
   "kind": "plus#person",
   "etag": "\"RqKWnRU4WW46-6W3rWhLR9iFZQM/x6i0N_yYIL4lSYVVygDE4boxShc\"",
   "objectType": "page",
   "id": "111395306401981598462",
   "displayName": "Google Developers",
   "url": "https://plus.google.com/+GoogleDevelopers",
   "image": {
    "url": "https://lh6.googleusercontent.com/-Fgp8KFpgQqE/AAAAAAAAAAI/AAAAAAAATSI/rnA__R9xehk/photo.jpg?sz=50"
   }
}