Agora RTC Objective-C API Reference  Refactor
Instance Methods
AgoraRtcEngineKit(Ex) Category Reference

Instance Methods

(int) - joinChannelExByToken:connection:delegate:mediaOptions:joinSuccess:
 
(int) - joinChannelExByToken:channelId:userAccount:delegate:mediaOptions:joinSuccess:
 
(int) - updateChannelExWithMediaOptions:connection:
 
(int) - muteRemoteAudioStreamEx:mute:connection:
 
(int) - setVideoEncoderConfigurationEx:connection:
 
(int) - setupRemoteVideoEx:connection:
 
(int) - setRemoteRenderModeEx:mode:mirror:connection:
 
(int) - muteRemoteVideoStreamEx:mute:connection:
 
(int) - enableDualStreamModeEx:enabled:streamConfig:connection:
 
(int) - setDualStreamModeEx:mode:streamConfig:connection:
 
(int) - setRemoteVideoStreamEx:type:connection:
 
(int) - setRemoteVideo:SubscriptionOptionsEx:connection:
 
(int) - pushExternalEncodedVideoFrameEx:info:videoTrackId:
 
(BOOL) - pushExternalVideoFrame:videoTrackId:
 
(AgoraUserInfo *_Nullable) - getUserInfoByUserAccountEx:connection:withError:
 
(AgoraUserInfo *_Nullable) - getUserInfoByUidEx:connection:withError:
 
(AgoraConnectionState- getConnectionStateEx:
 
(int) - setRemoteVoicePositionEx:pan:gain:connection:
 
(int) - addVideoWatermarkEx:options:connection:
 
(int) - clearVideoWatermarkEx:
 

Data Steam


(int) - createDataStreamEx:reliable:ordered:connection:
 
(int) - createDataStreamEx:config:connection:
 
(int) - sendStreamMessageEx:data:connection:
 

Stream Publish


(int) - setSubscribeAudioBlacklistEx:connection:
 
(int) - setSubscribeAudioWhitelistEx:connection:
 
(int) - setSubscribeVideoBlacklistEx:connection:
 
(int) - setSubscribeVideoWhitelistEx:connection:
 

Method Documentation

◆ joinChannelExByToken:connection:delegate:mediaOptions:joinSuccess:

- (int) joinChannelExByToken: (NSString *_Nullable)  token
connection: (AgoraRtcConnection *_Nonnull)  connection
delegate: (id< AgoraRtcEngineDelegate > _Nullable)  delegate
mediaOptions: (AgoraRtcChannelMediaOptions *_Nonnull)  mediaOptions
joinSuccess: (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed))  joinSuccessBlock 

Joins a channel.

You can call this method multiple times to join multiple channels.

Parameters
tokenThe token for authentication.
  • In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token.
  • In situations requiring high security: Set it as the token generated at you server. For details, see Generate a token.
connectionAgoraRtcConnection by channelId and uid combine
delegateAgoraRtcEngineDelegate protocol.(Need a new object when called)
mediaOptionsAgoraRtcChannelMediaOptions Object.
joinSuccessBlockSame as didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel.
  • If joinSuccessBlock is nil, the SDK triggers the didJoinChannel callback.
  • If you implement both joinSuccessBlock and didJoinChannel, joinSuccessBlock takes higher priority than didJoinChannel.
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ joinChannelExByToken:channelId:userAccount:delegate:mediaOptions:joinSuccess:

- (int) joinChannelExByToken: (NSString *_Nullable)  token
channelId: (NSString *_Nonnull)  channelId
userAccount: (NSString *_Nonnull)  userAccount
delegate: (id< AgoraRtcEngineDelegate > _Nullable)  delegate
mediaOptions: (AgoraRtcChannelMediaOptions *_Nonnull)  mediaOptions
joinSuccess: (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed))  joinSuccessBlock 

Joins the channel with a user account.

After the user successfully joins the channel, the SDK triggers the following callbacks:

Note
To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
Parameters
tokenThe token generated at your server:
  • For low-security requirements: You can use the temporary token generated at Console. For details, see Get a temporary toke.
  • For high-security requirements: Set it as the token generated at your server. For details, see Get a token.
channelIdThe channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
delegateAgoraRtcEngineDelegate protocol.
mediaOptionsThe channel media options: ChannelMediaOptions
Returns
  • 0: Success.
  • < 0: Failure.
    • #ERR_INVALID_ARGUMENT (-2)
    • #ERR_NOT_READY (-3)
    • #ERR_REFUSED (-5)

Extends class AgoraRtcEngineKit.

◆ updateChannelExWithMediaOptions:connection:

- (int) updateChannelExWithMediaOptions: (AgoraRtcChannelMediaOptions *_Nonnull)  mediaOptions
connection: (AgoraRtcConnection *_Nonnull)  connection 

Updates the channel media options after joining the channel.

Parameters
mediaOptionsThe channel media options: ChannelMediaOptions.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ muteRemoteAudioStreamEx:mute:connection:

- (int) muteRemoteAudioStreamEx: (NSUInteger)  uid
mute: (BOOL)  mute
connection: (AgoraRtcConnection *_Nonnull)  connection 

Mutes a specified remote user's audio stream.

Note
When setting to YES, this method stops playing audio streams without affecting the audio stream receiving process.
Parameters
uidUser ID whose audio streams the user intends to mute.
mute* YES: Stops playing a specified user’s audio streams. NO: Resumes playing a specified user’s audio streams.
connectionAgoraRtcConnection by channelId and uid combine
Returns
* 0: Success. <0: Failure.

Extends class AgoraRtcEngineKit.

◆ setVideoEncoderConfigurationEx:connection:

- (int) setVideoEncoderConfigurationEx: (AgoraVideoEncoderConfiguration *_Nonnull)  config
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the video encoder configuration.

Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate.

The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found.

Parameters
configThe local video encoder configuration, see #AgoraVideoEncoderConfiguration.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ setupRemoteVideoEx:connection:

- (int) setupRemoteVideoEx: (AgoraRtcVideoCanvas *_Nonnull)  remote
connection: (AgoraRtcConnection *_Nonnull)  connection 

Binds the remote user to the video display window, that is, sets the view for the user of the specified uid.

Usually, the application should specify the uid of the remote video in the method call before the user enters a channel. If the remote uid is unknown to the application, you can set the uid after receiving the didJoinedOfUid event.

Parameters
remoteAgoraRtcVideoCanvas
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • <0: Failure.

Extends class AgoraRtcEngineKit.

◆ setRemoteRenderModeEx:mode:mirror:connection:

- (int) setRemoteRenderModeEx: (NSUInteger)  uid
mode: (AgoraVideoRenderMode mode
mirror: (AgoraVideoMirrorMode)  mirror
connection: (AgoraRtcConnection *_Nonnull)  connection 

Configures the remote video display mode. The application can call this method multiple times to change the display mode.

Parameters
uidUser id of the user whose video streams are received.
modeAgoraVideoRenderMode
mirrorAgoraVideoMirrorMode
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • <0: Failure.

Extends class AgoraRtcEngineKit.

◆ muteRemoteVideoStreamEx:mute:connection:

- (int) muteRemoteVideoStreamEx: (NSUInteger)  uid
mute: (BOOL)  mute
connection: (AgoraRtcConnection *_Nonnull)  connection 

Stops or resumes receiving the video stream of a specified user.

Note
Once you leave the channel, the settings in this method becomes invalid.
Parameters
uidID of the specified remote user.
muteDetermines whether to receive or stop receiving a specified video stream:
  • YES: Stop receiving the specified video stream.
  • NO: (Default) Receive the specified video stream.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ enableDualStreamModeEx:enabled:streamConfig:connection:

- (int) enableDualStreamModeEx: (AgoraVideoSourceType sourceType
enabled: (BOOL)  enabled
streamConfig: (AgoraSimulcastStreamConfig *)  streamConfig
connection: (AgoraRtcConnection *_Nonnull)  connection 

Enables or disables the dual video stream mode.

If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.

Parameters
sourceTypeThe video source type.
enabled
  • true: Enable the dual-stream mode.
  • false: (default) Disable the dual-stream mode.
streamConfigThe minor stream config
connectionAn output parameter which is used to control different connection instances.

Extends class AgoraRtcEngineKit.

◆ setDualStreamModeEx:mode:streamConfig:connection:

- (int) setDualStreamModeEx: (AgoraVideoSourceType sourceType
mode: (AgoraSimulcastStreamMode mode
streamConfig: (AgoraSimulcastStreamConfig *)  streamConfig
connection: (AgoraRtcConnection *_Nonnull)  connection 

Enables or disables the dual video stream mode.

If dual-stream mode is enabled, the subscriber can choose to receive the high-stream (high-resolution high-bitrate video stream) or low-stream (low-resolution low-bitrate video stream) video using setRemoteVideoStreamType.

Parameters
sourceTypeThe video source type.
modeThe dual-stream mode.
streamConfigThe minor stream config
connectionAn output parameter which is used to control different connection instances.

Extends class AgoraRtcEngineKit.

◆ setRemoteVideoStreamEx:type:connection:

- (int) setRemoteVideoStreamEx: (NSUInteger)  uid
type: (AgoraVideoStreamType streamType
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the remote video stream type.

If the remote user has enabled the dual-stream mode, by default the SDK receives the high-stream video. Call this method to switch to the low-stream video.

Note
This method applies to scenarios where the remote user has enabled the dual-stream mode by enableDualStreamMode before joining the channel.
Parameters
uidID of the remote user sending the video stream.
streamTypeThe video stream type: AgoraVideoStreamType.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ setRemoteVideo:SubscriptionOptionsEx:connection:

- (int) setRemoteVideo: (NSUInteger)  uid
SubscriptionOptionsEx: (AgoraVideoSubscriptionOptions *_Nonnull)  options
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the remote video subscription options

Parameters
uidID of the remote user sending the video stream.
optionsSets the video subscription options.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ pushExternalEncodedVideoFrameEx:info:videoTrackId:

- (int) pushExternalEncodedVideoFrameEx: (NSData *_Nonnull)  frame
info: (AgoraEncodedVideoFrameInfo *_Nonnull)  info
videoTrackId: (NSUInteger)  videoTrackId 

Pushes the encoded external video frame to specified connection in Agora SDK.

Note
Ensure that you have configured encoded video source before calling this method.
Parameters
dataThe encoded external video data, which must be the direct buffer.
frameInfoThe encoded external video frame info: AgoraEncodedVideoFrameInfo.
connectionAgoraRtcConnection by channelId and uid combine
Returns
  • 0: Success, which means that the encoded external video frame is pushed successfully.
  • < 0: Failure, which means that the encoded external video frame fails to be pushed.

Extends class AgoraRtcEngineKit.

◆ pushExternalVideoFrame:videoTrackId:

- (BOOL) pushExternalVideoFrame: (AgoraVideoFrame *_Nonnull)  frame
videoTrackId: (NSUInteger)  videoTrackId 

Pushes the external video frame.

This method pushes the video frame using the AgoraVideoFrame class and passes it to the Agora SDK with the format parameter in AgoraVideoFormat.

Call setExternalVideoSource and set the pushMode parameter as YES before calling this method.

Note
In the Communication profile, this method does not support pushing textured video frames.
Parameters
frameVideo frame containing the SDK's encoded video data to be pushed: AgoraVideoFrame.
videoTrackIdThe id of the video track.
Returns
  • YES: Success.
  • NO: Failure.

Extends class AgoraRtcEngineKit.

◆ getUserInfoByUserAccountEx:connection:withError:

- (AgoraUserInfo* _Nullable) getUserInfoByUserAccountEx: (NSString *_Nonnull)  userAccount
connection: (AgoraRtcConnection *_Nonnull)  connection
withError: (AgoraErrorCode *_Nullable)  error 

Gets the user information by passing in the user account.

After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (AgoraUserInfo), and triggers the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback on the local client.

After receiving the [didUpdatedUserInfo]([AgoraRtcEngineDelegate rtcEngine:didUpdatedUserInfo:withUid:]) callback, you can call this method to get the user ID of the remote user from the userInfo object by passing in the user account.

Parameters
userAccountThe user account of the user. Ensure that you set this parameter.
connectionAgoraRtcConnection by channelId and uid combine
Returns
An [AgoraUserInfo](AgoraUserInfo) object that contains the user account and user ID of the user.

Extends class AgoraRtcEngineKit.

◆ getUserInfoByUidEx:connection:withError:

- (AgoraUserInfo* _Nullable) getUserInfoByUidEx: (NSUInteger)  uid
connection: (AgoraRtcConnection *_Nonnull)  connection
withError: (AgoraErrorCode *_Nullable)  error 

Gets the user information by passing in the user ID.

After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (userInfo), and triggers the onUserInfoUpdated callback on the local client.

After receiving the onUserInfoUpdated callback, you can call this method to get the user account of the remote user from the userInfo object by passing in the user ID.

Parameters
uidThe user ID of the remote user. Ensure that you set this parameter.
connectionAgoraRtcConnection by channelId and uid combine
Returns
An [AgoraUserInfo](AgoraUserInfo) object that contains the user account and user ID of the user.

Extends class AgoraRtcEngineKit.

◆ getConnectionStateEx:

- (AgoraConnectionState) getConnectionStateEx: (AgoraRtcConnection *_Nonnull)  connection

Gets the connection state of the SDK.

Parameters
connectionAgoraRtcConnection by channelId and uid combine
Returns
The connection state. See AgoraConnectionState.

Extends class AgoraRtcEngineKit.

◆ sendCustomReportMessageEx:category:event:label:value:connection:

- (int) sendCustomReportMessageEx: (NSString *_Nullable)  messageId
category: (NSString *_Nullable)  category
event: (NSString *_Nullable)  event
label: (NSString *_Nullable)  label
value: (NSInteger)  value
connection: (AgoraRtcConnection *_Nonnull)  connection 

Extends class AgoraRtcEngineKit.

◆ enableAudioVolumeIndicationEx:smooth:reportVad:connection:

- (int) enableAudioVolumeIndicationEx: (NSInteger)  interval
smooth: (NSInteger)  smooth
reportVad: (BOOL)  reportVad
connection: (AgoraRtcConnection *_Nonnull)  connection 

Extends class AgoraRtcEngineKit.

◆ setRemoteVoicePositionEx:pan:gain:connection:

- (int) setRemoteVoicePositionEx: (NSUInteger)  uid
pan: (double)  pan
gain: (double)  gain
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the sound position and gain of a remote user.

When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.

Note:**

  • Ensure that you call this method after joining a channel. For this method to work, enable stereo panning for remote users by calling [enableSoundPositionIndication]([AgoraRtcEngineKit enableSoundPositionIndication:]) before joining a channel. This method requires hardware support.
  • For the best effect, we recommend using the following audio output devices:
    • (iOS) A stereo headset.
    • (macOS) A stereo loudspeaker.
      Parameters
      uidThe ID of the remote user.
      panThe sound position of the remote user. The value ranges from -1.0 to 1.0:
      0.0: (default) the remote sound comes from the front. -1.0: the remote sound comes from the left. 1.0: the remote sound comes from the right.
Parameters
gainGain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain.
connectionAgoraRtcConnection by channelId and uid combine
Returns
* 0: Success. < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ addVideoWatermarkEx:options:connection:

- (int) addVideoWatermarkEx: (NSURL *_Nonnull)  url
options: (WatermarkOptions *_Nonnull)  options
connection: (AgoraRtcConnection *_Nonnull)  connection 

Adds a watermark image to the local video.

This method adds a PNG watermark image to the local video in the interactive live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one.

The watermark position depends on the settings in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method:

  • If the orientation mode of the encoding video is AgoraVideoOutputOrientationModeFixedLandscape, or the landscape mode in AgoraVideoOutputOrientationModeAdaptative, the watermark uses the landscape orientation.
  • If the orientation mode of the encoding video is AgoraVideoOutputOrientationModeFixedPortrait, or the portrait mode in AgoraVideoOutputOrientationModeAdaptative, the watermark uses the portrait orientation.
  • When setting the watermark position, the region must be less than the dimensions set in the [setVideoEncoderConfiguration]([AgoraRtcEngineKit setVideoEncoderConfiguration:]) method. Otherwise, the watermark image will be cropped.

    Note**

  • Ensure that you have called the [enableVideo]([AgoraRtcEngineKit enableVideo]) method to enable the video module before calling this method.
  • If you only want to add a watermark image to the local video for the audience in the CDN live streaming channel to see and capture, you can call this method or the [setLiveTranscoding]([AgoraRtcEngineKit setLiveTranscoding:]) method.
  • This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
  • If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
  • If you have enabled the local video preview by calling the [startPreview]([AgoraRtcEngineKit startPreview]) method, you can use the visibleInPreview member in the WatermarkOptions class to set whether or not the watermark is visible in preview.
  • If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer.
Parameters
urlThe local file path of the watermark image to be added. This method supports adding a watermark image from the local file path. If the watermark image to be added is in the project file, you need to change the image's Type from PNG image to Data in the Xcode property, otherwise, the Agora Native SDK cannot recognize the image.
optionsThe options of the watermark image to be added. See WatermarkOptions.
connectionAgoraRtcConnection by channelId and uid combine
Returns
* 0: Success. < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ clearVideoWatermarkEx:

- (int) clearVideoWatermarkEx: (AgoraRtcConnection *_Nonnull)  connection

Clears the watermark image on the video stream.

Parameters
connectionAgoraRtcConnection by channelId and uid combine
Returns
* 0: Success. < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ createDataStreamEx:reliable:ordered:connection:

- (int) createDataStreamEx: (NSInteger *_Nonnull)  streamId
reliable: (BOOL)  reliable
ordered: (BOOL)  ordered
connection: (AgoraRtcConnection *_Nonnull)  connection 

Creates a data stream.

Each user can create up to five data streams during the lifecycle of the AgoraRtcEngineKit.

Note
Set both the reliable and ordered parameters to YES or NO. Do not set one as YES and the other as NO.
Parameters
streamIdID of the created data stream.
reliableSets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:
  • YES: The recipients receive the data stream from the sender within five seconds. If the recipient does not receive the data stream within five seconds, an error is reported to the app.
  • NO: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream.
orderedSets whether or not the recipients receive the data stream in the sent order:
  • YES: The recipients receive the data stream in the sent order.
  • NO: The recipients do not receive the data stream in the sent order.
connectionAgoraRtcConnection by channelId and uid combine.
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ createDataStreamEx:config:connection:

- (int) createDataStreamEx: (NSInteger *_Nonnull)  streamId
config: (AgoraDataStreamConfig *_Nonnull)  config
connection: (AgoraRtcConnection *_Nonnull)  connection 

Creates a data stream.

Each user can create up to five data streams during the lifecycle of the [AgoraRtcChannel](AgoraRtcChannel).

Parameters
streamIdID of the created data stream.
configthe config of data stream.
connectionAgoraRtcConnection by channelId and uid combine.
Returns
* 0: Success. < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ sendStreamMessageEx:data:connection:

- (int) sendStreamMessageEx: (NSInteger)  streamId
data: (NSData *_Nonnull)  data
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sends data stream messages to all users in a channel.

The SDK has the following restrictions on this method:

  • Up to 60 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
  • Each client can send up to 30 KB of data per second.
  • Each user can have up to five data streams simultaneously.

If the remote user receives the data stream within five seconds, the SDK triggers the receiveStreamMessageFromUid callback on the remote client, from which the remote user gets the stream message.

If the remote user does not receive the data stream within five seconds, the SDK triggers the didOccurStreamMessageErrorFromUid callback on the remote client.

Note
  • This method applies only to the Communication profile or to the hosts in the live interactive streaming profile. If an audience in the live interactive streaming profile calls this method, the audience role may be changed to a host.
  • Ensure that you have created the data stream using createDataStream before calling this method.
Parameters
streamIdID of the sent data stream returned in the createDataStream method.
dataSent data.
connectionAgoraRtcConnection by channelId and uid combine.
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ setSubscribeAudioBlacklistEx:connection:

- (int) setSubscribeAudioBlacklistEx: (NSArray< NSNumber * > *_Nonnull)  blacklist
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the blacklist of subscribe remote stream audio.

Parameters
blacklistThe uid list of users who do not subscribe to audio.
connectionAgoraRtcConnection by channelId and uid combine.
Note
If uid is in blacklist, the remote user's audio will not be subscribed, even if muteRemoteAudioStream(uid, false) and muteAllRemoteAudioStreams(false) are operated.
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ setSubscribeAudioWhitelistEx:connection:

- (int) setSubscribeAudioWhitelistEx: (NSArray< NSNumber * > *_Nonnull)  whitelist
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the whitelist of subscribe remote stream audio.

Parameters
whitelistThe uid list of users who do subscribe to audio.
connectionAgoraRtcConnection by channelId and uid combine.
Note
If uid is in whitelist, the remote user's audio will be subscribed, even if muteRemoteAudioStream(uid, true) and muteAllRemoteAudioStreams(true) are operated.

If a user is in the blacklist and whitelist at the same time, the user will not subscribe to audio.

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

Extends class AgoraRtcEngineKit.

◆ setSubscribeVideoBlacklistEx:connection:

- (int) setSubscribeVideoBlacklistEx: (NSArray< NSNumber * > *_Nonnull)  blacklist
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the blacklist of subscribe remote stream video.

Parameters
blacklistThe uid list of users who do not subscribe to video.
connectionAgoraRtcConnection by channelId and uid combine.
Note
If uid is in blacklist, the remote user's video will not be subscribed, even if muteRemoteVideoStream(uid, false) and muteAllRemoteVideoStreams(false) are operated.
Returns
  • 0: Success.
  • < 0: Failure.

Extends class AgoraRtcEngineKit.

◆ setSubscribeVideoWhitelistEx:connection:

- (int) setSubscribeVideoWhitelistEx: (NSArray< NSNumber * > *_Nonnull)  whitelist
connection: (AgoraRtcConnection *_Nonnull)  connection 

Sets the whitelist of subscribe remote stream video.

Parameters
whitelistThe uid list of users who do subscribe to video.
connectionAgoraRtcConnection by channelId and uid combine.
Note
If uid is in whitelist, the remote user's video will be subscribed, even if muteRemoteVideoStream(uid, true) and muteAllRemoteVideoStreams(true) are operated.

If a user is in the blacklist and whitelist at the same time, the user will not subscribe to video.

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

Extends class AgoraRtcEngineKit.

◆ takeSnapshotEx:uid:filePath:

- (NSInteger) takeSnapshotEx: (AgoraRtcConnection *_Nonnull)  connection
uid: (NSInteger)  uid
filePath: (NSString *_Nonnull)  filePath 

Extends class AgoraRtcEngineKit.