Let's say you want to implement a simple chat bubble like this:
When sending a message, fill in the message data field with the information needed to draw the chat bubble.
constchatViewData= {'type':'msg_with_button','title':'Hi!','body':'This is a simple chat bubble with a button.','button_text':'Say Hello','button_action':'SayHello'};awaitclient.sendMessage({ channelId:'myChannel', type:'text', data: chatViewData,});
You can enter up to 10 key-value pairs in data field. The maximum size of key is 128 characters and the maximum size of value is 1024 characters. Both key and value must be strings.
When you display a message, use the information in the data field to draw a chat bubble.