FB.Facebook.init

Description

Initializes Facebook Connect for your implementation.

Signature

init(String apiKey,  String xdChannelUrl,  Object appSettings)

Parameters

apiKeyString

The API key for your Facebook Connect implementation.

xdChannelUrlString

The relative URL to the cross-domain communication channel file located on your servers.

appSettingsObject

An optional dictionary of other application settings. If specified, the currently supported key/value pairs are:

reloadIfSessionStateChanged
bool - If the value is true, Facebook will monitor changes in session state and reload the current page if the session state changes. This option is convenient for an implementation that needs to reload the page whenever session state change in order to generate different content from server side.
ifUserConnected
This parameter can be either a function that takes a string argument for uid or string to a URL. If a function is passed, then the function gets invoked if the user is connected; if the user is not connected, the function gets invoked once the user connects.

If a string is passed, then the browser gets redirected to the URL specified in the string if the user is connected.

Note: You cannot specify this key and reloadIfSessionStateChanged at the same time.

ifUserConnected requires the Connect feature.

ifUserNotConnected
This parameter can be either a function that takes a string argument for uid or string to a URL. If a function is passed, then the function gets invoked if the user is not connected.

If a string is passed, then the browser gets redirected to the URL specified in the string if the user is not connected.

Note: You cannot specify this key and reloadIfSessionStateChanged at the same time.

ifUserNotConnected requires the Connect feature.

doNotUseCachedConnectState
bool - By default, Facebook checks if the user's Connect state is cached in a cookie. If this value is true, Facebook clears the cookie's value and does not use it.
debugLogLevel
int - Specify the debug logging level. This is same as setting FB.FBDebug.logLevel.