Agora Java API Reference for Android

Public Member Functions | List of all members
agora::rtm::IChannelEventHandler Class Reference

`#include <IAgoraRtmService.h>`

## Public Member Functions
virtual void | onJoinSuccess ()
virtual void | onJoinFailure (JOIN_CHANNEL_ERR errorCode)
virtual void | onLeave (LEAVE_CHANNEL_ERR errorCode)
virtual void | onMessageReceived (const char *userId, const IMessage *message)
virtual void | onSendMessageState (int64_t messageId, CHANNEL_MESSAGE_STATE state)
virtual void | onSendMessageResult (long long messageId, CHANNEL_MESSAGE_ERR_CODE state)
virtual void | onMemberJoined (IChannelMember *member)
virtual void | onMemberLeft (IChannelMember *member)
virtual void | onMembersGotten (IChannelMember **members, int userCount)
virtual void | onAttributesUpdated (const IChannelAttributes *attributes)
virtual void | onUpdateAttributesResponse (int64_t requestId, RESPONSE_CODE resCode)
virtual void | onAttributesDeleted (const IChannelAttributes *attributes)
virtual void | onDeleteAttributesResponse (int64_t requestId, RESPONSE_CODE resCode)

## Detailed Description

The IChannelEventHandler class.

## Member Function Documentation

## ◆ onJoinSuccess()

virtual void agora::rtm::IChannelEventHandler::onJoinSuccess | ( |  | ) |
| virtual

Occurs when the local user successfully joins a channel.

## ◆ onJoinFailure()

virtual void agora::rtm::IChannelEventHandler::onJoinFailure | ( | JOIN_CHANNEL_ERR | errorCode | ) |
| virtual

Occurs when the local user fails to join a channel.

Parameters

  errorCode | The error code: #JOIN_CHANNEL_ERR.

## ◆ onLeave()

virtual void agora::rtm::IChannelEventHandler::onLeave | ( | LEAVE_CHANNEL_ERR | errorCode | ) |
| virtual

Occurs when the local user leaves a channel.

Parameters

  errorCode | The error code. See #LEAVE_CHANNEL_ERR.

## ◆ onMessageReceived()

virtual void agora::rtm::IChannelEventHandler::onMessageReceived | ( | const char * | userId,
|  | const IMessage * | message
| ) |  |
| virtual

Occurs when the local user receives a channel message.

Parameters

  message | The pointer to the messsage: IMessage.

## ◆ onSendMessageState()

virtual void agora::rtm::IChannelEventHandler::onSendMessageState | ( | int64_t | messageId,
|  | CHANNEL_MESSAGE_STATE | state
| ) |  |
| virtual

Reports the state of the message sent by the local user.

Parameters

  messageId | ID of the message.
  state | The state of the message: #CHANNEL_MESSAGE_STATE.

## ◆ onSendMessageResult()

virtual void agora::rtm::IChannelEventHandler::onSendMessageResult | ( | long long | messageId,
|  | CHANNEL_MESSAGE_ERR_CODE | state
| ) |  |
| virtual

Returns the result of the sendMessage method call.

Parameters

  messageId | The ID of the sent channel message.
  state | The error codes. See #CHANNEL_MESSAGE_ERR_CODE.

## ◆ onMemberJoined()

virtual void agora::rtm::IChannelEventHandler::onMemberJoined | ( | IChannelMember * | member | ) |
| virtual

Occurs when another member joins the channel.

Parameters

  member | The pointer to the member who joins the channel: IChannelMember.

## ◆ onMemberLeft()

virtual void agora::rtm::IChannelEventHandler::onMemberLeft | ( | IChannelMember * | member | ) |
| virtual

Occurs when the other member leaves the channel.

Parameters

  member | The pointer to the member who leaves the channel: IChannelMember.

## ◆ onMembersGotten()

virtual void agora::rtm::IChannelEventHandler::onMembersGotten | ( | IChannelMember ** | members,
|  | int | userCount
| ) |  |
| virtual

Reports all the members in the channel.

Parameters

  members | The pointer to each member in the channel: IChannelMember.
  userCount | The number of users in the channel.

## ◆ onAttributesUpdated()

virtual void agora::rtm::IChannelEventHandler::onAttributesUpdated | ( | const IChannelAttributes * | attributes | ) |
| virtual

Occurs when the channel attributes are updated.

Parameters

  attributes | The pointer to the current channel attributes: IChannelAttributes.

## ◆ onUpdateAttributesResponse()

virtual void agora::rtm::IChannelEventHandler::onUpdateAttributesResponse | ( | int64_t | requestId,
|  | RESPONSE_CODE | resCode
| ) |  |
| virtual

Occurs when the local user calls updateAttributes().

Parameters

  requestId | ID of the current attribute update request.
  resCode | The response code: #RESPONSE_CODE.

## ◆ onAttributesDeleted()

virtual void agora::rtm::IChannelEventHandler::onAttributesDeleted | ( | const IChannelAttributes * | attributes | ) |
| virtual

Occurs when the channel attributes are deleted.

Parameters

  attributes | The pointer to the channel attributes that you want to remove: IChannelAttributes.

## ◆ onDeleteAttributesResponse()

virtual void agora::rtm::IChannelEventHandler::onDeleteAttributesResponse | ( | int64_t | requestId,
|  | RESPONSE_CODE | resCode
| ) |  |
| virtual

Occurs when the local user calls deleteAttributes().

Parameters

  requestId | ID of the current attribute delete request.
  resCode | The response code: #RESPONSE_CODE.