Facebook Singleton

This is a layer that will handle communication with Facebook and secures the connection outside the Application.
If the user has not yet done the authentication process this will start and handle the process automatically.

Facebook()

Example

Facebook.api('me', function(result) {
   //Received a response from Facebook API.
   console.log('The result:', result);
});

Methods

api(path, method, params, callback)

This method will make calls to the Facebook API's. Look at the facebook API for what is possible.

Parameters:

NameTypeArgumentDescription
pathString

The API call path as defined by Facebook.

methodStringoptional 

The HTTP method that you want to use for the API request. Default is get

paramsObject

The parameter object to include in the API call.

callbackfunction

The method that will be triggered when the API call returns a result.

getImageById()

reset()

This will reset the facebook API. Subscribed function will also be removed.

Events

onConnected

The active profile has a facebook authentication and the user has connected by entering a password.

onDisconnected

The active profile lost the connection with facebook.

onUnpairedProfile

The active profile has no facebook authentication done.