Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtm.StreamChannel Class Referenceabstract

Public Member Functions

abstract RtmErrorCode release ()
 
abstract void join (JoinChannelOptions options, ResultCallback< Void > resultCallback)
 
abstract void renewToken (String token, ResultCallback< Void > resultCallback)
 
abstract void leave (ResultCallback< Void > resultCallback)
 
abstract String getChannelName ()
 
abstract void joinTopic (String topicName, JoinTopicOptions options, ResultCallback< Void > resultCallback)
 
abstract void publishTopicMessage (String topicName, byte[] message, TopicMessageOptions options, ResultCallback< Void > resultCallback)
 
abstract void publishTopicMessage (String topicName, String message, TopicMessageOptions options, ResultCallback< Void > resultCallback)
 
abstract void leaveTopic (String topicName, ResultCallback< Void > resultCallback)
 
abstract void subscribeTopic (String topicName, TopicOptions options, ResultCallback< SubscribeTopicResult > resultCallback)
 
abstract void unsubscribeTopic (String topicName, TopicOptions options, ResultCallback< Void > resultCallback)
 
abstract void getSubscribedUserList (String topicName, ResultCallback< ArrayList< String >> resultCallback)
 

Detailed Description

The StreamChannel class.

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

Member Function Documentation

◆ release()

abstract RtmErrorCode io.agora.rtm.StreamChannel.release ( )
abstract

Release the stream channel instance.

Returns
RtmErrorCode

◆ join()

abstract void io.agora.rtm.StreamChannel.join ( JoinChannelOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Join the channel.

Parameters
optionsjoin channel options.
resultCallbackA ResultCallback object.

◆ renewToken()

abstract void io.agora.rtm.StreamChannel.renewToken ( String  token,
ResultCallback< Void >  resultCallback 
)
abstract

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
tokenToken used renew.
resultCallbackA ResultCallback object.

◆ leave()

abstract void io.agora.rtm.StreamChannel.leave ( ResultCallback< Void >  resultCallback)
abstract

Leave the channel.

Parameters
resultCallbackA ResultCallback object.

◆ getChannelName()

abstract String io.agora.rtm.StreamChannel.getChannelName ( )
abstract

Return the channel name of this stream channel.

Returns
The channel name.

◆ joinTopic()

abstract void io.agora.rtm.StreamChannel.joinTopic ( String  topicName,
JoinTopicOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Join a topic.

Parameters
topicNameThe name of the topic.
optionsThe options of the topic.
resultCallbackA ResultCallback object.

◆ publishTopicMessage() [1/2]

abstract void io.agora.rtm.StreamChannel.publishTopicMessage ( String  topicName,
byte[]  message,
TopicMessageOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Publish a binary message in the topic.

Parameters
topicNameThe name of the topic.
messageThe content of the message.
optionsThe options of the message.
resultCallbackA ResultCallback object.

◆ publishTopicMessage() [2/2]

abstract void io.agora.rtm.StreamChannel.publishTopicMessage ( String  topicName,
String  message,
TopicMessageOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Publish a string message in the topic.

Parameters
topicNameThe name of the topic.
messageThe content of the message.
optionsThe options of the message.
resultCallbackA ResultCallback object.

◆ leaveTopic()

abstract void io.agora.rtm.StreamChannel.leaveTopic ( String  topicName,
ResultCallback< Void >  resultCallback 
)
abstract

Leave the topic.

Parameters
topicNameThe name of the topic.
resultCallbackA ResultCallback object.

◆ subscribeTopic()

abstract void io.agora.rtm.StreamChannel.subscribeTopic ( String  topicName,
TopicOptions  options,
ResultCallback< SubscribeTopicResult resultCallback 
)
abstract

Subscribe a topic.

Parameters
topicNameThe name of the topic.
optionsThe options of subscribe the topic.
resultCallbackA ResultCallback object.

◆ unsubscribeTopic()

abstract void io.agora.rtm.StreamChannel.unsubscribeTopic ( String  topicName,
TopicOptions  options,
ResultCallback< Void >  resultCallback 
)
abstract

Unsubscribe a topic.

Parameters
topicNameThe name of the topic.
optionsThe options of unsubscribe the topic.
resultCallbackA ResultCallback object.

◆ getSubscribedUserList()

abstract void io.agora.rtm.StreamChannel.getSubscribedUserList ( String  topicName,
ResultCallback< ArrayList< String >>  resultCallback 
)
abstract

Get subscribed user list

Parameters
topicNameThe name of the topic.
resultCallbackA ResultCallback object.