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

Public Member Functions

abstract int release ()
 
abstract int join (JoinChannelOptions options)
 
abstract int leave ()
 
abstract String getChannelName ()
 
abstract int joinTopic (String topicName, JoinTopicOptions options)
 
abstract int publishTopicMessage (String topicName, byte[] message)
 
abstract int leaveTopic (String topicName)
 
abstract int subscribeTopic (String topicName, TopicOptions options)
 
abstract int unsubscribeTopic (String topicName, TopicOptions options)
 
abstract int getSubscribedUserList (String topicName, UserList users)
 

Detailed Description

The StreamChannel class.

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

Member Function Documentation

◆ release()

abstract int io.agora.rtm2.StreamChannel.release ( )
abstract

Release the stream channel instance.

Returns
  • 0: Success.
  • < 0: Failure.

◆ join()

abstract int io.agora.rtm2.StreamChannel.join ( JoinChannelOptions  options)
abstract

Join the channel.

Parameters
[in]optionsjoin channel options.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leave()

abstract int io.agora.rtm2.StreamChannel.leave ( )
abstract

Leave the channel.

Returns
  • 0: Success.
  • < 0: Failure.

◆ getChannelName()

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

Return the channel name of this stream channel.

Returns
The channel name.

◆ joinTopic()

abstract int io.agora.rtm2.StreamChannel.joinTopic ( String  topicName,
JoinTopicOptions  options 
)
abstract

Join a topic.

Parameters
[in]topicNameThe name of the topic.
[in]optionsThe options of join a topic.
Returns
  • 0: Success.
  • < 0: Failure.

◆ publishTopicMessage()

abstract int io.agora.rtm2.StreamChannel.publishTopicMessage ( String  topicName,
byte[]  message 
)
abstract

Publish a message in the topic.

Parameters
[in]topicNameThe name of the topic.
[in]messageThe content of the message.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveTopic()

abstract int io.agora.rtm2.StreamChannel.leaveTopic ( String  topicName)
abstract

Leave the topic.

Parameters
[in]topicNameThe name of the topic.
Returns
  • 0: Success.
  • < 0: Failure.

◆ subscribeTopic()

abstract int io.agora.rtm2.StreamChannel.subscribeTopic ( String  topicName,
TopicOptions  options 
)
abstract

Subscribe a topic.

Parameters
[in]topicNameThe name of the topic.
[in]optionsThe options of subscribe the topic.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unsubscribeTopic()

abstract int io.agora.rtm2.StreamChannel.unsubscribeTopic ( String  topicName,
TopicOptions  options 
)
abstract

Unsubscribe a topic.

Parameters
[in]topicNameThe name of the topic.
[in]optionsThe options of unsubscribe the topic.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getSubscribedUserList()

abstract int io.agora.rtm2.StreamChannel.getSubscribedUserList ( String  topicName,
UserList  users 
)
abstract

Get subscribed user list

Parameters
[in]topicNameThe name of the topic.
[out]usersThe list of subscribed users.
Returns
  • 0: Success.
  • < 0: Failure.