class BaseFacebook


Located at : UKNOWVA_ROOT/components/com_community/libraries/facebook/base_facebook.php

Constants

VERSION

Version.

Properties

static $CURL_OPTS Default options for curl.
static $DOMAIN_MAP Maps aliases to Facebook domains.

Methods

__construct(array $config)

Initialize a Facebook Application.

setAppId(string $appId)

Set the Application ID.

string
getAppId()

Get the Application ID.

setApiSecret(string $apiSecret)

Set the API Secret.

string
getApiSecret()

Get the API Secret.

setFileUploadSupport(boolean $fileUploadSupport)

Set the file upload support status.

boolean
useFileUploadSupport()

Get the file upload support status.

setAccessToken(string $access_token)

Sets the access token for api calls. Use this if you get your access token by other means and just want the SDK to use it.

string
getAccessToken()

Determines the access token that should be used for API calls.

string
getSignedRequest()

Retrieve the signed request, either from a request parameter or, if not present, from a cookie.

string
getUser()

Get the UID of the connected user, or 0 if the Facebook user is not connected.

string
getLoginUrl(array $params = array())

Get a Login URL for use with redirects. By default, full page redirect is assumed. If you are using the generated URL with a window.open() call in JavaScript, you can pass in display=popup as part of the $params.

string
getLogoutUrl(array $params = array())

Get a Logout URL suitable for use with redirects.

string
getLoginStatusUrl(array $params = array())

Get a login status URL to fetch the status from Facebook.

mixed
api()

Make an API call.

Details

at line 217
__construct(array $config)

Initialize a Facebook Application.

The configuration: - appId: the application ID - secret: the application secret - fileUpload: (optional) boolean indicating if file uploads are enabled

Parameters

array $config The application configuration

at line 236
BaseFacebook setAppId(string $appId)

Set the Application ID.

Parameters

string $appId The Application ID

Return Value

BaseFacebook

at line 246
string getAppId()

Get the Application ID.

Return Value

string the Application ID

at line 256
BaseFacebook setApiSecret(string $apiSecret)

Set the API Secret.

Parameters

string $apiSecret The API Secret

Return Value

BaseFacebook

at line 266
string getApiSecret()

Get the API Secret.

Return Value

string the API Secret

at line 276
BaseFacebook setFileUploadSupport(boolean $fileUploadSupport)

Set the file upload support status.

Parameters

boolean $fileUploadSupport The file upload support status.

Return Value

BaseFacebook

at line 286
boolean useFileUploadSupport()

Get the file upload support status.

Return Value

boolean true if and only if the server supports file upload.

at line 298
BaseFacebook setAccessToken(string $access_token)

Sets the access token for api calls. Use this if you get your access token by other means and just want the SDK to use it.

Parameters

string $access_token an access token.

Return Value

BaseFacebook

at line 312
string getAccessToken()

Determines the access token that should be used for API calls.

The first time this is called, $this->accessToken is set equal to either a valid user access token, or it's set to the application access token if a valid user access token wasn't available. Subsequent calls return whatever the first call returned.

Return Value

string The access token

at line 397
string getSignedRequest()

Retrieve the signed request, either from a request parameter or, if not present, from a cookie.

Return Value

string the signed request, if available, or null otherwise.

at line 416
string getUser()

Get the UID of the connected user, or 0 if the Facebook user is not connected.

Return Value

string the UID if available.

at line 482
string getLoginUrl(array $params = array())

Get a Login URL for use with redirects. By default, full page redirect is assumed. If you are using the generated URL with a window.open() call in JavaScript, you can pass in display=popup as part of the $params.

The parameters: - redirect_uri: the url to go to after a successful login - scope: comma separated list of requested extended perms

Parameters

array $params Provide custom parameters

Return Value

string The URL for the login flow

at line 511
string getLogoutUrl(array $params = array())

Get a Logout URL suitable for use with redirects.

The parameters: - next: the url to go to after a successful logout

Parameters

array $params Provide custom parameters

Return Value

string The URL for the logout flow

at line 533
string getLoginStatusUrl(array $params = array())

Get a login status URL to fetch the status from Facebook.

The parameters: - oksession: the URL to go to if a session is found - nosession: the URL to go to if the user is not connected - no_user: the URL to go to if the user is not signed into facebook

Parameters

array $params Provide custom parameters

Return Value

string The URL for the logout flow

at line 552
mixed api()

Make an API call.

Return Value

mixed The decoded response