What is a message action button?
Your app's message action button is added to each and every message that a user sees in Flock. If a user clicks the message action button, the message and chat details are sent to the app via the client.messageAction event.
A user can also select multiple messages in Flock. If a user clicks the message action button after selecting multiple messages, then details of all the selected messages are sent.
What are the available actions for a message action button?
Your app can configure any of these client actions for a message action button:
- Opening a widget inside the Flock client
- Opening a URL in the system browser;
- Sending an event to the event listener URL.
What message details are included in client.messageAction?
Flock will always send the
uid of every message that was selected when the message action button was pressed.
Optionally, when the number of messages selected is low, Flock might send the Message objects within the event itself. If the
messages array is included, then you can read message details directly from within the event, rather than calling chat.fetchMessages.
How do I create a message action button?
- Go through Creating an App to setup your app in the developer dashboard.
In the Advanced Info section, enable the message action button.
Fill in the info below:
Field Mandatory Description Title Yes Title for the message action button Select Action Yes Select an appropriate client action for the message action button
- Go through app installation and install the app into your own Flock account.
- Click the app's message action button on any message.
- Verify the event token and take relevant action at your end.