Important: Starting
May 1, 2024, Apple
requires Privacy Manifests and signatures for iOS applications that use commonly-used SDKs, including GoogleSignIn-iOS. Upgrade to GoogleSignIn-iOS v7.1.0+ before May 1, 2024. Follow
our upgrade guide.
GoogleSignIn Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GIDToken
@interface GIDToken : NSObject <NSSecureCoding>
This class represents an OAuth2 or OpenID Connect token.
-
Declaration
Swift
var tokenString: String { get }
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull tokenString;
-
The estimated expiration date of the token.
Declaration
Swift
var expirationDate: Date? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSDate *expirationDate;
-
Check if current token is equal to another one.
Declaration
Swift
func isEqual(to otherToken: GIDToken) -> Bool
Objective-C
- (BOOL)isEqualToToken:(nonnull GIDToken *)otherToken;
Parameters
otherToken
|
Another token to compare.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-19 UTC.
[null,null,["Last updated 2025-05-19 UTC."],[[["\u003cp\u003e\u003ccode\u003eGIDToken\u003c/code\u003e represents an OAuth2 or OpenID Connect token and provides access to its string representation and expiration date.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003etokenString\u003c/code\u003e for the token value and \u003ccode\u003eexpirationDate\u003c/code\u003e for when it expires.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eisEqualToToken:\u003c/code\u003e method allows comparison with another \u003ccode\u003eGIDToken\u003c/code\u003e instance to determine equality.\u003c/p\u003e\n"]]],[],null,["# GoogleSignIn Framework Reference\n\nGIDToken\n========\n\n @interface GIDToken : NSObject \u003cNSSecureCoding\u003e\n\nThis class represents an OAuth2 or OpenID Connect token.\n- `\n ``\n ``\n `\n\n ### [tokenString](#/c:objc(cs)GIDToken(py)tokenString)\n\n `\n ` \n The token string. \n\n #### Declaration\n\n Swift \n\n var tokenString: String { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) NSString *_Nonnull tokenString;\n\n- `\n ``\n ``\n `\n\n ### [expirationDate](#/c:objc(cs)GIDToken(py)expirationDate)\n\n `\n ` \n The estimated expiration date of the token. \n\n #### Declaration\n\n Swift \n\n var expirationDate: Date? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) NSDate *expirationDate;\n\n- `\n ``\n ``\n `\n\n ### [-isEqualToToken:](#/c:objc(cs)GIDToken(im)isEqualToToken:)\n\n `\n ` \n Check if current token is equal to another one. \n\n #### Declaration\n\n Swift \n\n func isEqual(to otherToken: GIDToken) -\u003e Bool\n\n Objective-C \n\n - (BOOL)isEqualToToken:(nonnull GIDToken *)otherToken;\n\n #### Parameters\n\n |--------------------|---------------------------|\n | ` `*otherToken*` ` | Another token to compare. |"]]