Skip to content

Facebook

Jabran Rafique edited this page Apr 9, 2015 · 12 revisions

API ReferenceFacebook

Setup

Facebook SDK can be setup using following method and settings:

/**
 * Setup Facebook SDK
 *
 * @param Object settings
 * @return Object
 */
new Socialmedia.Facebook( settings );

The settings object is made of following parameters:

Required parameter

/**
 * Facebook APP ID
 *
 * @type: String|Numeric String
 * @default: NULL
 * @throws: Error
 */
appid: '0123456789'

Optional parameters

/**
 * Enable/disable SDK to check
 * user login status itself
 *
 * @type: Boolean
 * @default: false
 */
status: false

/**
 * Enable/disable XFBML
 * XFBML parses & renders Facebook elements in app
 *
 * @type: Boolean
 * @default: true
 */
xfbml: true

/**
 * Enable/disable cookies for session storage
 *
 * @type: Boolean
 * @default: true
 */
cookie: true

/**
 * Enable/disable Frictionless requests
 *
 * @type: Boolean
 * @default: false
 */
requests: false

/**
 * Load specific Facebook SDK version
 *
 * @type: String
 * @default: Latest
 */
version: 'v2.2'

/**
 * Enable/disable debug mode with uncompressed version
 *
 * @type: Boolean
 * @default: false
 */
debug: false

/**
 * Facebook Canvas autogrow on content update
 *
 * @type: Boolean
 * @default: true
 */
autogrow: true

/**
 * Channel URL for Cross-Origin Resource Sharing (CORS)
 *
 * @type: String
 * @default: NULL
 */
channel: ''

/**
 * Asynchronous callback function
 *
 * Any methods that rely on Facebook SDK must
 * be called using this callback function as it
 * runs asynchronously after Facebook SDKs are loaded.
 *
 * This function runs FB.getLoginStatus in background
 * and returns a Graph API Object with current user status
 *
 * @type: Function
 * @param: Graph API Object response
 * @default: Function
 */
callback: function(response) {}

API

socialmedia exposes following API for Facebook platform:

Next: Twitter

Clone this wiki locally