Create Channel
You need to create a channel in order to chat.
targetId
can be retrieved by callinggetUserId
method provided byHiveTalkPlusUser
object- You can enter up to 5 key–value pairs in data field. The maximum allowed length of key is 128 characters and the maximum allowed length of value is 1024 characters.
- Supported channel types are follows: private, public, invitationOnly, broadcast, super_public and super_private.
- type field is required.
- For invitationOnly channel, invitationCode field is also required.
Type | Value | Can Join Channel | FCM Support |
---|---|---|---|
PRIVATE | private | X | O |
PUBLIC | public | O | O |
INVITATION ONLY | invitationOnly | O (need Invitation Code) | O |
BROADCAST | broadcast | O | O |
SUPER_PUBLIC | super_public | O | X |
SUPER_PRIVATE | super_private | O | X |
- For private channel, you can choose to reuse existing channel by setting
reuseChannel
parameter totrue
. This only works if channelId and targetIds match those of already existing channel that you wish to reuse. - Anyone who is not banned is allowed to join a public channel.
- Only users with valid invitationCode can join an invitationOnly channel.
- For broadcast channel:
- When the channel owner sends a message, the message is sent to all channel members.
- When a channel member other than the channel owner sends a message, the message is sent only to the channel owner.
- For super_private and super_public channel:
- You can set the maximum number of members above 100.
- Unlike other channel types that populate
members
andbannedUsers
fields, - super channels return empty
members
andbannedUsers
fields - FCM Push Notification is not supported
1 2 3 4 5 |
HiveTalkPlusApi.CreateChannel(targetId, channelId, reuseChannel, maxMemberCount, hideMessagesBeforeJoin, channelType, channelName, invitationCode, imageUrl, metaData, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.createChannel(targetIds, channelId, reuseChannel, maxMemberCount, hideMessagesBeforeJoin, channelType, channelName, invitationCode, imageUrl, metaData, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.createChannel(withUserIds: targetIds, channelId: channelId, reuseChannel: reuseChannel, maxMemberCount: maxMemberCount, hideMessagesBeforeJoin: hideMessagesBeforeJoin, channelType: channelType, channelName: channelName, invitationCode: invitationCode, imageUrl: imageUrl, metaData: metaData, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Viewing Channel
You can view any public channel or a channel you’ve joined by providing a matching channel ID.
1 2 3 4 5 |
HiveTalkPlusApi.GetChannel(channelId, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.getChannel(channelId, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getChannel(channelId, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Updating Channel
Channel owner can update channel information.
1 2 3 4 5 |
HiveTalkPlusApi.UpdateChannel(channel, maxMemberCount, hideMessagesBeforeJoin, channelName, invitationCode, imageUrl, metaData, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.updateChannel(channel, maxMemberCount, hideMessagesBeforeJoin, channelName, invitationCode, imageUrl, metaData, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.update(channel, maxMemberCount: maxMemberCount, hideMessagesBeforeJoin: hideMessagesBeforeJoin, channelName: channelName, invitationCode: invitationCode, imageUrl: imageUrl, metaData: metaData, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
View Channels List
1. View All Public Channels
You can view all public channels even if you are a not member.
The list is paginated so you can use the last HiveTalkPlusChannel
from the previous list to fetch the next page.
1 2 3 4 5 |
HiveTalkPlusApi.GetPublicChannelList(lastChannel, (List<HiveTalkPlusChannel> channels) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.getPublicChannelList(lastChannel, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusChannel?>?> { override fun onSuccess(channels: List<HiveTalkPlusChannel?>?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getPublicChannelList(lastChannel, success: { channels in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. View Joined Channels
You can view channels you’ve joined. The list is paginated so you can use the last HiveTalkPlusChannel
from the previous list to fetch the next page.
1 2 3 4 5 |
HiveTalkPlusApi.GetChannelList(lastChannel, (List<HiveTalkPlusChannel> channels) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.getChannelList(lastChannel, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusChannel?>?> { override fun onSuccess(channels: List<HiveTalkPlusChannel?>?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getChannelList(lastChannel, success: { channels in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
3. View Hidden Channels
You can retrieve a list of channels that were hidden when user called hideChannel
function.
1 2 3 4 5 |
HiveTalkPlusApi.GetHiddenChannelList(lastChannel, (List<HiveTalkPlusChannel> channels) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.getHiddenChannelList(lastChannel, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusChannel?>?> { override fun onSuccess(channels: List<HiveTalkPlusChannel?>?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getHiddenChannelList(lastChannel, success: { channels in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
4. Get Total Unread Message Count
You can view the total number of unread messages from joined channels.
1 2 3 4 5 |
HiveTalkPlusApi.GetTotalUnreadCount((int totalCount) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.getTotalUnreadCount(object : HiveTalkPlus.CallbackListener<Int?> { override fun onSuccess(integer: Int?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getTotalUnreadCount({ count in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
5. Mark All Channels As Read
You can mark as read all unread messages from joined channels.
1 2 3 4 5 |
HiveTalkPlusApi.SearchChannelList(lastChannel, channelName, memberIds, (List<HiveTalkPlusChannel> channels) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.searchChannelList(lastChannel, channelName, memberIds, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusChannel?>?> { override fun onSuccess(channels: List<HiveTalkPlusChannel?>?) {} override fun onFailure(errorCode: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.searchChannelList(lastChannel, channelName: channelName, membersIds: membersIds, success: { channels in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Manage Channel Members
1. Invite Users
You can invite users as channel members. Invitation feature is available to channel owner and members.
1 2 3 4 5 |
HiveTalkPlusApi.AddMemberToChannel(channel, targetIds, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.addMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.addMember(to: channel, userIds: userIds, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. Remove Members
As channel owner, you can remove members from a channel.
1 2 3 4 5 |
HiveTalkPlusApi.RemoveMemberToChannel(channel, targetIds, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.removeMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.removeMember(to: channel, userIds: userIds, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
3. Block Users
As channel owner, you can block users in your channel. Blocked users are immediately removed from the channel and cannot join the channel until you unblock them.
1 2 3 4 5 |
HiveTalkPlusApi.BanMemberToChannel(channel, targetIds, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.banMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.banMember(to: channel, userIds: userIds, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
4. Unblock Users
As channel owner, you can unblock users who had been blocked from your channel.
1 2 3 4 5 |
HiveTalkPlusApi.UnBanMemberToChannel(channel, targetIds, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.unBanMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.unBanMember(to: channel, userId: userId, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
5. Mute Members
Mute feature allows you to mute specific members in your channel. Muted members are not allowed to send messages. This feature is available only to the channel owner.
1 2 3 4 5 |
HiveTalkPlusApi.MuteMemberToChannel(channel, targetId, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.muteMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.muteMember(to: channel, userIds: userIds, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
6. Unmute Members
Remove mute state from specific members. This feature is available only to the channel owner.
1 2 3 4 5 |
HiveTalkPlusApi.UnMuteMemberToChannel(channel, targetId, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.unMuteMemberToChannel(channel, targetIds, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.unMuteMember(to: channel, userIds: userIds, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Join / Leave Channel
1. Join Channel
Anyone can join a public channel even without invitation from the owner.
1 2 3 4 5 |
HiveTalkPlusApi.JoinChannel(channelId, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.joinChannel(channelId, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.joinChannel(channelId, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. Join InvitationOnly Channel
In order to join an invitationOnly channel, you need to know the channel’s invitation code.
1 2 3 4 5 |
HiveTalkPlusApi.JoinChannel(channelId, invitationCode, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.joinChannel(channelId, invitationCode, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.joinChannel(channelId, invitationCode: invitationCode, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
3. Leave Channel
If you are the last remaining channel member and you set deleteChannelIfEmpty
parameter to true
when leaving the channel, the channel will be deleted as soon as you leave.
1 2 3 4 5 |
HiveTalkPlusApi.LeaveChannel(channel, deleteChannelIfEmpty, () => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.leaveChannel(channel, deleteChannelIfEmpty, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.leave(channel, deleteChannelIfEmpty: deleteChannelIfEmpty, success: { // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Messaging
1. View Messages
You can view messages from a channel ordered by the most recent sent date.
1 2 3 4 5 |
HiveTalkPlusApi.GetMessageList(channel, lastMessage, (List<HiveTalkPlusMessage> messages) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.getMessageList(channel, lastMessage, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusMessage?>?> { override fun onSuccess(messages: List<HiveTalkPlusMessage?>?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getMessageList(channel, last: lastMessage, success: { messages in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. View Only Messages With File Attachment
You can messages with file attachment from a channel ordered by the most recent sent date.
1 2 3 4 5 |
HiveTalkPlusApi.GetFileMessageList(channel, lastMessage, (List<HiveTalkPlusMessage> messages) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 |
HiveTalkPlus.getFileMessageList(channel, lastMessage, object : HiveTalkPlus.CallbackListener<List<HiveTalkPlusMessage?>?> { override fun onSuccess(messages: List<HiveTalkPlusMessage?>?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.getFileMessageList(channel: channel, last: lastMessage, success:{ messages in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
3. Send Message
You can send a message in a channel. The following message types are supported: text, hidden, custom and admin.
- Push notification is not sent for hidden message type.
- admin message type can only be sent from TalkPlus dashboard or by calling REST API.
- You can enter up to 5 key–value pairs in data field. The maximum allowed length of key is 128 characters and the maximum allowed length of value is 1024 characters.
- Both message text and data cannot be empty when sending a message.
- The maximum allowed length of message text is 8192 characters.
Type | Value |
---|---|
TEXT | TYPE_TEXT |
HIDDEN | TYPE_HIDDEN |
CUSTOM | TYPE_CUSTOM |
ADMIN | TYPE_ADMIN |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Send message HiveTalkPlusApi.SendMessage(channel, text, type, metaData, (HiveTalkPlusMessage message) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); // Upload file HiveTalkPlusApi.SendFileMessage(channel, text, type, metaData, filePath, (HiveTalkPlusMessage message) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Send message HiveTalkPlus.sendMessage(channel, text, type, metaData, object : HiveTalkPlus.CallbackListener<HiveTalkPlusMessage?> { override fun onSuccess(message: HiveTalkPlusMessage?) {} override fun onFailure(i: Int, e: Exception?) {} }) // Upload file HiveTalkPlus.sendFileMessage(channel, text, type, metaData, file, object : HiveTalkPlus.CallbackListener<HiveTalkPlusMessage?> { override fun onSuccess(message: HiveTalkPlusMessage?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus..sendFileMessage(channel, text: text, type: type, metaData: metaData, filePath: filePath, success: { message in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
4. Mark As Read
You can mark a channel as read. (You need to call this when appropriate if you want to use unread message count feature)
1 2 3 4 5 |
HiveTalkPlusApi.MarkAsReadChannel(channel, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.markAsReadChannel(channel, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.mark(asRead: channel, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
5. Get Unread Message Count
You can find out how many members have not read a particular message.
1 |
channel.GetMessageUnreadCount(message); |
1 |
channel.getMessageUnreadCount(message); |
1 |
channel.getMessageUnreadCount(message); |
Hide / Show Channel
1. Hide Channel
You can hide a channel so that it does not appear in the list of currently joined channels.
1 2 3 4 5 |
HiveTalkPlusApi.HideChannel(channelId, () => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.hideChannel(channelId, object : HiveTalkPlus.CallbackListener<Unit?> { override fun onSuccess(unit: Unit?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.hideChannel(channelId, success: { // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. Show Channel
You can unhide a channel so that it appears in the list of currently joined channels.
1 2 3 4 5 |
HiveTalkPlusApi.ShowChannel(channelId, () => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.showChannel(channelId, object : HiveTalkPlus.CallbackListener<Unit?> { override fun onSuccess(unit: Unit?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.showChannel(channelId, success: { // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Freeze / Unfreeze Channel
1. Freeze Channel
Freezing a channel stops all channel members (with the exception of channel owner) from sending messages.
1 2 3 4 5 |
HiveTalkPlusApi.FreezeChannel(channelId, () => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.freezeChannel(channelId, object : HiveTalkPlus.CallbackListener<Unit?> { override fun onSuccess(unit: Unit?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.freezeChannel(channelId, success: { // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
2. Unfreeze Channel
Unfreeze a channel so that all channel members can send messages.
1 2 3 4 5 |
HiveTalkPlusApi.UnfreezeChannel(channelId, () => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.unfreezeChannel(channelId, object : HiveTalkPlus.CallbackListener<Unit?> { override fun onSuccess(unit: Unit?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.unfreezeChannel(channelId, success: { // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Transfer Channel Ownership
Channel owners can transfer channel ownership to another channel member.
1 2 3 4 5 |
HiveTalkPlusApi.TransferOwnership(channel, targetUserId, (HiveTalkPlusChannel channel) => { // SUCCESS }, (int statusCode, Exception e) => { // FAILURE }); |
1 2 3 4 |
HiveTalkPlus.transferChannelOwnership(channel, targetUserId, object : HiveTalkPlus.CallbackListener<HiveTalkPlusChannel?> { override fun onSuccess(channel: HiveTalkPlusChannel?) {} override fun onFailure(i: Int, e: Exception?) {} }) |
1 2 3 4 5 |
HiveTalkPlus.transferOwnership(channel, targetUserId: targetUserId, success: { channel in // SUCCESS }, failure: { errorCode, error in // FAILURE }) |
Event
You can handle events as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
HiveTalkPlusApi.OnMemberAdded += (sender, args) => { // when new member has joined a channel that I’m a member of }; HiveTalkPlusApi.OnMemberLeft += (sender, args) => { // when member leaves channel that I’m a member of }; HiveTalkPlusApi.OnMessageReceived += (sender, args) => { // when message is received in channel that I’m a member of }; HiveTalkPlusApi.OnChannelAdded += (sender, args) => { // when channel is created and I’m a member of that channel }; HiveTalkPlusApi.OnChannelChanged += (sender, args) => { // when a channel that I’m a member of is updated }; HiveTalkPlusApi.OnChannelRemoved += (sender, args) => { // when a channel that I’m a member of is deleted }; HiveTalkPlusApi.OnPublicMemberAdded += (sender, args) => { // Callback when new member has joined puclic channel that I’m a member of }; HiveTalkPlusApi.OnPublicMemberLeft += (sender, args) => { // Callback when member leaves public channel that I’m a member of }; HiveTalkPlusApi.OnPublicChannelAdded += (sender, args) => { // Callback when puclic channel is created and I’m a member of that channel }; HiveTalkPlusApi.OnPublicChannelChanged += (sender, args) => { // Callback when public channel that I’m a member of is updated }; HiveTalkPlusApi.OnPublicChannelRemoved += (sender, args) => { // when a channel that I’m a member of is deleted }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
HiveTalkPlus.addChannelListener(tag, object : HiveTalkPlus.ChannelListener() { override fun onMemberAdded(channel: HiveTalkPlusChannel?, users: List<HiveTalkPlusUser>?) { // when new member has joined a channel that I’m a member of } override fun onMemberLeft(channel: HiveTalkPlusChannel?, users: List<HiveTalkPlusUser>?) { // when member leaves channel that I’m a member of } override fun onMessageReceived(channel: HiveTalkPlusChannel?, message: HiveTalkPlusMessage?) { // when message is received in channel that I’m a member of } override fun onChannelAdded(channel: HiveTalkPlusChannel?) { // when channel is created and I’m a member of that channel } override fun onChannelChanged(channel: HiveTalkPlusChannel?) { // when a channel that I’m a member of is updated } override fun onChannelRemoved(channel: HiveTalkPlusChannel?) { // when a channel that I’m a member of is deleted } override fun onPublicMemberAdded(channel: HiveTalkPlusChannel?, users: List<HiveTalkPlusUser>?) { // Callback when new member has joined puclic channel that I’m a member of } override fun onPublicMemberLeft(channel: HiveTalkPlusChannel?, users: List<HiveTalkPlusUser>?) { // Callback when member leaves public channel that I’m a member of } override fun onPublicChannelAdded(channel: HiveTalkPlusChannel?) { // Callback when puclic channel is created and I’m a member of that channel } override fun onPublicChannelChanged(channel: HiveTalkPlusChannel?) { // Callback when public channel that I’m a member of is updated } override fun onPublicChannelRemoved(channel: HiveTalkPlusChannel?) { // when public channel that I’m a member of is deleted } }) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
// Class instance that implements YOUR_CLASS_INSTANCE : HiveTalkPlusChannelDelegate HiveTalkPlus.add(YOUR_CLASS_INSTANCE, tag: tag) func memberAdded(_ channel: HiveTalkPlusChannel!, users: [HiveTalkPlusUser]!) { // Callback when new member has joined a channel that I’m a member of } func memberLeft(_ channel: HiveTalkPlusChannel!, users: [HiveTalkPlusUser]!) { // Callback when member leaves channel that I’m a member of } func messageReceived(_ channel: HiveTalkPlusChannel!, message: HiveTalkPlusMessage!) { // Callback when message is received in channel that I’m a member of } func channelAdded(_ channel: HiveTalkPlusChannel!) { // Callback when channel is created and I’m a member of that channel } func channelChanged(_ channel: HiveTalkPlusChannel!) { // Callback when a channel that I’m a member of is updated } func channelRemoved(_ channel: HiveTalkPlusChannel!) { // Callback when a channel that I’m a member of is deleted } func publicMemberAdded(_ channel: HiveTalkPlusChannel!, users: [HiveTalkPlusUser]!) { // Callback when new member has joined puclic channel that I’m a member of } func publicMemberLeft(_ channel: HiveTalkPlusChannel!, users: [HiveTalkPlusUser]!) { // Callback when member leaves public channel that I’m a member of } func publicChannelAdded(_ channel: HiveTalkPlusChannel!) { // Callback when puclic channel is created and I’m a member of that channel } func publicChannelChanged(_ channel: HiveTalkPlusChannel!) { // Callback when public channel that I’m a member of is updated } func publicChannelRemoved(_ channel: HiveTalkPlusChannel!) { // Callback when public channel that I’m a member of is deleted } |