GoogleSignIn Framework Reference

Classes

The following classes are available globally.

  • This class represents the OAuth 2.0 entities needed for sign-in.

    Declaration

    Swift

    class GIDAuthentication : NSObject, NSSecureCoding

    Objective-C

    @interface GIDAuthentication : NSObject <NSSecureCoding>
  • This class represents a user account.

    Declaration

    Swift

    class GIDGoogleUser : NSObject, NSSecureCoding

    Objective-C

    @interface GIDGoogleUser : NSObject <NSSecureCoding>
  • This class represents the basic profile information of a GIDGoogleUser.

    Declaration

    Swift

    class GIDProfileData : NSObject, NSCopying, NSSecureCoding

    Objective-C

    @interface GIDProfileData : NSObject <NSCopying, NSSecureCoding>
  • This class signs the user in with Google. It also provides single sign-on via a capable Google app if one is installed.

    For reference, please see Google Sign-In for iOS at https://developers.google.com/identity/sign-in/ios

    Here is sample code to use GIDSignIn:

    1. Get a reference to the GIDSignIn shared instance: GIDSignIn *signIn = [GIDSignIn sharedInstance];
    2. Call [signIn setDelegate:self];
    3. Set up delegate method signIn:didSignInForUser:withError:.
    4. Call handleURL on the shared instance from application:openUrl:... in your app delegate.
    5. Call signIn on the shared instance;

    Declaration

    Swift

    class GIDSignIn : NSObject

    Objective-C

    @interface GIDSignIn : NSObject
  • This class provides the Sign in with Google button.

    You can instantiate this class programmatically or from a NIB file. You should set up the GIDSignIn shared instance with your client ID and any additional scopes, implement the delegate methods for GIDSignIn, and add this button to your view hierarchy.

    Declaration

    Swift

    class GIDSignInButton : UIControl

    Objective-C

    @interface GIDSignInButton : UIControl