验证成功后,我已经通过以下方法获取了用户信息.
// 1. Create a |GTLQuery| object to get people profile who are authenticated GTLQueryPlus *query = [GTLQueryPlus queryForPeopleGetWithUserId:@"me"]; // 2. Execute the query. [[[GPPSignIn sharedInstance] plusService] executeQuery:query completionHandler:^(GTLServiceTicket *ticket,GTLPlusPerson *gpUser,NSError *error) { // here I've retrieved all info about users NSLog(@"GP user first name : %@",gpUser.name.givenname); NSLog(@"GP user last name : %@",gpUser.name.familyName); //But don't kNow how extract phone number. }];
This google doc显示如何通过Google Api检索信息.但是,如果用户将其显示为公开,则无法提取电话号码?是否可能与谷歌加api?
解决方法
即使用户将信息标记为“公开”,Google也不会使用其G API访问此数据.
参见this other thread从2012年起明确指出,电话号码不能通过G API.