Agora RTC Objective-C API Reference Refactor

Public Member Functions
IChannelEventHandler Class Reference

## 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.

## Constructor & Destructor Documentation

## ◆ ~IChannelEventHandler()

virtual ~IChannelEventHandler | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onJoinSuccess()

virtual void onJoinSuccess | ( |  | ) |
| inline virtual

Occurs when the local user successfully joins a channel.

## ◆ onJoinFailure()

virtual void onJoinFailure | ( | JOIN_CHANNEL_ERR | errorCode | ) |
| inline virtual

Occurs when the local user fails to join a channel.

Parameters

  errorCode | The error code: JOIN_CHANNEL_ERR.

## ◆ onLeave()

virtual void onLeave | ( | LEAVE_CHANNEL_ERR | errorCode | ) |
| inline virtual

Occurs when the local user leaves a channel.

Parameters

  errorCode | The error code. See LEAVE_CHANNEL_ERR.

## ◆ onMessageReceived()

virtual void onMessageReceived | ( | const char * | userId,
|  | const IMessage * | message
| ) |  |
| inline virtual

Occurs when the local user receives a channel message.

Parameters

  message | The pointer to the messsage: IMessage.

## ◆ onSendMessageState()

virtual void onSendMessageState | ( | int64_t | messageId,
|  | CHANNEL_MESSAGE_STATE | state
| ) |  |
| inline 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 onSendMessageResult | ( | long long | messageId,
|  | CHANNEL_MESSAGE_ERR_CODE | state
| ) |  |
| inline 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 onMemberJoined | ( | IChannelMember * | member | ) |
| inline virtual

Occurs when another member joins the channel.

Parameters

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

## ◆ onMemberLeft()

virtual void onMemberLeft | ( | IChannelMember * | member | ) |
| inline virtual

Occurs when the other member leaves the channel.

Parameters

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

## ◆ onMembersGotten()

virtual void onMembersGotten | ( | IChannelMember ** | members,
|  | int | userCount
| ) |  |
| inline 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 onAttributesUpdated | ( | const IChannelAttributes * | attributes | ) |
| inline virtual

Occurs when the channel attributes are updated.

Parameters

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

## ◆ onUpdateAttributesResponse()

virtual void onUpdateAttributesResponse | ( | int64_t | requestId,
|  | RESPONSE_CODE | resCode
| ) |  |
| inline 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 onAttributesDeleted | ( | const IChannelAttributes * | attributes | ) |
| inline 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 onDeleteAttributesResponse | ( | int64_t | requestId,
|  | RESPONSE_CODE | resCode
| ) |  |
| inline virtual

Occurs when the local user calls deleteAttributes().

Parameters

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