I have no idea. Can you direct me to some official Facebook documentation describing exactly what it is you want to do and I’ll try to provide some support from a Defold perspective.
You can’t send fb bot webhook manually. Facebook sends it automatically when player close a game.
You can only set parameters, which will be set to webhook as payload. Use method set_session_data for this. Usage example
function to send data to the sever. but it not send message to the “Chamika”.
this is the backend code,
function receivedGameplay(event) {
// Page-scoped ID of the bot user
var senderId = event.sender.id;
// FBInstant player ID
var playerId = event.game_play.player_id;
// FBInstant context ID
var contextId = event.game_play.context_id;
// Check for payload
if (event.game_play.payload) {
//
// The variable payload here contains data set by
// FBInstant.setSessionData()
//
var payload = JSON.parse(event.game_play.payload);
// In this example, the bot is just "echoing" the message received
// immediately. In your game, you'll want to delay the bot messages
// to remind the user to play 1, 3, 7 days after game play, for example.
sendMessage(senderId, null, "Message to game client: '" + payload.message + "'", "Play now!", payload);
}
}