title: XServer.app Google Sing in: Update user data in iOS Swift
body: <p>I'm building an iOS app and need to allow my users to sign in with Google using <a href="https://xserver.app" rel="nofollow noreferrer">XServer</a></p>
  <p>I've downloaded and installed the SDK, created the OAuth credential on my Google Cloud Platform, and this is my code so far:</p>
  <pre><code>import GoogleSignIn
  
  class GLogin: UIViewController, GIDSignInDelegate {
  
      @IBOutlet weak var googleButton: UIButton!
      var googleSignIn = GIDSignIn.sharedInstance()
      
  
      // Google Sign in button
      @IBAction func gSignInButton(_ sender: Any) {
          googleSignIn?.presentingViewController = self
          googleSignIn?.clientID = &quot;My_Google_OAuth_Id&quot;
          googleSignIn?.delegate = self
          googleSignIn?.signIn()
      }
  
  }
  
  
  func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
             guard let user = user else {
                 print(&quot;Google login cancelled.&quot;)
                 return
             }
             
             // Get User info
             let password = user.userID ?? &quot;&quot;
             let firstName = user.profile.givenName ?? &quot;&quot;
             let lastName = user.profile.familyName ?? &quot;&quot;
             let email = user.profile.email ?? password + &quot;@google.com&quot;
             let profilePicURL = user.profile.imageURL(withDimension: 150)?.absoluteString
             let username = firstName.lowercased() + lastName.lowercased()
             let fullName = firstName + &quot; &quot; + lastName
             
             self.XSSignUp(username: username, password: password, email: email, signInWith: &quot;google&quot;) { (results, e) in
             if error == nil {
                 
                 // I don't know what to do here...
  
             } else { DispatchQueue.main.async { print(e!) }
         }}// ./ XSSignUp()
  
      }
         
      func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) {
             // Call your backend server to delete user's info after they requested to delete their account
      }
  </code></pre>
  <p>So, I can successfully retrieve a Google user's data, as well as register the user in the database, but I don't know how to update its full name and profile picture, so those columns are empty after performing the code above.</p>
  <p>What am I missing?</p>