Send Message To Room
Description
The sendMessageToRoom() function is the one responsible for sending messages in Widget. You can send the following types of messages:
TextMessage
ImageMessage
AudioMessage
VideoMessage
DocumentMessage
LocationMessage
PostbackMessage
EventMessage
Params
The sendMessageToRoom() function will receive 2 mandatory params as its argument:
roomId: It is a param of type “string”, that corresponds to the ID of the room to which messages will be sent. The ID of the current room is a key inside the room object of widgetService, and can be accessed as follows:
widgetService.room.id
message: It Is an object that will have different keys, depending on the type of message being sent, according to the corresponding interfaces.
Interfaces
Text Message Interface
Image Message Interface
Audio Message Interface
Video Message Interface
Document Message Interface
Location Message Interface
Postback Message Interface
Event Message Interface
Example of use: Text message
Last updated