Skip to content

Commit

Permalink
merge ios
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Oct 12, 2020
2 parents 2a230df + 12cf9cf commit 924cfb0
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions ios/RCTAgora/Base/RtcEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ protocol RtcEngineInterface:
func enableWebSdkInteroperability(_ params: NSDictionary, _ callback: Callback)

func getConnectionState(_ callback: Callback)

func sendCustomReportMessage(_ params: NSDictionary, _ callback: Callback)

func getCallId(_ callback: Callback)

Expand Down Expand Up @@ -179,6 +181,8 @@ protocol RtcEngineAudioEffectInterface {
func resumeEffect(_ params: NSDictionary, _ callback: Callback)

func resumeAllEffects(_ callback: Callback)

func setAudioSessionOperationRestriction(_ params: NSDictionary, _ callback: Callback)
}

protocol RtcEngineVoiceChangerInterface {
Expand Down Expand Up @@ -399,6 +403,10 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
it.getConnectionState().rawValue
}
}

@objc func sendCustomReportMessage(_ params: NSDictionary, _ callback: Callback) {
callback.code(engine?.sendCustomReportMessage(params["id"] as! String, category: params["category"] as! String, event: params["event"] as! String, label: params["label"] as! String, value: params["value"] as! Int))
}

@objc func getCallId(_ callback: Callback) {
callback.resolve(engine) { it in
Expand Down Expand Up @@ -651,6 +659,12 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
@objc func resumeAllEffects(_ callback: Callback) {
callback.code(engine?.resumeAllEffects())
}

@objc func setAudioSessionOperationRestriction(_ params: NSDictionary, _ callback: Callback) {
callback.resolve(engine) { it in
it.setAudioSessionOperationRestriction(AgoraAudioSessionOperationRestriction(rawValue: params["restriction"] as! UInt))
}
}

@objc func setLocalVoiceChanger(_ params: NSDictionary, _ callback: Callback) {
callback.code(engine?.setLocalVoiceChanger(AgoraAudioVoiceChanger(rawValue: params["voiceChanger"] as! Int)!))
Expand Down Expand Up @@ -874,10 +888,7 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
}

@objc func isCameraFocusSupported(_ callback: Callback) {
// TODO Not in iOS
callback.resolve(engine) { it in
nil
}
callback.code(-Int32(AgoraErrorCode.notSupported.rawValue))
}

@objc func isCameraExposurePositionSupported(_ callback: Callback) {
Expand All @@ -900,10 +911,7 @@ class RtcEngineManager: NSObject, RtcEngineInterface {
}

@objc func getCameraMaxZoomFactor(_ callback: Callback) {
// TODO Not in iOS
callback.resolve(engine) { it in
nil
}
callback.code(-Int32(AgoraErrorCode.notSupported.rawValue))
}

@objc func setCameraFocusPositionInPreview(_ params: NSDictionary, _ callback: Callback) {
Expand Down

0 comments on commit 924cfb0

Please sign in to comment.