Search code examples
webhooksmultiplayerfacebook-instant-games

Saving and loading facebook instant game multiplayer data of the game


1) Is setting up webhook necessary to save json data of a context shared between players of context? 2) How to validate callback url for webhook on facebook developer console? My game is already live on facebook for single player. (No local testing) 3) Can I use my own personal https url to setup webhook?


Solution

    1. No, you do not need to use the webhook to save context data. You can use XMLHttpRequest, fetch or a JavaScript SDK for a service like Playfab or Firebase to store data. In fact, we wouldn't even recommend you use a webhook for saving data because if the player turns off messages from your bot you will not receive any webhook callbacks.

    2. You can validate a callback URL using the developer dashboard, including the "Show Recent Errors" button, which is really useful for spotting any issues. You can also get more information from the Webhooks item on the left nav.

    The developer dashboard showing the webhook settings

    1. You may need to clarify what you mean by "your own personal https url". As long as Facebook can hit your webhook URL, everything will work. You cannot, for example use a localhost URL.