Skip to content

Commit

Permalink
feat: add more token expired handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tamworth committed May 17, 2024
1 parent c4eb059 commit 0244e2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions iOS/Example/CallAPI/Pure1v1RoomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ extension Pure1v1RoomViewController:CallApiListenerProtocol {
errorType: CallErrorCodeType,
errorCode: Int,
message: String?) {
if errorEvent == .rtcOccurError, errorType == .rtc, errorCode == AgoraErrorCode.tokenExpired.rawValue {
//RTC加入频道失败,需要取消呼叫,并重新获取token
self.api.cancelCall { err in
}
}
NSLog("onCallErrorOccur errorEvent:\(errorEvent.rawValue), errorType: \(errorType.rawValue), errorCode: \(errorCode), message: \(message ?? "")")
}

Expand Down
5 changes: 5 additions & 0 deletions iOS/Example/CallAPI/ShowTo1v1RoomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,11 @@ extension ShowTo1v1RoomViewController:CallApiListenerProtocol {
errorCode: Int,
message: String?) {
NSLog("onCallErrorOccur errorEvent:\(errorEvent.rawValue), errorType: \(errorType.rawValue), errorCode: \(errorCode), message: \(message ?? "")")
if errorEvent == .rtcOccurError, errorType == .rtc, errorCode == AgoraErrorCode.tokenExpired.rawValue {
//RTC加入频道失败,需要取消呼叫,并重新获取token
self.api.cancelCall { err in
}
}
}

@objc func callDebugInfo(message: String, logLevel: CallLogLevel) {
Expand Down

0 comments on commit 0244e2e

Please sign in to comment.