AccessToken
有此級別的更新版本。前往查看 最新版本。

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

伸延:Object
實作Parcelable
套件:accountkit
建構函式
AccessToken(String, String, String, long, Date)

Creates a new AccessToken using the supplied information. Note that the caller is asserting that all parameters provided are correct with respect to the access token string; no validation is done to verify they are correct.

public AccessToken(String token, String accountId, String applicationId, long tokenRefreshIntervalInSeconds, Date lastRefreshTime)
參數說明
tokenThe access token string obtained from AccountKit
accountIdThe AccountKit account id associated with this access token
applicationIdThe ID of the Facebook Application associated with this access token
tokenRefreshIntervalInSecondsThe interval at which tokens should be refreshed
lastRefreshTimeThe last time the token was refreshed (or when it was first obtained); if null, the current time is used.
執行個體方法
getAccountId()

Gets the account ID associated with the given access token

public String getAccountId()
Returns
The account ID
getApplicationId()

Gets the ID of the Facebook Application associated with this access token.

public String getApplicationId()
Returns
The application ID
getLastRefresh()

Gets the date at which the token was last refreshed. Since tokens expire, the AccountKit SDK will attempt to renew them periodically.

public Date getLastRefresh()
Returns
The date at which this token was last refreshed
getToken()

Gets the string representing the access token.

public String getToken()
Returns
The string representing the access token
getTokenRefreshIntervalSeconds()

Gets the token refresh interval in seconds

You should make an Account Kit graph call using this token at least this often to keep the token from expiring

public long getTokenRefreshIntervalSeconds()
Returns
The token refresh interval seconds
describeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

public int describeContents()
Returns
A bitmask indicating the set of special object types marshalled by the Parcelable.
describeContents()
public int describeContents()
writeToParcel(Parcel, int)

Flatten this object in to a Parcel.

public void writeToParcel(Parcel dest, int flags)
參數說明
destThe Parcel in which the object should be written.
flagsAdditional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
writeToParcel(Parcel, int)
public void writeToParcel(Parcel dest, int flags)
參數說明
dest
flags
常數
CREATOR
public static final Creator CREATOR