callExtension
method provided by our SDKs:
onCustomMessageReceived
listener in order to receive the Poll-related message. Please refer to our Receive Messages documentation under the SDK of your choice.
The metadata
stores all the information about the poll. You will find the following details in metadata
-> @injected
-> extensions
-> polls
.
Key | Value |
---|---|
id | A String representing a unique ID for the poll. |
options | An Object with the option number as the key and the option description as the value. |
question | A string representing the question asked in the poll. |
results | An object that stores voting results. |
metadata
will also contain incrementUnreadCount
with value as true
. This will be useful for incrementing the unread count every time a poll is received.
id
of the poll and the option you intend to vote for. The vote
parameter is basically the option number.
You can allow users to vote for a poll by using the callExtension
method provided by our SDKs:
metadata
callExtension
method.custom
. When the votes are cast by the users, the metadata for the message will be updated accordingly. To get real-time voting information, you need to implement the onMessageEdited
listener. Please check our Edit message documentation under the SDK of your choice.
The updated details will be available in the metadata of the message. Here is a sample response:
callExtension
method provided by our SDKs: