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/iosHere is sample code to use
GIDSignIn
:- Get a reference to the
GIDSignIn
shared instance:GIDSignIn *signIn = [GIDSignIn sharedInstance];
- Call
[signIn setDelegate:self]
; - Set up delegate method
signIn:didSignInForUser:withError:
. - Call
handleURL
on the shared instance fromapplication:openUrl:...
in your app delegate. - Call
signIn
on the shared instance;
Declaration
Swift
class GIDSignIn : NSObject
Objective-C
@interface GIDSignIn : NSObject
- Get a reference to the
-
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 forGIDSignIn
, and add this button to your view hierarchy.Declaration
Swift
class GIDSignInButton : UIControl
Objective-C
@interface GIDSignInButton : UIControl