Skip to content

message

hundredeir edited this page Nov 25, 2017 · 2 revisions

Message

The message callback sent by Facebook is stored in the form of structures. There are three types of callback supported currently:-

  1. Message Received Callback
  2. Message Delivered Callback
  3. Message Read Callback

The method/function you create should take an argument which will be an instance of class Message.

Whenever a callback is received by your webhook. an instance of the the class will be created consisting of data of callback which will be passed to your function.

To access data of a particular field used structure form. Say to access the text sent by the user

use message.Message_Received.text

similarly for attachments(images,video,stickers)

message.message_received.attachments.type

message.message_received.attachments.url

and for location

message.message_received.attachments.coordinates_lat

message.message_received.attachments.coordinates_long

Objects will be none if no data is received for corresponding field

For more info about different objects available checkout the code here : message

Clone this wiki locally