Getting started with the SDKBOX Facebook plugin

This past week, the SDKBOX team released a new Facebook plugin! Just like the rest of the SDKBOX Plugins, you can now integrate Facebook into your game with ease. The current version of the plugin supports sharing links and photos (with or without comments) as well as using the Graph API.

To get started you need to setup a few items so allow SDKBOX and your code to interact with Facebook’s environment. Take note that there are steps for everyone, specific steps for iOS developers and then specific steps for Android developers.

For Everyone:

  1. sign up to be a Facebook Developer
  2. create a new APP and choose Advanced Setup
  3. fill out your new APP information and choose Create App ID
  4. create a TEST version of this APP using the left hand side navigation

    ensure that you fill out all the required information:
  5. using the left hand side navigation, select Roles and create a Test User. Ensure that you set a password for this Test User and assign the permissions you need.

    create a Test User and ensure that you assign it the permissions you need:
    once finished, make sure to assign the Test User a password:
  6. integrate Facebook using the SDKBOX Installer. To do this, open up a terminal, cd
    to your games root directory and type:

For iOS Developers:

There are a few iOS specific items that must be completed for proper integration with Facebook.

  1. in the info.plist file you need to specify a few additional keys:
  2. ensure that you have added the following to

For Android Developers:

There are a few Android specific items that must be completed for proper integration with Facebook.

  1. open res/values/strings.xml and replace facebook_app_id with your Facebook App ID
  2. open and set

    NOTE: minSdkVersion version is android-15 (Android 4.0.3)
  3. create development and release key hashes. You need to create these key hashes for each Facebook app you are developing. Creating these key hashes involves a single command. If you are on OS X:

    If you are on Windows:
  4. Please refer to the screen shot below.

Congratulations! You now have an environment setup to integrate your cocos2d-x app with Facebook! Integrating Facebook is really simple with integration instructions provided here.

Posted in programming Tagged with: