Built with game developers in mind, the new Facebook Login for Gaming enables authentication and users’ ability to give access permissions. It gives players a fast, convenient way to log in to a game across multiple platforms and to use custom player names and avatars.
Facebook Login button in the game
Facebook Login for Gaming user experience
Optional step to customize player name
Optional step to choose an avatar
Your application needs to enroll in Gaming Services to access features in this document. Follow the instructions to enroll your application.
Limited Login offers a login path that implements steps designed to prevent the fact that a person used Facebook to log in to your app from being used to target advertising or measure advertising effectiveness.
Limited Login returns an
AuthenticationToken that wraps an OpenID Connect token. The ID token cannot be used to request additional data using the Graph API, such as friends, photos, or pages. Doing so requires the use of classic Facebook Login.
A successful login populates a global
AuthenticationToken instance. You can provide a nonce for the login attempt that will be reflected in the return token. In addition, Limited Login populates a shared profile instance that contains the basic information including ID, name, profile picture, and email (if granted by the user).
It’s highly recommended to use Facebook SDK to integrate with Facebook Login for Gaming, which supports the same SDK methods as Facebook Login. If this is the first time you're integrating the Facebook SDK into your App, refer to the configuration guide before proceeding.
Compatible Facebook SDK will also make graph API calls to the gaming graph domain (graph.fb.gg) based on token received. Read more about gaming graph domain. The minimal SDK requirement for different platform are as follows:
Developers can also manually implement the support for Facebook Login for Gaming and gaming graph domain, using following methodology:
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
User's first name and profile picture.
User's email address.
User's Facebook friends who play the same game and granted this permission.
Any other permission requested will be ignored and returned as denied.
To request user's profile picture, add
gaming_user_picture into the list of permissions requested during login. This permission does not require App Review. When requesting this permission, Facebook Login for Gaming will provide two options for users to choose from:
gaming_user_picturepermissions will be granted to application.
GET graph.fb.gg/v7.0/me/picture // return profile picture
gaming_profilepermission will be granted to application.
GET graph.fb.gg/v7.0/me/picture // return avatar
After integrating Facebook Login for Gaming, your application will gain access to the user’s player name and avatar, or first name and profile picture depends on permission granted by user. You can access them through the FB SDK or directly via our graph API, by calling gaming graph domain (graph.fb.gg):
Query user's player name:
Query user's avatar or profile picture:
Query user’s granted permissions:
Query user’s Facebook Friends who also play:
For a full list of available endpoints on gaming graph domain, refer to this document.
After users connected account with Facebook Login for Gaming, your application will receive app-scoped user IDs as identifier for each user. If your application has integrated with Facebook Login before enabling Facebook Login for Gaming, users' app-scoped user IDs will not change, to allow progress be carried over.
After your app has been added to the allow list, visit the Facebook developer panel to configure Facebook Login for Gaming through your App’s developer dashboard:
If you can't access this page, your application might need to enroll in Gaming Services. Follow the instructions on enrolling your application.
There are several configuration options available for Facebook Login for Gaming:
To start exploring the features without impacting your production builds, we recommend creating a Test App based on your production app. A new Test App can be added through developer site:
The newly created Test App will be loosely coupled with your main App, but with its own App ID. This allows you to test the Login feature safely without impacting your production builds. We require this App ID to be on the allow list together with the main App ID to be enabled for Facebook Login for Gaming.
Test Apps share the same app-scoped User ID namespace as your production app making it simpler to debug issues with app-scoped IDs, or in cases where you use a copy of your production database for development.
For existing users who have connected with Facebook Login before the application migrates to gaming graph domain, the follow user experience are expected to them: