Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.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 Swift从谷歌获取出生日期和手机号码_Ios_Swift_Swift3_Google Identity - Fatal编程技术网

Ios Swift从谷歌获取出生日期和手机号码

Ios Swift从谷歌获取出生日期和手机号码,ios,swift,swift3,google-identity,Ios,Swift,Swift3,Google Identity,我无法找到从谷歌获取手机号码和出生日期的解决方案 请帮帮我 @IBAction func onGoogleClick(sender: AnyObject) { var googleSignIn: GIDSignIn! googleSignIn = GIDSignIn.sharedInstance(); googleSignIn.delegate = self googleSignIn.uiDelegate = self googleSignIn.s

我无法找到从谷歌获取手机号码和出生日期的解决方案

请帮帮我

 @IBAction func onGoogleClick(sender: AnyObject) {

    var googleSignIn: GIDSignIn!


    googleSignIn = GIDSignIn.sharedInstance();
    googleSignIn.delegate = self
    googleSignIn.uiDelegate = self
    googleSignIn.shouldFetchBasicProfile = true;
    googleSignIn.clientID = "75749930852-g1qaafmntbrgendjea6bmk5g8e4684ue.apps.googleusercontent.com"
    googleSignIn.scopes.append("https://www.googleapis.com/auth/plus.login")

    googleSignIn.scopes.append("https://www.googleapis.com/auth/user.birthday.read")
    googleSignIn.scopes.append("https://www.googleapis.com/auth/user.phonenumbers.read")
    googleSignIn.scopes.append("https://www.googleapis.com/auth/userinfo.profile")
    googleSignIn.scopes.append("https://www.googleapis.com/auth/userinfo.email")
    googleSignIn.signIn();
}




public func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {

    if user != nil{

        if let name = user.profile.name as? String {
            self.txtFullName.text = name
        }

        if let email = user.profile.email as? String{
            self.txtEmail.text = email
        }


        if let gID = user.userID as? String {
            self.registerID = gID
            self.registerType = UserRegisterType.GOOGLE
        }
    }



}
相关:另请参见:相关:另请参见: