Integrating with Facebook
In many ways, integration with Facebook resembles integration with Twitter. Facebook offers, however, much more game orientation. In our case, we will implement achievements for logged-in users. We will use Facebook's PHP SDK, but other languages are supported too.
As for Twitter, we need to first register our application in Facebook. To do this, log in to Facebook's developer website (https://developers.facebook.com/) and click on Apps in the header:
Then, click on Create New Apps and fill in the required information. You will then be prompted with your newly created application page. Here, you'll have to note the two values shown in the following screenshot (just as we did for Twitter):
If you look at the red arrow in the preceding screenshot, you'll notice that you can choose how your app and Facebook will interact. To have full access to Facebook's Open Graph API that allows you, amongst other things, to publish achievements, you need to select App on Facebook...