Message Actions API for Unity SDK
Use message actions to add or remove metadata on published messages. Common uses include receipts and reactions. Clients subscribe to a channel to receive message action events. Clients can also fetch past message actions from Message Persistence, either independently or when fetching original messages.
Reactions
"Message Reactions" is a specific application of the Message Actions API for emoji or social reactions.
Message Actions vs. Message Reactions
Message Actions is the flexible, low-level API for adding any metadata to messages (read receipts, delivery confirmations, custom data), while Message Reactions specifically refers to using Message Actions for emoji/social reactions.
In PubNub Core and Chat SDKs, the same underlying Message Actions API is referred to as Message Reactions when used for emoji reactions - it's the same functionality, just different terminology depending on the use case.
Add message action
Requires Message Persistence
This method requires that Message Persistence is enabled for your key in the Admin Portal.
Add an action to a published message. The response includes the added action.
Method(s)
Use this Unity method:
1pubnub.AddMessageAction()
2 .Channel(string)
3 .MessageTimetoken(long)
4 .Action(PNMessageAction)
5 .Execute(System.Action<PNAddMessageActionResult, PNStatus>)
| Parameter | Description |
|---|---|
Channel *Type: string | Channel name to add the message action to. |
MessageTimetoken *Type: long | Timetoken of the target message. |
Action *Type: PNMessageAction | Message action payload. |
Execute |