Channel Participation

All participation related methods in a channel fall under a separate AmityChannelParticipation class. Before calling any participation methods, you must ensure to first instantiate a repository instance using the AmityClient instance you created on setup and a valid channelId:

Members Query

The participation membership provides a list of all members in the given channel as a LiveObject.

Manage Members

The participation membership also provides classes to add and remove members, as well as removing yourself as a member of the channel (leaving the channel).

Note:

  1. The channel creator is automatically assigned as the channel moderator.

  2. The previous/last moderator is not allowed to leave a community and an error is displayed.

  3. The channel moderator can promote a user/member to moderator.

  4. The channel moderator can demote a moderator to a user/member.

This applies only to Live and Community channels’. This does not apply to Conversation Channel.

Reading Status And Unread Count

The AmityChannelRepository object exposes a totalUnreadCount property that reflects the number of messages that the current user has yet to read. This count is the sum of all the unreadCount channels properties where the user is already a member.

The startReading() and stopReading() methods let the server know that the current user is reading a channel. After the startReading()and stopReading() methods are called, the unreadCount is reset to 0.

You can call both methods as many times as you require. The SDK takes care of multiple device management: thus, a user can read multiple channels from one or more devices simultaneously. In case of an abrupt disconnection (be it the app has been terminated or the internet is down, etc.), the SDK backend automatically calls the stopReading() method for the user.

Moderation

AmityChannelModeration class provides various methods to moderate the users present in any given channel. You can ban/unban/mute users, assign or remove roles from users.

Note:

  1. The channel creator is automatically assigned as the channel moderator.

  2. The previous/last moderator is not allowed to leave a community and an error is displayed.

  3. The channel moderator can promote/demote a user/member to moderator and vice versa.

This applies only to Live and Community channels’. This does not apply to Conversation Channel.

Permission

You can check your permission in channel using hasPermission(permission:forChannel:_:) method from AmityClient.

Last updated