Package 

Class AccessToken

  • All Implemented Interfaces:
    android.os.Parcelable

    
    public final class AccessToken
     implements Parcelable
                        

    This class represents an immutable access token for using Facebook APIs. It also includes associated metadata such as expiration date and permissions.

    For more information on access tokens, see Access Tokens.

    • Constructor Detail

      • AccessToken

        AccessToken(String accessToken, String applicationId, String userId, Collection<String> permissions, Collection<String> declinedPermissions, Collection<String> expiredPermissions, AccessTokenSource accessTokenSource, Date expirationTime, Date lastRefreshTime, Date dataAccessExpirationTime, String graphDomain)
        Creates a new AccessToken using the supplied information from a previously-obtained access token (for instance, from an already-cached access token obtained prior to integration with the Facebook SDK).
        Parameters:
        accessToken - the access token string obtained from Facebook
        applicationId - the ID of the Facebook Application associated with this access token
        userId - the id of the user
        permissions - the permissions that were requested when the token was obtained (or when it was last reauthorized); may be null if permission set is unknown
        declinedPermissions - the permissions that were declined when the token was obtained; may be null if permission set is unknown
        expiredPermissions - the permissions that were expired when the token was obtained; may be null if permission set is unknown
        accessTokenSource - an enum indicating how the token was originally obtained (in most cases, this will be either AccessTokenSource.FACEBOOK_APPLICATION or AccessTokenSource.WEB_VIEW); if null, FACEBOOK_APPLICATION is assumed.
        expirationTime - the expiration date associated with the token; if null, an infinite expiration time is assumed (but will become correct when the token is refreshed)
        lastRefreshTime - the last time the token was refreshed (or when it was first obtained); if null, the current time is used.
        dataAccessExpirationTime - The time when user data access expires
        graphDomain - The Graph API domain that this token is valid for.
      • AccessToken

        AccessToken(String accessToken, String applicationId, String userId, Collection<String> permissions, Collection<String> declinedPermissions, Collection<String> expiredPermissions, AccessTokenSource accessTokenSource, Date expirationTime, Date lastRefreshTime, Date dataAccessExpirationTime)
        Creates a new AccessToken using the supplied information from a previously-obtained access token (for instance, from an already-cached access token obtained prior to integration with the Facebook SDK).
        Parameters:
        accessToken - the access token string obtained from Facebook
        applicationId - the ID of the Facebook Application associated with this access token
        userId - the id of the user
        permissions - the permissions that were requested when the token was obtained (or when it was last reauthorized); may be null if permission set is unknown
        declinedPermissions - the permissions that were declined when the token was obtained; may be null if permission set is unknown
        expiredPermissions - the permissions that were expired when the token was obtained; may be null if permission set is unknown
        accessTokenSource - an enum indicating how the token was originally obtained (in most cases, this will be either AccessTokenSource.FACEBOOK_APPLICATION or AccessTokenSource.WEB_VIEW); if null, FACEBOOK_APPLICATION is assumed.
        expirationTime - the expiration date associated with the token; if null, an infinite expiration time is assumed (but will become correct when the token is refreshed)
        lastRefreshTime - the last time the token was refreshed (or when it was first obtained); if null, the current time is used.
        dataAccessExpirationTime - The time when user data access expires