Welcome to the Facebook Instant Games SDK Tutorials. This series of tutorials covers many aspects of using the Facebook Instant Games SDK.
In this tutorial we will take a quick look at entry point data using the Facebook Instant Games SDK.
What is entry point data?
Entry point data is data that is passed into you game when it is launched. The data is passed from some external source such as a chat bot message or context message. Chat bot messages and context messages both allow you to pass meta data with the messages which is then passed into the game when the player launches the game from the message.
To retrieve entry point data you can call FBInstant.getEntryPointData() after startGameAsync resolves.
var entry_data = FBInstant.getEntryPointData();
Entry point data is useful for many reasons, here are a few example use cases:
- Awarding the player special in-game items or boosts if they return via the chat bot
- Sending / requesting gifts from friends that also play the game
- Passing around game state and replay data. For example, you may be playing a turn based game with a friend, the current turn can be encoded into the data and passed to the friend
We will cover this in more detail when we cover chat bots and contexts.
The above use cases are very useful for increasing player retention as well as engaging users and bringing in new users.