Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraLiveDelegate> Protocol Reference

Inherits <NSObjectNSObject>.

Instance Methods

(void) - liveKit:didOccurWarning:
 
(void) - liveKit:didOccurError:
 
(void) - liveKit:didJoinChannel:withUid:elapsed:
 
(void) - liveKitDidLeaveChannel:
 
(void) - liveKit:didRejoinChannel:withUid:elapsed:
 
(void) - liveKitRequestToken:
 
(void) - liveKit:tokenPrivilegeWillExpire:
 
(void) - liveKit:reportLiveStats:
 
(void) - liveKitConnectionDidInterrupted:
 
(void) - liveKitConnectionDidLost:
 
(void) - liveKit:networkQuality:txQuality:rxQuality:
 

Detailed Description

Protocol providing the AgoraLiveKit class with callbacks.

Method Documentation

◆ liveKit:didOccurWarning:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
didOccurWarning: (AgoraWarningCode)  warningCode 
optional

A warning occurred during SDK runtime.

The app can ignore the warning, and the SDK tries to resume automatically.

Parameters
kitAgoraLiveKit
warningCodeAgoraWarningCode

◆ liveKit:didOccurError:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
didOccurError: (AgoraErrorCode)  errorCode 
optional

An error occurred during SDK runtime.

The SDK cannot resume a normal state, and the app needs to handle it.

Parameters
kitAgoraLiveKit
errorCodeAgoraErrorCode

◆ liveKit:didJoinChannel:withUid:elapsed:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
didJoinChannel: (NSString *_Nonnull)  channel
withUid: (NSUInteger)  uid
elapsed: (NSInteger)  elapsed 
optional

A user joined the channel.

Parameters
kitAgoraLiveKit
channelChannel name
uidLocal user ID
elapsedTime elapsed (ms) from the beginning of the session

◆ liveKitDidLeaveChannel:

- (void) liveKitDidLeaveChannel: (AgoraLiveKit *_Nonnull)  kit
optional

The statistics of the call when leaving a channel

Parameters
kitAgoraLiveKit

◆ liveKit:didRejoinChannel:withUid:elapsed:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
didRejoinChannel: (NSString *_Nonnull)  channel
withUid: (NSUInteger)  uid
elapsed: (NSInteger)  elapsed 
optional

A user rejoined the channel

Parameters
kitAgoraLiveKit
channelChannel name
uidUser id
elapsedTime elapsed (ms) from the beginning of the session

◆ liveKitRequestToken:

- (void) liveKitRequestToken: (AgoraLiveKit *_Nonnull)  kit
optional

Generates a new Token.

When the Token is enabled, and the specified Token is invalid or has expired, this function will be called. The app should generate a new Token and call renewToken to refresh the key.

NOTE: To be compatible with previous versions, AgoraErrorCodeTokenExpired = 109 and AgoraErrorCodeInvalidToken = 110 are also reported through the [didOccurError](liveKit:didOccurError:) callback. You should move the renew token logic into this callback.

Parameters
kitAgoraLiveKit

◆ liveKit:tokenPrivilegeWillExpire:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
tokenPrivilegeWillExpire: (NSString *_Nonnull)  token 
optional

The token privilege will expire.

If the Token you specified when calling [joinChannelByToken](joinChannelByToken:channelId:info:uid:joinSuccess:) expires, you will become offline. This callback is triggered 30 seconds before the Token expires to remind the app to renew the Token.

Upon receiving this callback, the user needs to generate a new Token on your server and call renewToken to pass the new Token on to the SDK.

Parameters
kitAgoraLiveKit
tokenThe Token that will expire in 30 seconds.

◆ liveKit:reportLiveStats:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
reportLiveStats: (AgoraChannelStats *_Nonnull)  stats 
optional

The statistics of the RTC AgoraLiveKit status every two seconds.

Parameters
kitAgoraLiveKit
statsStatistics of the RTC status, including the duration, sent bytes, and received bytes

◆ liveKitConnectionDidInterrupted:

- (void) liveKitConnectionDidInterrupted: (AgoraLiveKit *_Nonnull)  kit
optional

The SDK disconnected from the server.

This event is reported when the SDK loses connection to the server. The SDK tries to automatically reconnect with the server until the app calls [leaveChannel]([AgoraLiveKit leaveChannel]).

Parameters
kitAgoraLiveKit

◆ liveKitConnectionDidLost:

- (void) liveKitConnectionDidLost: (AgoraLiveKit *_Nonnull)  kit
optional

The connection to the server is lost.

This event is reported after the connection to the server is interrupted and the reconnection time has exceeded (10 seconds by default). The SDK tries to automatically reconnect with the server until the app calls [leaveChannel]([AgoraLiveKit leaveChannel]).

Parameters
kitAgoraLiveKit

◆ liveKit:networkQuality:txQuality:rxQuality:

- (void) liveKit: (AgoraLiveKit *_Nonnull)  kit
networkQuality: (NSUInteger)  uid
txQuality: (AgoraNetworkQuality txQuality
rxQuality: (AgoraNetworkQuality rxQuality 
optional

The network quality of the local user.

Parameters
kitAgoraLiveKit
uidUser ID
txQualityNetwork transmission quality: AgoraNetworkQuality
rxQualityNetwork receiving quality: AgoraNetworkQuality