Developers Manual > SDK Integration > Facebook > Facebook API References in JavaScript > Facebook-getInstance

.getInstance()

Initialize the SDK, and return the instance of plugin.FacebookAgent. Required before doing anything else.

Example

1
2
var facebook = plugin.FacebookAgent.getInstance();
//do something, e.g. facebook.activateApp();

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.