Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Instance Methods | |
(AgoraRtcEngineKit *_Nonnull) | - getRtcEngineKit |
(int) | - joinChannelByToken:channelId:config:uid: |
(int) | - leaveChannel |
(int) | - renewToken: |
(int) | - startPreview:renderMode: |
(int) | - stopPreview |
Class Methods | |
(NSString *_Nonnull) | + getSdkVersion |
(instancetype _Nonnull) | + sharedLiveKitWithAppId: |
(void) | + destroy |
Properties | |
_Nullable id< AgoraLiveDelegate > | delegate |
The base class for managing a live broadcast: Manages the channel and all actions apart from publishing and subscribing.
+ (NSString *_Nonnull) getSdkVersion |
Returns the version of the Agora SDK.
- (AgoraRtcEngineKit *_Nonnull) getRtcEngineKit |
Returns the native handler of the SDK engine
+ (instancetype _Nonnull) sharedLiveKitWithAppId: | (NSString *_Nonnull) | appId |
Initializes the AgoraLiveKit object.
appId | The appId is issued to the application developers by Agora. |
+ (void) destroy |
Destroys the engine instance.
This method releases all the resources used by the Agora SDK. This is useful for applications that occasionally make voice calls, to free up resources for other operations when not making calls.
Once the application has called destroy to destroy the created RtcEngine instance, no other methods in the SDK can be used and no callbacks occur.
To start communications again, initialize sharedEngineWithappId to establish a new AgoraRtcEngineKit instance.
Note: This method is called synchronously. The result returns after the IRtcEngine object resources are released. The app should not call this interface in the callback generated by the SDK, otherwise the SDK must wait for the callback to return before it can reclaim the related object resources, causing a deadlock.
- (int) joinChannelByToken: | (NSString *_Nullable) | token | |
channelId: | (NSString *_Nonnull) | channelId | |
config: | (AgoraLiveChannelConfig *_Nonnull) | channelConfig | |
uid: | (NSUInteger) | uid | |
Core Methods Allows a user to join a channel.
This method creates an open UDP socket to the AgoraLiveKit cloud service in order to join a channel. Users in the same channel can talk to each other using the same App ID. This method is asynchronous.
token | A Token generated by the app through signature certification. |
channelId | Channel ID. Joining a channel with the same channel ID means that users are joining the same room. The channel ID supported scope: a-z, A-Z, 0-9, space, !#$%&, ()+,-, :;<=., >?@[], ^_, {|}, ~ |
config | AgoraLiveChannelConfig |
uid | Optional: ID of each user in the channel that is unique. If it is set as 0, the SDK automatically assigns an ID, which can be found in the [didJoinChannel]([AgoraLiveDelegate liveKit:didJoinChannel:withUid:elapsed:]) delegate. |
- (int) leaveChannel |
Allows a user to leave a channel, such as hanging up or exiting a call.
- (int) renewToken: | (NSString *_Nonnull) | token |
Updates the Token.
The key expires after a certain period of time once the Token scheme is enabled. When the [didOccurError]([AgoraLiveDelegate liveKit:didOccurError:]) callback reports the error ERR_TOKEN_EXPIRED(109), the application should retrieve a new key and then call this method to renew it. Failure to do so will result in the SDK disconnecting from the server.
token | New Token. |
- (int) startPreview: | (VIEW_CLASS *_Nonnull) | view | |
renderMode: | (AgoraVideoRenderMode) | mode | |
Starts the local video preview.
Before starting the preview, always call the setupLocalVideo:local: method to set up the preview window and configure its attributes and also call the enableVideo method to enable video. If before calling [joinChannelByToken](joinChannelByToken:channelId:info:uid:joinSuccess:) to join the channel, you have called startPreview to start the local video preview, then the local preview will be still in the started state after you called [leaveChannel]([AgoraLiveKit leaveChannel]) to exit the channel. You can call stopPreview to close the local preview.
renderMode | AgoraVideoRenderMode |
- (int) stopPreview |
Stops the local video preview.
- (int) sendCustomReportMessage: | (NSString *_Nullable) | id | |
category: | (NSString *_Nullable) | category | |
event: | (NSString *_Nullable) | event | |
label: | (NSString *_Nullable) | label | |
value: | (NSInteger) | value | |
connectionId: | (NSUInteger) | connectionId | |
- (int) setLogLevel: | (LogLevel) | level |
|
readwritenonatomicweak |
Protocol providing the AgoraLiveKit class with callbacks.