-
Notifications
You must be signed in to change notification settings - Fork 5
message
The message callback sent by Facebook is stored in the form of structures. There are three types of callback supported currently:-
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