FBAccessTokenData
This class is no longer available in the most recent version of the SDK.
A more recent version of this class is available. Check out the latest version.

Represents an access token used for the Facebook login flow and includes associated metadata such as expiration date and permissions. You should use factory methods (createToken...) to construct instances and should be treated as immutable.

Discussion:

For more information, see https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/.

Conforms to:NSCopying
Inherits from:NSObject
Declared in:FBAccessTokenData.h
Properties
accessToken

Returns the access token NSString.

@property (readonly, nonatomic, copy) NSString *accessToken;
Declared In: FBAccessTokenData.h
appID

Returns the app ID NSString.

@property (readonly, nonatomic, copy) NSString *appID;
Declared In: FBAccessTokenData.h
declinedPermissions

Returns the declined permissions associated with the access token.

@property (readonly, nonatomic, copy) NSArray *declinedPermissions;
Declared In: FBAccessTokenData.h
expirationDate

Returns the expiration date of the access token.

@property (readonly, nonatomic, copy) NSDate *expirationDate;
Declared In: FBAccessTokenData.h
loginType

Returns the login type associated with the token.

@property (readonly, nonatomic) FBSessionLoginType loginType;
Declared In: FBAccessTokenData.h
permissions

Returns the permissions associated with the access token.

@property (readonly, nonatomic, copy) NSArray *permissions;
Declared In: FBAccessTokenData.h
permissionsRefreshDate

Returns the date the permissions were last refreshed.

@property (readonly, nonatomic, copy) NSDate *permissionsRefreshDate;
Declared In: FBAccessTokenData.h
refreshDate

Returns the date the token was last refreshed.

@property (readonly, nonatomic, copy) NSDate *refreshDate;
Declared In: FBAccessTokenData.h
userID

Returns the user ID NSString that is associated with the token,if available.

@property (readonly, nonatomic, copy) NSString *userID;
Discussion:

This may not be populated for login behaviours such as the iOS system account.

Declared In: FBAccessTokenData.h
Class Methods
createTokenFromDictionary:

Creates an FBAccessTokenData from a dictionary or returns nil if required data is missing.

ParameterDescription
dictionary

The dictionary with FBSessionTokenCachingStrategy keys.

+ (FBAccessTokenData *) createTokenFromDictionary:(NSDictionary *)dictionary;
Declared In: FBAccessTokenData.h
createTokenFromFacebookURL:appID:urlSchemeSuffix:

Creates an FBAccessTokenData from an App Link provided by the Facebook application or nil if the url is not valid.

ParameterDescription
url

The url provided.

appID

Needed in order to verify URL format.

urlSchemeSuffix

Needed in order to verify URL format.

+ (FBAccessTokenData *)
createTokenFromFacebookURL: (NSURL *)url
appID: (NSString *)appID
urlSchemeSuffix: (NSString *)urlSchemeSuffix;
Declared In: FBAccessTokenData.h
createTokenFromString:permissions:declinedPermissions:expirationDate:loginType:refreshDate:permissionsRefreshDate:appID:userID:

Designated factory method. Creates an FBAccessTokenData from existing information or returns nil if required data is missing.

ParameterDescription
accessToken

The token string. If nil or empty, this method will return nil.

permissions

The permissions set. A value of nil indicates basic permissions.

declinedPermissions

The declined permissions set. A value of nil indicates empty array.

expirationDate

The expiration date. A value of nil defaults to [NSDate distantFuture].

loginType

The login source of the token.

refreshDate

The date that token was last refreshed. A value of nil defaults to [NSDate date].

permissionsRefreshDate

The date the permissions were last refreshed. A value of nil defaults to [NSDate distantPast].

appID

The ID string of the calling app. A value of nil defaults to [FBSettings defaultAppID].

+ (FBAccessTokenData *)
createTokenFromString: (NSString *)accessToken
permissions: (NSArray *)permissions
declinedPermissions: (NSArray *)declinedPermissions
expirationDate: (NSDate *)expirationDate
loginType: (FBSessionLoginType)loginType
refreshDate: (NSDate *)refreshDate
permissionsRefreshDate: (NSDate *)permissionsRefreshDate
appID: (NSString *)appID
userID: (NSString *)userID;
Declared In: FBAccessTokenData.h
createTokenFromString:permissions:expirationDate:loginType:refreshDate:

Creates an FBAccessTokenData from existing information or returns nil if required data is missing.

ParameterDescription
accessToken

The token string. If nil or empty, this method will return nil.

permissions

The permissions set. A value of nil indicates basic permissions.

expirationDate

The expiration date. A value of nil defaults to [NSDate distantFuture].

loginType

The login source of the token.

refreshDate

The date that token was last refreshed. A value of nil defaults to [NSDate date].

+ (FBAccessTokenData *)
createTokenFromString: (NSString *)accessToken
permissions: (NSArray *)permissions
expirationDate: (NSDate *)expirationDate
loginType: (FBSessionLoginType)loginType
refreshDate: (NSDate *)refreshDate;
Declared In: FBAccessTokenData.h
createTokenFromString:permissions:expirationDate:loginType:refreshDate:permissionsRefreshDate:

Creates an FBAccessTokenData from existing information or returns nil if required data is missing.

ParameterDescription
accessToken

The token string. If nil or empty, this method will return nil.

permissions

The permissions set. A value of nil indicates basic permissions.

expirationDate

The expiration date. A value of nil defaults to [NSDate distantFuture].

loginType

The login source of the token.

refreshDate

The date that token was last refreshed. A value of nil defaults to [NSDate date].

permissionsRefreshDate

The date the permissions were last refreshed. A value of nil defaults to [NSDate distantPast].

+ (FBAccessTokenData *)
createTokenFromString: (NSString *)accessToken
permissions: (NSArray *)permissions
expirationDate: (NSDate *)expirationDate
loginType: (FBSessionLoginType)loginType
refreshDate: (NSDate *)refreshDate
permissionsRefreshDate: (NSDate *)permissionsRefreshDate;
Declared In: FBAccessTokenData.h
createTokenFromString:permissions:expirationDate:loginType:refreshDate:permissionsRefreshDate:appID:

Creates an FBAccessTokenData from existing information or returns nil if required data is missing.

ParameterDescription
accessToken

The token string. If nil or empty, this method will return nil.

permissions

The permissions set. A value of nil indicates basic permissions.

expirationDate

The expiration date. A value of nil defaults to [NSDate distantFuture].

loginType

The login source of the token.

refreshDate

The date that token was last refreshed. A value of nil defaults to [NSDate date].

permissionsRefreshDate

The date the permissions were last refreshed. A value of nil defaults to [NSDate distantPast].

appID

The ID string of the calling app. A value of nil defaults to [FBSettings defaultAppID].

+ (FBAccessTokenData *)
createTokenFromString: (NSString *)accessToken
permissions: (NSArray *)permissions
expirationDate: (NSDate *)expirationDate
loginType: (FBSessionLoginType)loginType
refreshDate: (NSDate *)refreshDate
permissionsRefreshDate: (NSDate *)permissionsRefreshDate
appID: (NSString *)appID;
Declared In: FBAccessTokenData.h
Instance Methods
dictionary

Returns a dictionary representation of this instance.

- (NSMutableDictionary *) dictionary;
Discussion:

This is provided for backwards compatibility with previous access token related APIs that used a NSDictionary (see FBSessionTokenCachingStrategy).

Declared In: FBAccessTokenData.h
isEqualToAccessTokenData:

Returns a Boolean value that indicates whether a given object is an FBAccessTokenData object and exactly equal the receiver.

ParameterDescription
accessTokenData

The data to compare to the receiver.

- (BOOL) isEqualToAccessTokenData:(FBAccessTokenData *)accessTokenData;
Declared In: FBAccessTokenData.h