Abstract
Adds one IRtmClientEvent listener. After calling this method, you can listen for the corresponding events in the IRtcEngine object and obtain data through IRtmClientEvent. Depending on your project needs, you can add multiple listeners for the same event.
The name of the target event to listen for. See IRtmClientEvent.
The callback function for eventType. Take adding a listener for onTopicEvent as an example: // Create an onTopicEvent object const onTopicEvent = (connection: RtcConnection, elapsed: number) => {}; // Add one onTopicEvent listener engine.addEventListener('onTopicEvent', onTopicEvent);
Abstract
createCreate a stream channel instance.
Abstract
getAbstract
getGet the presence instance.
Abstract
getGet the storage instance.
Abstract
initializeInitializes the rtm client instance.
Abstract
loginAbstract
logoutAbstract
publishPublish a message in the channel.
Optional
requestId: numberAbstract
publishOptional
requestId: numberAbstract
releaseRemoves all listeners for the specified event.
Optional
eventType: EventTypeThe name of the target event to listen for. See IRtmClientEvent.
Removes the specified IRtmClientEvent listener. For listened events, if you no longer need to receive the callback message, you can call this method to remove the corresponding listener.
The name of the target event to listen for. See IRtmClientEvent.
Optional
listener: IRtmEventHandler[EventType]The callback function for eventType. Must pass in the same function object in addEventListener . Take removing the listener for onTopicEvent as an example: // Create an onTopicEvent object const onTopicEvent = (connection: RtcConnection, elapsed: number) => {}; // Add one onTopicEvent listener engine.addEventListener('onTopicEvent', onTopicEvent); // Remove the onTopicEvent listener engine.removeEventListener('onTopicEvent', onTopicEvent);
Abstract
renewAbstract
setAbstract
subscribeSubscribe a channel.
Optional
requestId: numberAbstract
unsubscribe
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.