Stay organized with collections Save and categorize content based on your preferences.

Add Google Sign-In to Your iOS or macOS App

A basic integration only takes a few steps. First, set up a project in the Google API console.

Then, add a GIDSignInButton to your layout.

Finally, connect the button (using an IBAction or similar) to a method that calls signInWithConfiguration:presentingViewController:callback:.


    with: signInConfig,
    presenting: self
) { user, error in
    guard error == nil else { return }
    guard let user = user else { return }

    // Your user is signed in!


                   callback:^(GIDGoogleUser * _Nullable user,
                              NSError * _Nullable error) {
      if (error) { return; }
      if (user == nil) { return; }

    // Your user is signed in!

To this basic integration, you can add features such as back-end authentication and OAuth 2.0 authorization for accessing Google APIs.

Learn how to get started with our developer's guide. Or, visit our GitHub repository to see some sample code, submit a bug report or feature request, or contribute a pull request.