Sharing improves the visibility of your game by enabling your players to share key moments or achievements. Sharing is available to all approved game developers using SDKs for Instant Games and Legacy Web Games.
Players can post meaningful moments from your game to a variety of Facebook surfaces including:
Players can share screenshots and video clips of their gameplay. Shares to the player's Feed can include a custom message.
Call FBInstant.shareAsync()
to set the image, text, and button text for the content that will appear in Feed stories and Messenger messages. When a user clicks the button it launches the game; from that entry point, the developer has access to FBInstant.getEntrypointData()
, which returns the data
object that was passed to FBInstant.shareAsync()
.
The flow of the Sharing feature is as follows:
Player achieves something: e.g. completes a level, beats a difficulty, gets an achievement.
Prompt your players to share - but don’t call the API until they’ve clicked a Share button (See Facebook Developer Policy 7.4.f).
After they click Share, call shareAsync and pass in an image, GIF or video that will show up in Feed, as well as a payload that can help you put new players into the right experience in-game.
Player chooses who to share with, writes something and shares.
Post shows up in Feed
Players who jump into the game will start a brand new session, unless you provide and use a payload to drop them somewhere else.
Shares are published directly to a player's profile and show up in Feed, so to maximize player acquisition be sure to build a high quality, intuitive sharing flow into your game. When designing your games, identify meaningful moments (e.g., a feeling of personal accomplishment, an exquisite victory by a friend, or a celebration of a team effort) and give players clear options to share these moments.
We recommend at least one prominent Share button on a results page or other relevant pages. Encourage your players to share more content by providing game prompts at meaningful times, including with context / descriptions (e.g., achieved a new high score, acquired a rare item). For more details, see Best Practices.
This one-to-many communication channel is a powerful driver of player acquisition and retention. Because they manifest in Feed, Shares can help surface your game to players who have never seen it before—especially players who don’t usually visit the Gaming Tab.
Read how Awesome Prototype leveraged sharing to drive retention
This section contains information about how to integrate the Sharing feature in each supported SDK.
Call FBInstant.shareAsync()
to initiate sharing, and pass in an image and a payload that can bring a player’s friends right into the correct game level.
Call FB.gamingservices.uploadImageToMediaLibrary
in the Gaming Services Javascript SDK.
FB.gamingservices.uploadImageToMediaLibrary
allows the game to upload media asynchronously (player will share after the session) shouldLaunchMediaDialog
to TRUE triggers an immediate share dialog.See advice on Sharing Meaningful Moments.
The player makes a new discovery or completes character creation and chooses to share.
Your game should make the following call.
FBInstant.shareAsync
Friend sees the share and clicks to play.
The friend jumps into the right place in the game and begins play.
Incentivizing players by giving rewards in return just for sharing the game is against Facebook Policy. But you can reward players if someone plays the game (and accepts TOS as needed) from a share or invite. In this case, you can reward both players, if you wish.
Your game offers to reward the player for bringing friends to the game.
Your game should make the following call.
FBInstant.shareAsync({ intent: 'REQUEST', Image: base64Picture, text: ‘Come play with your friend!’, data: {payload: ‘...’}, switchContext: false,
Friend sees the share and clicks to play.
Game interprets payload and shows the person their reward from playing from the share.
Your game should make the following call.
FBInstant.getEntryPointData()
When the invitee accepts the reward, send a Custom Update to the inviter to let them know they get one too.
Your game should make the following call.
FBInstant.updateAsync({ action: 'CUSTOM', cta: 'Join The Fight', image: base64Picture, text: { default: 'You have a new reward!', localizations: {}} template: 'VILLAGE_INVASION', data: { payload: '...' }, strategy: 'IMMEDIATE', notification: 'NO_PUSH', })
You are not allowed to give Player A a gift just for inviting another player or sharing something to Feed. However, Player A can receive a reward if they invite Player B, and Player B has started playing. Player B can also receive a reward in this scenario. Read more about this policy.
Sharing for Instant GamesExplains how to allow your players to share their game activity to their profile and their friends' Feed. | Sharing for Native AppsLearn how to enable game content to be shared broadly across Facebook and Instagram. |