AWSGoogleSignIn is a helpful library for integrating Google Sign-In functionality into your iOS and macOS applications. This library provides a convenient way to allow users to sign in with their Google accounts, access user profile information, and utilize Google’s various APIs and services seamlessly.


Before getting started, make sure you have:

  • An Xcode project targeting iOS 9.0 or later, or a macOS 10.11 or later
  • A Google API Console project with enabled Google Sign-In API


Using CocoaPods

To integrate AWSGoogleSignIn into your project using CocoaPods, specify it in your Podfile:

pod 'AWSGoogleSignIn'


If you prefer not to use CocoaPods, you can integrate the library manually by following these steps:

  1. Download the latest version of AWSGoogleSignIn from the official GitHub repository.
  2. Add the AWSGoogleSignIn framework to your Xcode project.
  3. In your project settings, add the following frameworks to the “Linked Frameworks and Libraries” section:
    • GoogleSignIn.framework
    • AWSCore.framework
    • AWSAuthCore.framework
    • AWSSignInProvider.framework
  4. Ensure that the framework paths are correctly set in your project’s build settings.


Integrating Google Sign-In

To use Google Sign-In in your app, follow these steps:

  1. Enable Google Sign-In in your Google API Console project.
  2. Configure your app’s info.plist file with the required URL schemes and corresponding client IDs.
  3. In your app delegate class, import AWSGoogleSignIn:

import AWSGoogleSignIn

Implement the GIDSignInDelegate protocol in your app delegate:

class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
// ...

In your didFinishLaunchingWithOptions method, add the following code to initialize AWSGoogleSignIn and set the delegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// ...
AWSGoogleSignIn.sharedInstance().configure(delegate: self)
// ...
return true


AWSGoogleSignIn provides convenient methods to handle user authentication in your app. You can use the following methods to sign in, sign out, and retrieve user information:

  • GIDSignIn.sharedInstance()?.signIn(): Initiates the Google Sign-In process.
  • AWSGoogleSignIn.sharedInstance().signOut(): Signs the user out.
  • AWSGoogleSignIn.sharedInstance().getUserProfile(): Retrieves the user’s profile information.

Handling Sign-In Callback

To handle the sign-in callback, implement the following methods from the GIDSignInDelegate protocol:

func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
// Called when the user successfully signs in.
if error == nil {
// Perform necessary actions after successful sign-in.
} else {
// Handle sign-in error.

func sign(_ signIn: GIDSignIn!, didDisconnectWith user: GIDGoogleUser!, withError error: Error!) {
// Called when the user disconnects from your app.

Additional Configuration

AWSGoogleSignIn provides additional configuration options to customize the behavior of the library. You can modify the following properties of AWSGoogleSignInConfig:

  • clientID: The OAuth 2.0 client ID for your Google Sign-In integration.
  • serverClientID: The server/client ID for your Google Sign-In integration (optional).
  • scopes: An array of scopes to request during authentication.

Example Usage

Here’s an example of how to integrate AWSGoogleSignIn into your app:

  1. Initialize the library with your Google Sign-In credentials:

AWSGoogleSignIn.sharedInstance().configure(clientID: "YOUR_CLIENT_ID", scopes: ["profile", "email"], serverClientID: "YOUR_SERVER_CLIENT_ID")

  1. Implement the necessary delegate methods.
  2. Integrate the authentication methods into your app’s UI.


By utilizing AWSGoogleSignIn, you can seamlessly integrate Google Sign-In functionality into your iOS and macOS applications. This library simplifies the authentication process, allowing users to sign in with their Google accounts and access various Google services within your app.