|
Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Core Methods | |
| id< AgoraRtcEngineDelegate > _Nullable | delegate |
| (int) | - joinChannelByToken:channelId:info:uid:joinSuccess: |
| (int) | - joinChannelByToken:channelId:uid:mediaOptions:joinSuccess: |
| (int) | - leaveChannel: |
| (int) | - setChannelProfile: |
| (int) | - updateChannelWithMediaOptions: |
| (int) | - setClientRole: |
| (int) | - renewToken: |
| (int) | - enableWebSdkInteroperability: |
| (instancetype _Nonnull) | + sharedEngineWithAppId:delegate: |
| (instancetype _Nonnull) | + sharedEngineWithConfig:delegate: |
| (void) | + destroy |
Core Audio | |
| (int) | - enableAudio |
| (int) | - disableAudio |
| (int) | - enableLocalAudio: |
| (int) | - setAudioProfile: |
| (int) | - enableAudioVolumeIndication:smooth: |
Core Video | |
| (int) | - enableVideo |
| (int) | - disableVideo |
| (int) | - enableLocalVideo: |
| (int) | - setupLocalVideo: |
| (int) | - setLocalRenderMode: |
| (int) | - startPreview |
| (int) | - stopPreview |
| (int) | - muteLocalVideoStream: |
| (int) | - muteAllRemoteVideoStreams: |
| (int) | - setDefaultMuteAllRemoteVideoStreams: |
| (int) | - muteRemoteVideoStream:mute: |
Miscellaneous Audio Control | |
| (int) | - enableInEarMonitoring: |
| (int) | - enableInEarMonitoring:includeAudioFilter: |
| (int) | - setInEarMonitoringVolume: |
Dual Video Mode | |
| (int) | - enableDualStreamMode: |
| (int) | - setRemoteDefaultVideoStreamType: |
Camera Control | |
| (int) | - switchCamera |
Watermark | |
| (BOOL) | - setAudioFrameDelegate: |
Media Metadata | |
| (BOOL) | - setMediaMetadataDataSource:withType: |
| (BOOL) | - setMediaMetadataDelegate:withType: |
Miscellaneous Methods | |
| (int) | - setLogFile: |
| (int) | - setLogFilter: |
| (NSString *_Nullable) | - getCallId |
| (int) | - rate:rating:description: |
| (int) | - complain:description: |
| (int) | - startLastmileProbeTest: |
| (int) | - stopLastmileProbeTest |
| (NSString *_Nonnull) | + getSdkVersion |
| (NSString *_Nonnull) | + getErrorDescription: |
Deprecated Methods | |
| (int) | - setAudioProfile:scenario: |
Provides all methods that can be invoked by your application.
Agora provides ensured quality of experience (QoE) for worldwide Internet-based voice and video communications through a virtual global network that is especially optimized for real-time web and mobile-to-mobile applications.
AgoraRtcEngineKit is the basic interface class of Agora Native SDK. Creating an AgoraRtcEngineKit object and then calling the methods of this object enables the use of Agora Native SDK’s communication functionality.
| - (int) joinChannelByToken: | (NSString *_Nullable) | token | |
| channelId: | (NSString *_Nonnull) | channelId | |
| info: | (NSString *_Nullable) | info | |
| uid: | (NSUInteger) | uid | |
| joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other even if they join the same channel.
You must call the leaveChannel method to exit the current call before entering another channel. This method call is asynchronous; therefore, you can call this method in the main user interface thread.
A successful method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the didRejoinChannel callback on the local client.
setCategory(AVAudioSessionCategoryPlayAndRecord) to set AVAudioSession to PlayAndRecord mode. When AVAudioSession is set to PlayAndRecord mode, the sound played (for example a ringtone) is interrupted. The app should not set AVAudioSession to any other mode.| token | The token for authentication.
|
| channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
| info | (Optional) Additional information about the channel. This parameter can be set to nil or contain channel related information. Other users in the channel do not receive this message. |
| uid | User ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the callback. Your app must record and maintain the returned uid since the SDK does not do so. |
| joinSuccessBlock | Same as didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel.
|
| - (int) joinChannelByToken: | (NSString *_Nullable) | token | |
| channelId: | (NSString *_Nonnull) | channelId | |
| uid: | (NSUInteger) | uid | |
| mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
| joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other even if they join the same channel.
You must call the leaveChannel method to exit the current call before entering another channel. This method call is asynchronous; therefore, you can call this method in the main user interface thread.
A successful method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the didRejoinChannel callback on the local client.
setCategory(AVAudioSessionCategoryPlayAndRecord) to set AVAudioSession to PlayAndRecord mode. When AVAudioSession is set to PlayAndRecord mode, the sound played (for example a ringtone) is interrupted. The app should not set AVAudioSession to any other mode.| token | The token for authentication.
|
| channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
| uid | User ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the callback. Your app must record and maintain the returned uid since the SDK does not do so. |
| mediaOptions | AgoraRtcChannelMediaOptions Object. |
| joinSuccessBlock | Same as didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel.
|
| - (int) leaveChannel: | (void(^)(AgoraChannelStats *_Nonnull stat)) | leaveChannelBlock |
Leaves the channel.
This method allows a user to leave the channel, for example, by hanging up or exiting a call.
This method also releases all resources related to the call.
This method is an asynchronous call, which means that the result of this method returns before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the didLeaveChannelWithStats callback.
didLeaveChannelWithStats callback.| leaveChannelBlock | This callback indicates that a user leaves a channel, and provides the statistics of the call in AgoraChannelStats. |
| - (int) setChannelProfile: | (AgoraChannelProfile) | profile |
Sets the channel profile.
The SDK differentiates channel profiles and applies different optimization algorithms accordingly.
joinChannelByToken. You cannot set the channel profile once you have joined the channel.| profile | The channel profile: AgoraChannelProfile. |
| - (int) updateChannelWithMediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions |
Updates the channel media options after joining the channel.
| mediaOptions | The channel media options: ChannelMediaOptions. |
| - (int) setClientRole: | (AgoraClientRole) | role |
Sets the role of a user.
This method sets the role of a user as either a broadcaster or an audience.
| role | Role of the client: AgoraClientRole. |
| - (int) renewToken: | (NSString *_Nonnull) | token |
Renews the token.
Once a token is enabled and used, it expires after a certain period of time.
Under the following circumstances, generate a new token on your server, and then call this method to renew it. Failure to do so results in the SDK disconnecting from the server.
AgoraErrorCodeTokenExpired(-109) error is reported. | token | The new token. |
| - (int) enableWebSdkInteroperability: | (BOOL) | enabled |
| enabled | Whether interoperability with the Agora Web SDK is enabled:
|
| + (instancetype _Nonnull) sharedEngineWithAppId: | (NSString *_Nonnull) | appId | |
| delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
Initializes the Agora SDK service.
After the initialization, the service is set to enable audio by default.
| appId | App ID of your Agora project. |
| delegate | AgoraRtcEngineDelegate. |
AgoraRtcEngineKit object. | + (instancetype _Nonnull) sharedEngineWithConfig: | (AgoraRtcEngineConfig *_Nonnull) | config | |
| delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
Initializes the Agora SDK service with config.
After the initialization, the service is set to enable audio by default.
| config | RtcEngine config info. |
| delegate | AgoraRtcEngineDelegate. |
AgoraRtcEngineKit object. | + (void) destroy |
This method releases all the resources used by the Agora SDK. This is useful for applications that occasionally make voice or video calls, to free up resources for other operations when not making calls. Once the application has called this method to destroy the created AgoraRtcEngineKit instance, no other methods in the SDK can be used and no callbacks occur. To start communications again, call sharedEngineWithAppId to establish a new AgoraRtcEngineKit instance.
| - (int) enableAudio |
Enables the audio.
The audio is enabled by default.
| - (int) disableAudio |
Disables the audio.
| - (int) enableLocalAudio: | (BOOL) | enabled |
Enables or disables the local audio capture.
The audio function is enabled by default. This method disables or re-enables the local audio function, that is, to stop or restart local audio capture and processing.
This method does not affect receiving or playing the remote audio streams, and enableLocalAudio (NO) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.
| enabled | Determines whether to disable or re-enable the local audio function:
|
| - (int) setAudioProfile: | (AgoraAudioProfile) | profile |
Sets the audio parameters and application scenarios.
joinChannelByToken.profile as AgoraAudioProfileMusicHighQuality(4) and scenario as AgoraAudioScenarioGameStreaming(3). | profile | The sample rate, bitrate, encoding mode, and the number of channels, see AgoraAudioProfile. |
| scenario | The audio application scenarios, see AgoraAudioScenario. |
| - (int) enableAudioVolumeIndication: | (NSInteger) | interval | |
| smooth: | (NSInteger) | smooth | |
Enables the reportAudioVolumeIndicationOfSpeakers callback to report on which users are speaking and the speakers' volume.
Once the reportAudioVolumeIndicationOfSpeakers callback is enabled, the SDK returns the volume indication in the at the time interval set in enableAudioVolumeIndication, regardless of whether any user is speaking in the channel.
| interval | Sets the time interval between two consecutive volume indications:
|
| smooth | The smoothing factor that sets the sensitivity of the audio volume indicator. The value range is [0, 10]. The greater the value, the more sensitive the indicator. The recommended value is 3. |
| - (int) enableVideo |
Enables the video.
You can call this method either before joining a channel or during a call. If you call this method before entering a channel, the service starts the video; if you call it during a call, the audio call switches to a video call.
| - (int) disableVideo |
Disables the video.
This method stops capturing the local video and receiving all remote video. To enable the local preview function, call enableLocalVideo(YES).
| - (int) enableLocalVideo: | (BOOL) | enabled |
Disables or re-enables the local video capture.
Once you enable the video using enableVideo, the local video is enabled by default. This method disables or re-enables the local video capture.
enableLocalVideo(NO) applies to scenarios when the user wants to watch the remote video without sending any video stream to the other user.
enableVideo. Otherwise, this method may not work properly.| enabled | Determines whether to disable or re-enable the local video, including the capturer, renderer, and sender:
|
| - (int) setupLocalVideo: | (AgoraRtcVideoCanvas *_Nullable) | local |
This method initializes the video view of the local stream on the local device.
It affects only the video view that the local user sees, not the published local video stream.
Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. To unbind the view, set the view in AgoraRtcVideoCanvas to nil.
| local | The local video view and settings. See AgoraRtcVideoCanvas. |
| - (int) setLocalRenderMode: | (AgoraVideoRenderMode) | mode |
Updates the display mode of the local video view.
After initialzing the local video view, you can call this method to update its rendering mode. It affects only the video view that the local user sees, not the published local video stream.
| mode | Sets the local display mode. See AgoraVideoRenderMode. |
| - (int) startPreview |
Starts the local video preview before joining a channel.
Once you call this method to start the local video preview, if you leave the channel by calling leaveChannel, the local video preview remains until you call stopPreview to disable it.
| - (int) stopPreview |
Stops the local video preview and the video.
| - (int) muteLocalVideoStream: | (BOOL) | mute |
Stops or resumes sending the local video stream.
| mute | Determines whether to send or stop sending the local video stream:
|
| - (int) muteAllRemoteVideoStreams: | (BOOL) | mute |
Stops/Resumes receiving all remote video streams.
This method works for all remote users that join or will join a channel. You can call this method before, during, or after a call.
muteAllRemoteVideoStreams(YES) before joining a channel, the local user does not receive any video stream after joining the channel.muteAllRemoteVideoStreams(YES) after joining a channel, the local use stops receiving any video stream from any user in the channel, including any user who joins the channel after you call this method.muteAllRemoteVideoStreams(YES) after leaving a channel, the local user does not receive any video stream the next time the user joins a channel.After you successfully call muteAllRemoteVideoStreams(YES), you can take the following actions:
muteAllRemoteVideoStreams(NO).uid is the ID of the user whose video stream you want to resume receiving.muteAllRemoteVideoStreams stop taking effect if either of the following occurs:enableVideo after muteAllRemoteVideoStreams(YES).disableVideo after muteAllRemoteVideoStreams(NO).| mute | Whether to stop receiving remote video streams:
|
| - (int) setDefaultMuteAllRemoteVideoStreams: | (BOOL) | mute |
joinChannelByToken.Determines whether to receive all remote video streams by default.
| mute | Whether to receive remote video streams by default:
|
| - (int) muteRemoteVideoStream: | (NSUInteger) | uid | |
| mute: | (BOOL) | mute | |
Stops or resumes receiving the video stream of a specified user.
You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.
| uid | ID of the specified remote user. |
| mute | Whether to stop receiving the video stream of the specified user:
|
| - (int) enableInEarMonitoring: | (BOOL) | enabled |
Enables in-ear monitoring.
| enabled | Determines whether to enable in-ear monitoring.
|
| - (int) enableInEarMonitoring: | (BOOL) | enabled | |
| includeAudioFilter: | (BOOL) | includeAudioFilter | |
Enables in-ear monitoring.
| enabled | Determines whether to enable in-ear monitoring.
|
| includeAudioFilter | Determines whether to include audio filters, for example, voice changer or reverberation, in the in-ear monitoring.
|
| - (int) setInEarMonitoringVolume: | (NSInteger) | volume |
Sets the volume of the in-ear monitoring.
| volume | The volume of the in-ear monitor, ranging from 0 to 100. The default value is 100. |
| - (int) enableDualStreamMode: | (BOOL) | enabled |
Enables or disables the dual video stream mode.
| enabled |
|
| - (int) setRemoteDefaultVideoStreamType: | (AgoraVideoStreamType) | streamType |
Sets the default stream type of the remote video if the remote user has enabled the dual-stream mode.
| streamType | The default video stream type: AgoraVideoStreamType. |
| - (void) setExternalVideoSource: | (BOOL) | enable | |
| useTexture: | (BOOL) | useTexture | |
| pushMode: | (BOOL) | pushMode | |
Sets the external video source.
Call this API before enableVideo or startPreview.
| enable | Determines whether to enable the external video source.
|
The Agora SDK does not support switching video sources dynamically in the channel. If an external video source is enabled and you are in a channel, if you want to switch to an internal video source, you must exit the channel. Then call this method to set enable as NO, and join the channel again.
| useTexture | Determines whether to use textured video data.
|
| pushMode | Determines whether the external video source needs to call pushExternalVideoFrame to send the video frame to the Agora SDK:
|
| - (BOOL) pushExternalVideoFrame: | (AgoraVideoFrame *_Nonnull) | frame |
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.
| frame | Video frame containing the SDK's encoded video data to be pushed: AgoraVideoFrame. |
YES: Success.NO: Failure. | - (int) setExternalAudioSource: | (BOOL) | enabled | |
| sampleRate: | (NSInteger) | sampleRate | |
| channels: | (NSInteger) | channels | |
Sets the external audio source.
| enabled | Determines whether to enable the external audio source:
|
| sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
| channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
| - (int) setExternalAudioSource: | (BOOL) | enabled | |
| sampleRate: | (NSInteger) | sampleRate | |
| channels: | (NSInteger) | channels | |
| sourceNumber: | (NSInteger) | sourceNumber | |
Sets the external audio source.
| enabled | Determines whether to enable the external audio source:
|
| sampleRate | The Sample rate (Hz) of the external audio source, which can set be as 8000, 16000, 32000, 44100, or 48000. |
| channels | The number of channels of the external audio source, which can be set as 1 or 2:
|
| sourceNumber | The number of the external audio sources, should be greater than 0. |
| - (int) setRecordingAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
| channel: | (NSInteger) | channel | |
| mode: | (AgoraAudioRawFrameOperationMode) | mode | |
| samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the audio recording format for the onRecordAudioFrame callback.
The SDK calculates the sample interval according to the value of the sampleRate, channel, and samplesPerCall parameters you set in this method. Sample interval (sec) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the onRecordAudioFrame callback according to the sample interval.
| sampleRate | The audio sample rate (samplesPerSec) returned in the onRecordAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels (channels) returned in the onRecordAudioFrame callback, which can be set as 1 or 2:
|
| mode | Deprecated. The use mode of the onRecordAudioFrame callback.See AgoraAudioRawFrameOperationMode. |
| samplesPerCall | The number of samples the onRecordAudioFrame callback returns. Set it as 1024 for RTMP streaming. |
| - (int) setPlaybackAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
| channel: | (NSInteger) | channel | |
| mode: | (AgoraAudioRawFrameOperationMode) | mode | |
| samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the audio playback format for the onPlaybackAudioFrame callback.
The SDK calculates the sample interval according to the value of the sampleRate, channel, and samplesPerCall parameters you set in this method. Sample interval (sec) = samplePerCall/(sampleRate × channel). Ensure that the value of sample interval is no less than 0.01. The SDK triggers the onPlaybackAudioFrame callback according to the sample interval.
| sampleRate | The sample rate (samplesPerSec) returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz. |
| channel | The number of audio channels (channels) returned in the onPlaybackAudioFrame callback, which can be set as 1 or 2:
|
| mode | Deprecated. The use mode of the onPlaybackAudioFrame callback. See AgoraAudioRawFrameOperationMode. |
| samplesPerCall | The number of samples the onPlaybackAudioFrame callback returns. Set it as 1024 for RTMP streaming. |
| - (int) setMixedAudioFrameParametersWithSampleRate: | (NSInteger) | sampleRate | |
| channel: | (NSInteger) | channel | |
| samplesPerCall: | (NSInteger) | samplesPerCall | |
Sets the mixed audio format for the onMixedAudioFrame callback.
| sampleRate | The sample rate (Hz) of the audio data returned in the onMixedAudioFrame callback, which can set be as 8000, 16000, 32000, 44100, or 48000. |
| channel | The number of channels of the audio data in onMixedAudioFrame callback, which can be set as 1 or 2:
|
| samplesPerCall | Not supported. Sampling points in the called data returned in onMixedAudioFrame. For example, it is usually set as 1024 for stream pushing. |
| - (int) setPlaybackAudioFrameBeforeMixingParametersWithSampleRate: | (NSInteger) | sampleRate | |
| channel: | (NSInteger) | channel | |
Sets the audio frame parameters for the onPlaybackAudioFrameBeforeMixing callback.
| numberOfChannels | The number of channels contained in the onPlaybackAudioFrameBeforeMixing callback.
|
| sampleRateHz | The sample rate(Hz) contained in the onPlaybackAudioFrameBeforeMixing callback. You can set it as 8000, 16000, 32000, 44100, or 48000. |
| - (int) switchCamera |
Switches between the front and rear cameras.
| - (BOOL) setAudioFrameDelegate: | (id< AgoraAudioFrameDelegate > _Nullable) | delegate |
register & unregister the player audio observer
| observer | observer object, pass nil to unregister |
| - (BOOL) setMediaMetadataDataSource: | (id< AgoraMediaMetadataDataSource > _Nullable) | metadataDataSource | |
| withType: | (AgoraMetadataType) | type | |
Sets the data source of the metadata. You need to implement the [AgoraMediaMetadataDataSource](AgoraMediaMetadataDataSource) protocol and specify the type of metadata in this method. Use this method with the [setMediaMetadataDelegate]([AgoraRtcEngineKit setMediaMetadataDelegate:withType:]) method to add synchronized metadata in the video stream. You can create more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. Note**
| metadataDataSource | The AgoraMediaMetadataDataSource protocol. |
| type | The metadata type. See [AgoraMetadataType](AgoraMetadataType). Currently, the SDK supports video metadata only. |
| - (BOOL) setMediaMetadataDelegate: | (id< AgoraMediaMetadataDelegate > _Nullable) | metadataDelegate | |
| withType: | (AgoraMetadataType) | type | |
Sets the delegate of the metadata. You need to implement the AgoraMediaMetadataDelegate protocol and specify the type of metadata in this method. Note**
| metadataDelegate | The AgoraMediaMetadataDelegate protocol. |
| type | The metadata type. See [AgoraMetadataType](AgoraMetadataType). Currently, the SDK supports video metadata only. |
| + (NSString * _Nonnull) getSdkVersion |
Gets the Agora SDK version.
| + (NSString* _Nonnull) getErrorDescription: | (NSInteger) | error |
Gets the warning or error description.
| error | The warning or error code. |
| - (int) setLogFile: | (NSString *_Nonnull) | filePath |
Specifies an SDK output log file.
The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable.
App Sandbox/Library/caches/agorasdk.logApp Sandbox/Library/Logs/agorasdk.log, for example /Users/<username>/Library/Containers/<App Bundle Identifier>/Data/Library/Logs/agorasdk.log.~/Library/Logs/agorasdk.log.| filePath | Absolute path of the log file. The string of the log file is in UTF-8 code. |
| - (int) setLogFilter: | (NSUInteger) | filter |
Sets the output log level of the SDK.
You can use one or a combination of the filters. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level.
For example, if you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING.
| filter | Log filter level: AgoraLogFilter. |
| - (NSString * _Nullable) getCallId |
Gets the current call ID.
When a user joins a channel, a call ID is generated to identify the call.
After a call ends, you can call rate or complain to gather feedback from your customer.
| - (int) rate: | (NSString *_Nonnull) | callId | |
| rating: | (NSInteger) | rating | |
| description: | (NSString *_Nullable) | description | |
Allows a user to rate the call.
It is usually called after the call ends.
| callId | The call ID retrieved from the getCallId method. |
| rating | The rating of the call between 1 (the lowest score) to 5 (the highest score). If you set a value out of this range, the AgoraErrorCodeInvalidArgument(-2) error occurs. |
| description | (Optional) The description of the rating. The string length must be less than 800 bytes. |
callId is invalid.| - (int) complain: | (NSString *_Nonnull) | callId | |
| description: | (NSString *_Nullable) | description | |
Allows a user to complain about the call quality.
This method is usually called after the call ends.
| callId | The call ID retrieved from the getCallId method. |
| description | (Optional) The description of the complaint. The string length must be less than 800 bytes. |
callId is invalid.| - (int) startLastmileProbeTest: | (AgoraLastmileProbeConfig *_Nullable) | config |
Starts the last-mile network probe test.
Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
Call this method to check the uplink network quality before users join a channel or before an audience switches to a host.
Once this method is enabled, the SDK triggers the lastmileProbeTestResult callback within 30 seconds depending on the network conditions. This callback reports the real-time statistics of the network conditions.
lastmileProbeTestResult callback. Otherwise, the callback may be interrupted.| config | The configurations for the last-mile network probe test. See AgoraLastmileProbeConfig. |
| - (int) stopLastmileProbeTest |
Stops the last-mile network probe test.
| - (int) setAudioProfile: | (AgoraAudioProfile) | profile | |
| scenario: | (AgoraAudioScenario) | scenario | |
Sets the audio parameters and application scenarios.
joinChannelByToken.profile as AgoraAudioProfileMusicHighQuality(4) and scenario as AgoraAudioScenarioGameStreaming(3). | profile | The sample rate, bitrate, encoding mode, and the number of channels, see AgoraAudioProfile. |
| scenario | The audio application scenarios, see AgoraAudioScenario. |
| - (BOOL) isSecure |
| - (int) sendCustomReportMessage: | (NSString *_Nullable) | messageId | |
| category: | (NSString *_Nullable) | category | |
| event: | (NSString *_Nullable) | event | |
| label: | (NSString *_Nullable) | label | |
| value: | (NSInteger) | value | |
| - (int) setLogLevel: | (AgoraLogLevel) | level |
| - (int) joinChannelExByToken: | (NSString *_Nullable) | token | |
| channelId: | (NSString *_Nonnull) | channelId | |
| uid: | (NSUInteger) | uid | |
| connectionId: | (unsigned int *) | connectionId | |
| delegate: | (id< AgoraRtcEngineDelegate > _Nullable) | delegate | |
| mediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
| joinSuccess: | (void(^)(NSString *_Nonnull channel, NSUInteger uid, NSInteger elapsed)) | joinSuccessBlock | |
Joins a channel.
Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other even if they join the same channel.
You must call the leaveChannel method to exit the current call before entering another channel. This method call is asynchronous; therefore, you can call this method in the main user interface thread.
A successful method call triggers the following callbacks:
When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the didRejoinChannel callback on the local client.
setCategory(AVAudioSessionCategoryPlayAndRecord) to set AVAudioSession to PlayAndRecord mode. When AVAudioSession is set to PlayAndRecord mode, the sound played (for example a ringtone) is interrupted. The app should not set AVAudioSession to any other mode.| token | The token for authentication.
|
| channelId | Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
|
| info | (Optional) Additional information about the channel. This parameter can be set to nil or contain channel related information. Other users in the channel do not receive this message. |
| uid | User ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). The uid must be unique. If a uid is not assigned (or set to 0), the SDK assigns and returns a uid in the callback. Your app must record and maintain the returned uid since the SDK does not do so. |
| connectionId | pointer to connection ID, out param |
| mediaOptions | AgoraRtcChannelMediaOptions Object. |
| joinSuccessBlock | Same as didJoinChannel. We recommend you set this parameter as nil to use didJoinChannel.
|
Provided by category AgoraRtcEngineKit(Ex).
| - (int) updateChannelExWithMediaOptions: | (AgoraRtcChannelMediaOptions *_Nonnull) | mediaOptions | |
| connectionId: | (unsigned int) | connectionId | |
Updates the channel media options after joining the channel.
| mediaOptions | The channel media options: ChannelMediaOptions. |
| connectionId | connection ID |
Provided by category AgoraRtcEngineKit(Ex).
| - (int) muteRemoteAudioStreamEx: | (NSUInteger) | uid | |
| mute: | (BOOL) | mute | |
| connectionId: | (unsigned int) | connectionId | |
Mutes a specified remote user's audio stream.
| uid | User 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. |
| connectionId | connection ID. |
Provided by category AgoraRtcEngineKit(Ex).
| - (int) setVideoEncoderConfigurationEx: | (AgoraVideoEncoderConfiguration *_Nonnull) | config | |
| connectionId: | (unsigned int) | connectionId | |
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.
| config | The local video encoder configuration, see #AgoraVideoEncoderConfiguration. |
| connectionId | connection ID. |
Provided by category AgoraRtcEngineKit(Ex).
| - (int) setupRemoteVideoEx: | (AgoraRtcVideoCanvas *_Nonnull) | remote | |
| connectionId: | (unsigned int) | connectionId | |
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, set it later when the application receives the [userJoinedBlock]([AgoraRtcEngineKit userJoinedBlock:]) event. If the Video Recording function is enabled, the Video Recording Service joins the channel as a dumb client, which means other clients will also receive the [didJoinedOfUid]([AgoraRtcEngineDelegate rtcEngine:didJoinedOfUid:elapsed:]) event. Your application should not bind it with the view, because it does not send any video stream. If your application cannot recognize the dumb client, bind it with the view when the [firstRemoteVideoDecodedOfUid]([AgoraRtcEngineDelegate rtcEngine:firstRemoteVideoDecodedOfUid:size:elapsed:]) event is triggered. To unbind the user with the view, set the view to null. After the user has left the channel, the SDK unbinds the remote user.
| remote | AgoraRtcVideoCanvas |
| connectionId | connection ID. |
Provided by category AgoraRtcEngineKit(Ex).
| - (int) setRemoteRenderModeEx: | (NSUInteger) | uid | |
| mode: | (AgoraVideoRenderMode) | mode | |
| connectionId: | (unsigned int) | connectionId | |
Configures the remote video display mode. The application can call this method multiple times to change the display mode.
| uid | User id of the user whose video streams are received. |
| mode | AgoraVideoRenderMode |
| connectionId | connection ID. |
Provided by category AgoraRtcEngineKit(Ex).
| - (int) muteRemoteVideoStreamEx: | (NSUInteger) | uid | |
| mute: | (BOOL) | mute | |
| connectionId: | (unsigned int) | connectionId | |
Stops or resumes receiving the video stream of a specified user.
| uid | ID of the specified remote user. |
| mute | Determines whether to receive or stop receiving a specified video stream:
|
| connectionId | connection ID. |
Provided by category AgoraRtcEngineKit(Ex).
| - (BOOL) pushExternalVideoFrame: | (AgoraVideoFrame *_Nonnull) | frame | |
| connectionId: | (unsigned int) | connectionId | |
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.
| frame | Video frame containing the SDK's encoded video data to be pushed: AgoraVideoFrame. |
| connectionId | connection ID. |
YES: Success.NO: Failure. Provided by category AgoraRtcEngineKit(Ex).
| - (int) sendCustomReportMessageEx: | (NSString *_Nullable) | messageId | |
| category: | (NSString *_Nullable) | category | |
| event: | (NSString *_Nullable) | event | |
| label: | (NSString *_Nullable) | label | |
| value: | (NSInteger) | value | |
| connectionId: | (unsigned int) | connectionId | |
Provided by category AgoraRtcEngineKit(Ex).
|
readwritenonatomicweak |
Sets and retrieves the SDK delegate.
The SDK uses the delegate to inform the app on engine runtime events. All methods defined in the delegate are optional implementation methods.
1.8.18