Agora RTC Objective-C API Reference Refactor

Instance Methods
AgoraRtmStreamChannel Class Reference

Inherits <NSObject>.

## Instance Methods
(int) | - joinWithOption:
(int) | - leave
(NSString *_Nonnull) | - getChannelName
(int) | - joinTopic:withOption:
(int) | - publishMessage:inTopic:
(int) | - leaveTopic:
(int) | - subscribeTopic:withOption:
(int) | - unsubscribeTopic:withOption:
(int) | - destroy

## Method Documentation

## ◆ joinWithOption:

- (int) joinWithOption: |  | (AgoraRtmJoinChannelOption *_Nonnull) | option |

join the channel.

Parameters

  [in] | option | join channel options.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ leave

- (int) leave |  |  |

leave the channel.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ getChannelName

- (NSString * _Nonnull) getChannelName |  |  |

return the channel name of this stream channel.

Returns
  The channel name.

## ◆ joinTopic:withOption:

- (int) joinTopic: |  | (NSString *_Nonnull) | topic
withOption: |  | (AgoraRtmJoinTopicOption *_Nullable) | option

join a topic.

Parameters

  [in] | topic | The name of the topic.
  [in] | option | The options of create a topic.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ publishMessage:inTopic:

- (int) publishMessage: |  | (NSData *_Nonnull) | message
inTopic: |  | (NSString *_Nonnull) | topic

publish a message in the topic.

Parameters

  [in] | topic | The name of the topic.
  [in] | message | The content of the message.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ leaveTopic:

- (int) leaveTopic: |  | (NSString *_Nonnull) | topic |

leave the topic.

Parameters

  [in] | topic | The name of the topic.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ subscribeTopic:withOption:

- (int) subscribeTopic: |  | (NSString *_Nonnull) | topic
withOption: |  | (AgoraRtmTopicOption *_Nullable) | option

unsubscribe a topic.

Parameters

  [in] | topic | The name of the topic.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ unsubscribeTopic:withOption:

- (int) unsubscribeTopic: |  | (NSString *_Nonnull) | topic
withOption: |  | (AgoraRtmTopicOption *_Nullable) | option

unsubscribe a topic.

Parameters

  [in] | topic | The name of the topic.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ getSubscribedUserList:inTopic:

- (int) getSubscribedUserList: |  | (NSMutableArray< NSString * > *_Nonnull) | users
inTopic: |  | (NSString *_Nonnull) | topic

## ◆ destroy

- (int) destroy |  |  |

release the stream channel instance.

Returns
  - 0: Success.
  - < 0: Failure.