Agora C++ API Reference for All Platforms

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

## Public Member Functions
virtual | ~IRtmServiceEventHandler ()
virtual void | onLoginSuccess ()
virtual void | onLoginFailure (LOGIN_ERR_CODE errorCode)
virtual void | onLogout ()
virtual void | onConnectionStateChanged (CONNECTION_STATE state)
virtual void | onSendMessageState (int64_t messageId, PEER_MESSAGE_STATE state)
virtual void | onMessageReceivedFromPeer (const char *peerId, const IMessage *message)

## Detailed Description

The IRtmServiceEventHandler class.

## Constructor & Destructor Documentation

## ◆ ~IRtmServiceEventHandler()

virtual agora::rtm::IRtmServiceEventHandler::~IRtmServiceEventHandler | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onLoginSuccess()

virtual void agora::rtm::IRtmServiceEventHandler::onLoginSuccess | ( |  | ) |
| inline virtual

Occurs when the user successfully logs in the RTM service.

## ◆ onLoginFailure()

virtual void agora::rtm::IRtmServiceEventHandler::onLoginFailure | ( | LOGIN_ERR_CODE | errorCode | ) |
| inline virtual

Occurs when the user fails to log in the RTM service.

Parameters

  errorCode | The reason for the login failure: LOGIN_ERR_CODE.

## ◆ onLogout()

virtual void agora::rtm::IRtmServiceEventHandler::onLogout | ( |  | ) |
| inline virtual

Occurs when the user successfully logs out of the RTM service.

## ◆ onConnectionStateChanged()

virtual void agora::rtm::IRtmServiceEventHandler::onConnectionStateChanged | ( | CONNECTION_STATE | state | ) |
| inline virtual

Occurs when the connection state of the local user has changed.

Parameters

  state | The current connection state: CONNECTION_STATE.

## ◆ onSendMessageState()

virtual void agora::rtm::IRtmServiceEventHandler::onSendMessageState | ( | int64_t | messageId,
|  | PEER_MESSAGE_STATE | state
| ) |  |
| inline virtual

Reports the state of sending a message.

Parameters

  messageId | ID of the message.
  state | The current state of the message: PEER_MESSAGE_STATE.

## ◆ onMessageReceivedFromPeer()

virtual void agora::rtm::IRtmServiceEventHandler::onMessageReceivedFromPeer | ( | const char * | peerId,
|  | const IMessage * | message
| ) |  |
| inline virtual

Occurs when the local user receives a message from a remote user.

Parameters

  peerId | ID of the remote user that sends the message.
  message | The pointer to the message: IMessage.