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:
Name Type Argument Description path String The API call path as defined by Facebook.
method String optional The HTTP method that you want to use for the API request. Default is get
params Object The parameter object to include in the API call.
callback function 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.