Developers Manual > SDK Integration > Facebook

Integrating Facebook SDK

version: cocos2d-x v3.x, cocos2d-js v3.x
update: Updated almost 3 years ago

Cocos2d-x/-js's built-in support for Facebook's platform provides a comprehensive collection of Facebook's social features, giving your players the ability to share content with their friends and allowing you to create a personal, social gaming experience. With this addition, you can build cross-platform games by sharing a single code base and integrate Facebook features without importing additional frameworks or SDKs.


Cocos2d-JS is Cocos2d-x engine's JavaScript version. It supports full Cocos2d-x functionality with a set of simplified JavaScript friendly APIs. Cocos2d-JS and its built-in Facebook support provides a consistent "Code once, run everywhere" development experience. With one single JavaScript code base, you'll be able to deploy socially integrated gaming experiences to your players, cross the key gaming platforms of Web, Android and iOS.

In addition to providing a base set of Facebook features that are invoked consistently across platforms, it also offers support for Facebook features that are unique to a particular platform (e.g. payments on Facebook Canvas). This will allow you to keep your code clean, using a simple, consistent model for everything your app can do on Facebook.

Cocos2d-x (C++ and Lua)

The C++ and Lua versions of Cocos2d-x engine are widely adopted by mobile developers to build their mobile games cross Android and iOS by sharing a single code base. The built-in Facebook support further extends the same "Code once, run everywhere" development experience by providing Facebook mobile platform features across Android and iOS.

At the current stage, Facebook support in Cocos2d-x (C++ and Lua) is still under beta and we are still doing more iterations based on developers' feedback.

Getting started


Cocos2d-x (C++ and Lua)

At the current stage, the documentation of Cocos2d-x (C++ and Lua) is still under beta and we are improving it. For now, please visit Facebook integration instruction for Cocos2d-x to learn more details.

Report bugs or need help?

Please visit our Online forum

Related resources

facebook.png (155.2 kB), 2014-12-05 09:05

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