|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.facebook.AccessToken
public final class AccessToken
This class represents an access token returned by the Facebook Login service, along with associated
metadata such as its expiration date and permissions. In general, the Session
class will
abstract away the need to worry about the details of an access token, but there are situations
(such as handling native links, importing previously-obtained access tokens, etc.) where it is
useful to deal with access tokens directly. Factory methods are provided to construct access tokens.
Method Summary | |
---|---|
static AccessToken |
createFromExistingAccessToken(String accessToken,
Date expirationTime,
Date lastRefreshTime,
AccessTokenSource accessTokenSource,
List<String> permissions)
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). |
static AccessToken |
createFromNativeLinkingIntent(Intent intent)
Creates a new AccessToken using the information contained in an Intent populated by the Facebook application in order to launch a native link. |
Date |
getExpires()
Gets the date at which the access token expires. |
Date |
getLastRefresh()
Gets the date at which the token was last refreshed. |
List<String> |
getPermissions()
Gets the list of permissions associated with this access token. |
AccessTokenSource |
getSource()
Gets the AccessTokenSource indicating how this access token was obtained. |
String |
getToken()
Gets the string representing the access token. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getToken()
public Date getExpires()
public List<String> getPermissions()
public AccessTokenSource getSource()
AccessTokenSource
indicating how this access token was obtained.
public Date getLastRefresh()
public static AccessToken createFromExistingAccessToken(String accessToken, Date expirationTime, Date lastRefreshTime, AccessTokenSource accessTokenSource, List<String> permissions)
accessToken
- the access token string obtained from FacebookexpirationTime
- 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.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.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
public static AccessToken createFromNativeLinkingIntent(Intent intent)
intent
- the Intent that was used to start an Activity; must not be null
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |