Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ios中使用google集成获取生日信息_Ios_Objective C_Iphone_Google Plus_Google Plus Signin - Fatal编程技术网

如何在ios中使用google集成获取生日信息

如何在ios中使用google集成获取生日信息,ios,objective-c,iphone,google-plus,google-plus-signin,Ios,Objective C,Iphone,Google Plus,Google Plus Signin,我可以访问谷歌用户的电子邮件、显示姓名和个人资料图片,但在访问“关于我和生日”页面时,我得到的信息为零 需要特别许可吗 我在IBAction上使用以下代码 - (IBAction)loginUsingGoogle:(id)sender { [GPPSignInButton class]; GPPSignIn *signIn = [GPPSignIn sharedInstance]; signIn.shouldFetchGooglePlusUser = YES; signIn.sh

我可以访问谷歌用户的电子邮件、显示姓名和个人资料图片,但在访问“关于我和生日”页面时,我得到的信息为零

需要特别许可吗

我在IBAction上使用以下代码

- (IBAction)loginUsingGoogle:(id)sender {
  [GPPSignInButton class];
  GPPSignIn *signIn = [GPPSignIn sharedInstance];
  signIn.shouldFetchGooglePlusUser = YES;
  signIn.shouldFetchGoogleUserEmail = YES;
  signIn.scopes = @[kGTLAuthScopePlusLogin];
  signIn.scopes = @[ @"profile" ];
  signIn.scopes = @[kGTLAuthScopePlusMe];
  signIn.delegate = self;
  NSLog(@"Google Button clicked");
  [[GPPSignIn sharedInstance] authenticate];
}
我使用上面的代码点击谷歌api,但无法提取生日和关于我的信息,我使用下面的方法来extarct用户详细信息,但生日给零值

GTLPlusPerson *per = [GPPSignIn sharedInstance].googlePlusUser;
GTMOAuth2Authentication *authentication = [GPPSignIn    sharedInstance].authentication;
self.nameTexField.text = per.name.givenName;
self.birthDayTextField.text = per.birthday;//
self.emailIdTextField.text = authentication.userEmail;

可能的副本是否适合ios开发。答案是相同的,这取决于相关用户是否已将其设置为公共。这意味着这是用户权限的问题。好的,thanx alot顺便说一句,如果是生日的话,以上代码是罚款的。通过哪种许可,我将获得生日,请建议我。。。