Gaming graph domain is a separate domain from main graph domain (graph.facebook.com) to host a set of graph APIs specifically designed for gaming apps on Facebook. It’s accessible using graph.fb.gg as the domain address. Read more about using Facebook Graph APIs.
Your application needs to enroll in Gaming Services to access features in this document. Follow the instructions to enroll your application. When gaming graph domain is enabled, your application will use Facebook Login for Gaming, and receive access token that can access the graph APIs hosted on gaming graph domain using graph.fb.gg as domain address.
Note: For the same application, only one graph domain can be accessed. If your application is enabled for gaming graph domain, it will not be able to access graph.facebook.com, and vise versa.
Gaming graph domain supports the same range of graph API versions with graph.facebook.com. The same guideline applies regarding the minimum graph API version that each application can access.
Currently supported permissions for Facebook Login for Gaming are:
| Permission | Granted Access | Required/Optional | Need App Review |
|---|---|---|---|
| User's player name and avatar. This replaces | Required | No |
| User's first name and profile picture. | Optional | No |
| User's email address. | Optional | No |
| User's Facebook friends who play the same game and granted this permission. | Optional | Yes |
Any other permission requested will be ignored and returned as denied.
Getting player name of current user:
GET graph.fb.gg/v7.0/me?field=name
Getting avatar of current user:
GET graph.fb.gg/v7.0/me/picture
Getting current user’s granted permissions:
GET graph.fb.gg/v7.0/me/permissions
An access token is an opaque string that identifies a user or app. When someone connects with an app using Facebook Login for Gaming and approves the request for permissions, the app obtains an access token that provides temporary, secure access to graph APIs. Read more about different types of access token.
Gaming graph domain supports using both user access token and app access token. Note certain graph APIs will expect user access token or app token, while others graph APIs will accept both. Please refer to the documentation of each graph API to check which type of access token should be supplied in the request.
User access token for gaming graph domain are generated as response of Facebook Login for Gaming, which needs to be attached to request for accessing graph APIs on the gaming graph domain. Similar to graph.facebook.com, the user access token generated by gaming graph domain could be short-lived or long-lived.
One noticeable difference between token generated for gaming domain (graph.fb.gg) as opposed to graph.facebook.com is that, the gaming domain access token will always start with ‘GG’ as prefix. This is useful for checking if you are receiving a token for gaming graph domain or not.
This token can only be used to access graph.fb.gg only, where using this token on graph.facebook.com will result in OAuth “Token not valid” exception.
User access token for gaming graph domain can be requested using a few different ways.
GG|{your-app_id}|{your-app_secret}There are two useful ways to debug a token generated for gaming graph domain to gain insights and verify its validity.
We provide the following ways for developers to test the access to gaming graph domain and prepare their applications for gaming graph domain.
Graph API Explorer is the most comprehensive tool for testing access to gaming graph domain and all the graph APIs it hosts. Read more about how to use Graph API Explorer.
When your application is enabled for gaming graph domain, an access token will be received for accessing gaming graph domain, and can be validated by checking the prefix of ‘GG’. The graph domain used by graph API explorer will also be automatically switched to graph.fb.gg when such token is provided.
Access Token Tool is another utility for developers to generate user access or app tokens for testing purposes. If your application has been enabled for gaming graph domain, this tool will automatically generate tokens for gaming graph domain correspondingly.
For application developers, below are the instructions for preparing your application for gaming graph domain.
On client side, it’s highly recommended to use Facebook SDK which handles supporting the gaming graph domain without any change in client code needed. Using a compatible Facebook SDK, the client will make graph API calls to the correct domain (graph.fb.gg vs graph.facebook.com) based on token received. The minimal SDK requirement for different platform are as follows:
Developers can also manually implement the support for gaming graph domain, as part of integrating with Facebook Login for Gaming, both on client and server side using following methodology:
An application enabled for gaming graph domain can only access graph APIs hosted on gaming graph domain, and will not be able to access graph.facebook.com (an OAuth exception will be thrown).
For an application that has integrated with Facebook Login and using graph APIs on graph.facebook.com domain today, migration to gaming graph domain is possible. Please work with your Facebook support contact to enable gaming graph domain on your existing application.
To make sure your application will continue to function after migrating to gaming graph domain, please follow the instructions in Prepare Your Application for Gaming Domain section above. You need to make those changes before enabling the migration to gaming graph domain.
If your app has previously logged in gamers using the graph.facebook.com domain, those gamers will see the following user experience after your app migrates to the graph.fb.gg domain:
gaming_name and gaming_picture fields instead to retrieve the friends' profile information.