Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • JavaScript
  • PHP
  • More SDKs
  • Methods
    • API Requests
    • Async API Requests
    • Authentication
    • Dialogs
    • Helpers
  • Interfaces
    • -
    • DialogListener
  • Errors
    • DialogError
    • FacebookError

Helpers

The helper methods to help with the Facebook integrations. These are defined in Facebook.java


Helper Methods


long getAccessExpires()

Retrieve the current session's expiration time (in milliseconds since Unix epoch), or 0 if the session doesn't expire or doesn't exist.

Parameters

None

Return Value

long - Session expiration time


String getAccessToken()

Retrieve the OAuth 2.0 access token for API access. Returns null if no session exists.

Parameters

None

Return Value

String - Access token


String getAppId()

Retrieve the app ID used to initialize the 'Facebook' object

Parameters

None

Return Value

String - App ID


boolean isSessionValid()

Whether this 'Facebook' object has an non-expired session token

Parameters

None

Return Value

boolean - true if valid session, else false.


void setAccessExpires(long time)

Set the current session's expiration time (in milliseconds since Unix epoch).

Parameters

time - timestamp in milliseconds

Return Value

None


void setAccessExpiresIn(String expiresIn)

Set the current session's duration (in seconds since Unix epoch), do nothing if null or "0".

Parameters

expiresIn - duration in seconds

Return Value

None


void setAccessToken(String token)

Set the OAuth 2.0 access token for API access.

Parameters

token - Access token

Return Value

None


void setAppId(String appId)

Set the app id for this 'Facebook' object. This should be used carefully as this results in conflict between the app id and the current access token associated with the 'Facebook' object.

Parameters

appId - App id

Return Value

None

Updated over a year ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy