Unity
Group Channel Advanced

Group Channel: Advanced

This page explains the premium features for group channels. Some are available only to a paying user.


Send typing indicators to other members

If the StartTyping() and EndTyping() methods are called when a user is typing a text message, SendBird server notifies of the event to the client apps of all channel members through the TypingStatusUpdate() of the registered channel event handler.

Light Color Skin
Copy
groupChannel.StartTyping();
groupChannel.EndTyping();
...

SendBirdClient.ChannelHandler ch = new SendBirdClient.ChannelHandler();
ch.OnTypingStatusUpdated = (GroupChannel groupChannel) => {
    if (currentGroupChannel.Url.Equals(groupChannel.Url)) {
        List<User> members = groupChannel.TypingMembers;
        // Refresh typing status.
    }
};
SendBirdClient.AddChannelHandler(UNIQUE_HANDLER_ID, ch);

Retrieve number of members who have not read a message

If the MarkAsRead() method is called when a member reads messages, SendBird server notifies of the event to the client apps of all channel members through the ReadReceiptUpdated() of the registered channel handler. Using this, you can make the channel up-to-date.

Light Color Skin
Copy
groupChannel.MarkAsRead();
...

SendBirdClient.ChannelHandler ch = new SendBirdClient.ChannelHandler();
ch.OnReadReceiptUpdated = (GroupChannel groupChannel) => {
    if (currentGroupChannel.Url.Equals(groupChannel.Url)) {
        foreach (BaseMessage msg in yourMessages) {
            int unreadCount = groupChannel.GetReadReceipt(msg);
            if (unreadCount <= 0) {
                // All members have read the message.
            } else {
                // Some members haven't read the message.
            }
        }
    }
};
SendBirdClient.AddChannelHandler(UNIQUE_HANDLER_ID, ch);

The GetReadReceipt(message) returns the number of members in the channel who have not read the message.

Light Color Skin
Copy
int unreadCount = groupChannel.GetReadReceipt(message);

Send an admin message

If you are using the Custom Plan, you can send admin messages to a group channel using the SendBird Dashboard or the Platform API. To send an admin message through your dashboard, go to the Moderation > Group Channels panel, select a group channel, find the message box below, click the Admin Message tab, and then write your message in the box. An admin message is limited to 1,000 characters.

Unlike other types of messages, a push notification for an admin message is not available by default. If you want further assistance on this, please contact our sales team.

Note: For clients using the Free Plan, a suggesting message to upgrade to the Custom Plan will be returned when attempting to send an admin message using the Platform API.


Add a channel cover image

When creating a channel, you can add a cover image by specifying an image URL or file.

Light Color Skin
Copy
GroupChannel.CreateChannel(NAME, COVER_IMAGE_OR_URL, DATA, (OpenChannel openChannel, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

You can fetch the cover image URL using the CoverUrl property. You can also update a channel's cover image by calling UpdateChannel().


Add a custom channel type

When creating a channel, you can additionally specify a custom channel type for further channel grouping. This custom type takes on the form of a String, and can be handy in searching or filtering channels.

Note: The DATA and CUSTOM_TYPE are both String fields that allow you to append information to your channels. As mentioned above, a common use case is for the CUSTOM_TYPE to contain information for channel grouping (for example, categorizing School and Work channels). However, both these fields can be flexibly utilized.

Light Color Skin
Copy
GroupChannel.CreateChannel(NAME, COVER_IMAGE_OR_URL, DATA, CUSTOM_TYPE, (OpenChannel openChannel, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

The CustomType property contains the channel's custom type.


Add a custom message type

When sending a message, you can additionally specify a custom message type for further message grouping. This custom type takes on the form of a String, and can be useful in searching or filtering messages.

Note: The DATA and CUSTOM_TYPE are both String fields that allow you to append information to your messages. As mentioned above, a common use case is for the CUSTOM_TYPE to contain information for message grouping (for example, categorizing Notes and Contacts messages). However, both these fields can be flexibly utilized.

To embed a custom type into a message, pass a String value as a parameter to the channel.SendUserMessage() or channel.SendFileMessage().

Light Color Skin
Copy
groupChannel.SendUserMessage(MESSAGE, DATA, CUSTOM_TYPE, (UserMessage userMessage, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

The CustomType property contains the message's custom type.


Message auto-translation

It is possible for text messages to be sent in different languages through the SendBird's auto-translation feature. When sending a text message, pass in a List of language codes to the SendUserMessage() to request translated messages in the corresponding lguages.

Light Color Skin
Copy
List<string> targetLangs = new List<string>();
targetLangs.Add("es");
targetLangs.Add("ko");

openChannel.SendUserMessage(MESSAGE, DATA, CUSTOM_TYPE, targetLangs, (UserMessage userMessage, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

You can obtain translations of a message through the Translations property. This contains a Dictionary containing the language codes and translations.

Light Color Skin
Copy
SendBirdClient.ChannelHandler ch = new SendBirdClient.ChannelHandler();
ch.OnMessageReceived = (BaseChannel baseChannel, BaseMessage baseMessage) => {
    // Received a chat message.
    // ((UserMessage)baseMessage).Translations["es"];
    // ((UserMessage)baseMessage).Translations["ko"];
};
SendBirdClient.AddChannelHandler(UNIQUE_HANDLER_ID, ch);

Note: The message auto-translation supports 53 languages. For the language code table, see the Miscellaneous > Supported languages. As this is one of SendBird's premium features, please contact our sales team for further assistance.