Class IRtmClientAbstract

The IRtmClient class.

This class provides the main methods that can be invoked by your app.

IRtmClient is the basic interface class of the Agora RTM SDK. Creating an IRtmClient object and then calling the methods of this object enables you to use Agora RTM SDK's functionality.

Hierarchy

  • IRtmClient

Constructors

Methods

  • Login the Agora RTM service. The operation result will be notified by \ref agora::rtm::IRtmEventHandler::onLoginResult callback.

    Parameters

    • token: string

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Logout the Agora RTM service. Be noticed that this method will break the rtm service including storage/lock/presence.

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Publish a message in the channel.

    Parameters

    • channelName: string
    • message: any
    • length: number
    • option: PublishOptions

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Renews the token. Once a token is enabled and used, it expires after a certain period of time. You should generate a new token on your server, call this method to renew it.

    Parameters

    • token: string

    Returns number

  • Set parameters of the sdk or engine

    Parameters

    • parameters: string

    Returns number

    • 0: Success.
    • < 0: Failure.
  • Unsubscribe a channel.

    Parameters

    • channelName: string

    Returns number

    • 0: Success.
    • < 0: Failure.