No Revisions Have Been Made To This Page
Can you suggest an edit for this page? Click Here
Facebook is one of the most important social media on the
internet and many games and developers currently have their own
pages for posting games and media. GameMaker: Studio has a
number of built in functions that permit you to connect with
Facebook and get user information as well as post images and text
to walls and a number of other things. It is recommended that you
visit the Facebook
Developers page before starting to use these functions as a
firm understanding of how the Facebook Graph works and the
available calls and permissions is essential for you to get the
most from these functions.
The current graph API supported is Graph API v2.0 on all platforms.
NOTE: If your test device has the Facebook App installed, these functions will only work when creating an executable, as just testing the game (using the green or orange "play" buttons) will not work correctly. Basically, the test runner and the FaceBook App communicate with one another so the mechanism for communication has to be correctly setup, and you only get it correctly setup via the Create Application button.
When you set up your Facebook page to accept an Android app, you
need to give the Android package name (reverse URL format
and should conform to your game bundle ID), and you can set the
class name to be <package_name>.RunnerActivity.
GameMaker: Studio also supports Single Sign-On for
Android apps, so you can enable this to allow the game to be
launched from the Android Facebook app notifications. There is no
need to activate Deep Linking as it is not supported by
There is also a section where you are required to enter the Android Keystore Hash that is unique to the keystore that you are using for your game. As this can be quite difficult to get, GameMaker: Studio can generate it for you from the Android Preferences, and you can then simply copy and paste it into the required part of the Facebook setup page.
The image below shows how your final Facebook Android section should look:
The basic setup for iOS apps with the Facebook functions is the same as for Android, however there are a few key things that need to be correctly set up on the actual Facebook Developers page for your app:
Also note that the iOS
Facebook SDK version is 3.16.1 which means that the minimum
iOS target is version v5.0 and above.
The HTML5 target works almost exactly the same as all previous target modules, however you cannot test the functions locally, meaning that you will have to compile and upload to your server to test. There is also one additional function that has been added to create offerwall compatibility for HTML5 games that is not available for other platforms:
The functions listed below are for integrating your game with Facebook:
NOTE: You must have activated the Facebook API in the
Game Settings and called the
facebook_init() function before any of these functions
can be used correctly.
There are a few things to note when working with Facebook, and these are listed below: