/ SDKs / Unity
SDKs
Chat SDKs Unity v4
Chat SDKs Unity
Chat SDKs
Unity
Version 4

Unpin a message

Copy link

Sendbird Chat SDK for Unity allows you to unpin messages in group channels. Unpinning messages that are no longer relevant or important helps to keep the pinned messages organized in your channel.


Unpinning a message in a channel

Copy link

You can unpin a message using the UnpinMessage() method of the SbGroupChannel class. Specify the MessageId of a message to unpin as shown in the code below.

groupChannel.UnpinMessage(MESSAGE_ID, (inError) =>
{
    if (inError != null)
        return; // Handle error.
});

The following table shows a list of properties related to the pinned messages feature. The PinnedMessageIds, and LastPinnedMessage properties belong to the SbGroupChannel class.

List of properties

Copy link
Property nameTypeDescription

PinnedMessageIds

List<int>

Specifies an array of message IDs of the pinned messages in a group channel.

LastPinnedMessage

SbBaseMessage

Specifies the last message that was pinned in a group channel.

Getting notified when a message is unpinned

Copy link

Once a message is unpinned, the OnPinnedMessageUpdated() event handler is invoked. For further information on SbGroupChannelHandler, see the Add or remove a channel event handler page.