Search code examples
facebookfacebook-messenger-botfacebook-instant-games

(FB Instant games) How I can get payload data from Game Play Button?


According to this article: https://developers.facebook.com/docs/messenger-platform/reference/buttons/game-play/ I can post parameter "payload" for button with "SERIALIZED_JSON_PAYLOAD" and "this data will be sent to the game". How I can receive this data inside my game?


Solution

  • You can use getEntryPointData inside the game in order to access the payload. Note that it must be valid JSON for this to work.