Facebook
in package
[$facebook = $this->core->loadClass('Facebook');] Class to facilitate facbook integration
Table of Contents
Properties
- $access_token : mixed
- $client : mixed
- $client_secret : mixed
- $error : mixed
- $errorMsg : mixed
- $scope : mixed
- $core : mixed
Methods
- __construct() : mixed
- addError() : mixed
- createPageTab() : array<string|int, mixed>
- Service that creates a tab in a page
- decodeSignedRequest() : array<string|int, mixed>|null|void
- Analyze $signed_request https://developers.facebook.com/docs/pages/tabs https://developers.facebook.com/docs/reference/login/signed-request
- deletePageTab() : array<string|int, mixed>|null
- Service that delete a tab in a page
- getPage() : array<string|int, mixed>|void
- Returns the pages that the user associated to the access token can admin
- getPages() : array<string|int, mixed>|void
- Returns the pages that the user associated to the access token can admin
- getProfile() : array<string|int, mixed>|void
- Returns info about an user About the fields and the end-point: https://developers.facebook.com/docs/graph-api/reference/user/
- setAccessToken() : mixed
- Set an access token for all calls avoiding to send it in every call
Properties
$access_token
public
mixed
$access_token
= \null
$client
public
mixed
$client
$client_secret
public
mixed
$client_secret
= []
$error
public
mixed
$error
= \false
$errorMsg
public
mixed
$errorMsg
= []
$scope
public
mixed
$scope
$core
private
mixed
$core
Methods
__construct()
public
__construct(Core7 &$core) : mixed
Parameters
- $core : Core7
addError()
public
addError(mixed $value) : mixed
Parameters
- $value : mixed
createPageTab()
Service that creates a tab in a page
public
createPageTab( $id, $parameters[, $access_token = null ]) : array<string|int, mixed>
Parameters
- $id :
-
page id
- $parameters :
-
"app_id" => ID of the app that contains a Page Tab platform (required) "custom_name" => Custom name for the tab (required) "custom_image_url" => url of the image file (optional). You can upload a JPG, GIF or PNG file. The size of the image must be 111 x 74 pixels. File size limit 1 MB. "position" => position among the other tabs (optional)
- $access_token : = null
-
optional access token if it is not set
Return values
array<string|int, mixed>decodeSignedRequest()
Analyze $signed_request https://developers.facebook.com/docs/pages/tabs https://developers.facebook.com/docs/reference/login/signed-request
public
decodeSignedRequest( $signed_request) : array<string|int, mixed>|null|void
The method decodeSignedRequest in case of success will return an array with user values: https://developers.facebook.com/docs/reference/login/signed-request
Parameters
Return values
array<string|int, mixed>|null|voiddeletePageTab()
Service that delete a tab in a page
public
deletePageTab( $id, $tabId[, $access_token = null ]) : array<string|int, mixed>|null
Parameters
Return values
array<string|int, mixed>|null —Return the tabs in the page or null if error
getPage()
Returns the pages that the user associated to the access token can admin
public
getPage(mixed $id[, string $access_token = null ][, string $fields = 'access_token,category,name,id,link,fan_count,is_verified,engagement,emails,general_info' ]) : array<string|int, mixed>|void
Parameters
- $id : mixed
- $access_token : string = null
-
optional access token
- $fields : string = 'access_token,category,name,id,link,fan_count,is_verified,engagement,emails,general_info'
-
optional fields to show.. See https://developers.facebook.com/docs/graph-api/reference/page/
Return values
array<string|int, mixed>|voidgetPages()
Returns the pages that the user associated to the access token can admin
public
getPages([null $access_token = null ]) : array<string|int, mixed>|void
Parameters
- $access_token : null = null
Return values
array<string|int, mixed>|voidgetProfile()
Returns info about an user About the fields and the end-point: https://developers.facebook.com/docs/graph-api/reference/user/
public
getProfile( $id[, string $access_token = null ][, string $fields = 'id,name,first_name,middle_name,last_name,email,cover,locale,website,link,picture,is_verified' ]) : array<string|int, mixed>|void
Parameters
- $id :
-
id of the user
- $access_token : string = null
-
optional access token
- $fields : string = 'id,name,first_name,middle_name,last_name,email,cover,locale,website,link,picture,is_verified'
-
optional fields. By default: id,name,first_name,middle_name,last_name,email,cover,locale,website,link,picture,is_verified
Return values
array<string|int, mixed>|voidsetAccessToken()
Set an access token for all calls avoiding to send it in every call
public
setAccessToken( $token) : mixed