Skip to content

Commit 52983cf

Browse files
author
Xia Ning
committed
adapt 3.5.200
1 parent 9f77b92 commit 52983cf

15 files changed

Lines changed: 946 additions & 851 deletions

File tree

iOS/APIExample.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,8 @@
12401240
baseConfigurationReference = FAAC2AEE355D103B9E8527B5 /* Pods-Agora-ScreenShare-Extension.debug.xcconfig */;
12411241
buildSettings = {
12421242
CLANG_ENABLE_MODULES = YES;
1243-
CODE_SIGN_IDENTITY = "Apple Development";
1244-
CODE_SIGN_STYLE = Automatic;
1243+
CODE_SIGN_IDENTITY = "iPhone Developer: Haifeng Hong (MJP2F92AG6)";
1244+
CODE_SIGN_STYLE = Manual;
12451245
DEVELOPMENT_TEAM = JDPG69R49Z;
12461246
FRAMEWORK_SEARCH_PATHS = (
12471247
"$(inherited)",
@@ -1260,7 +1260,7 @@
12601260
);
12611261
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.example.Agora-ScreenShare-Extension";
12621262
PRODUCT_NAME = "$(TARGET_NAME)";
1263-
PROVISIONING_PROFILE_SPECIFIER = "";
1263+
PROVISIONING_PROFILE_SPECIFIER = AgoraLab2020;
12641264
SKIP_INSTALL = YES;
12651265
SWIFT_OBJC_BRIDGING_HEADER = "Agora-ScreenShare-Extension/Agora-ScreenShare-Extension-Bridging-Header.h";
12661266
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -1274,8 +1274,8 @@
12741274
baseConfigurationReference = 92EACE913B50B28F1588FE03 /* Pods-Agora-ScreenShare-Extension.release.xcconfig */;
12751275
buildSettings = {
12761276
CLANG_ENABLE_MODULES = YES;
1277-
CODE_SIGN_IDENTITY = "Apple Development";
1278-
CODE_SIGN_STYLE = Automatic;
1277+
CODE_SIGN_IDENTITY = "iPhone Developer: Haifeng Hong (MJP2F92AG6)";
1278+
CODE_SIGN_STYLE = Manual;
12791279
DEVELOPMENT_TEAM = JDPG69R49Z;
12801280
FRAMEWORK_SEARCH_PATHS = (
12811281
"$(inherited)",
@@ -1294,7 +1294,7 @@
12941294
);
12951295
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.example.Agora-ScreenShare-Extension";
12961296
PRODUCT_NAME = "$(TARGET_NAME)";
1297-
PROVISIONING_PROFILE_SPECIFIER = "";
1297+
PROVISIONING_PROFILE_SPECIFIER = AgoraLab2020;
12981298
SKIP_INSTALL = YES;
12991299
SWIFT_OBJC_BRIDGING_HEADER = "Agora-ScreenShare-Extension/Agora-ScreenShare-Extension-Bridging-Header.h";
13001300
SWIFT_VERSION = 5.0;
@@ -1425,8 +1425,8 @@
14251425
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
14261426
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
14271427
CLANG_ENABLE_MODULES = YES;
1428-
CODE_SIGN_IDENTITY = "Apple Development";
1429-
CODE_SIGN_STYLE = Automatic;
1428+
CODE_SIGN_IDENTITY = "iPhone Developer: Haifeng Hong (MJP2F92AG6)";
1429+
CODE_SIGN_STYLE = Manual;
14301430
DEVELOPMENT_TEAM = JDPG69R49Z;
14311431
FRAMEWORK_SEARCH_PATHS = (
14321432
"$(inherited)",
@@ -1440,7 +1440,7 @@
14401440
);
14411441
PRODUCT_BUNDLE_IDENTIFIER = io.agora.api.example;
14421442
PRODUCT_NAME = "$(TARGET_NAME)";
1443-
PROVISIONING_PROFILE_SPECIFIER = "";
1443+
PROVISIONING_PROFILE_SPECIFIER = AgoraLab2020;
14441444
SWIFT_OBJC_BRIDGING_HEADER = "APIExample/APIExample-Bridging-Header.h";
14451445
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
14461446
SWIFT_VERSION = 5.0;
@@ -1455,8 +1455,8 @@
14551455
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
14561456
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
14571457
CLANG_ENABLE_MODULES = YES;
1458-
CODE_SIGN_IDENTITY = "Apple Development";
1459-
CODE_SIGN_STYLE = Automatic;
1458+
CODE_SIGN_IDENTITY = "iPhone Developer: Haifeng Hong (MJP2F92AG6)";
1459+
CODE_SIGN_STYLE = Manual;
14601460
DEVELOPMENT_TEAM = JDPG69R49Z;
14611461
FRAMEWORK_SEARCH_PATHS = (
14621462
"$(inherited)",
@@ -1470,7 +1470,7 @@
14701470
);
14711471
PRODUCT_BUNDLE_IDENTIFIER = io.agora.api.example;
14721472
PRODUCT_NAME = "$(TARGET_NAME)";
1473-
PROVISIONING_PROFILE_SPECIFIER = "";
1473+
PROVISIONING_PROFILE_SPECIFIER = AgoraLab2020;
14741474
SWIFT_OBJC_BRIDGING_HEADER = "APIExample/APIExample-Bridging-Header.h";
14751475
SWIFT_VERSION = 5.0;
14761476
TARGETED_DEVICE_FAMILY = "1,2";

iOS/APIExample/Common/AgoraExtension.swift

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,30 @@ extension AgoraAudioScenario {
8282
func description() -> String {
8383
switch self {
8484
case .default: return "Default".localized
85-
case .chatRoomGaming: return "Chat Room Gaming".localized
86-
case .education: return "Education".localized
8785
case .gameStreaming: return "Game Streaming".localized
88-
case .chatRoomEntertainment: return "Chat Room Entertainment".localized
89-
case .showRoom: return "Show Room".localized
86+
case .highDefinition: return "High Defination".localized
9087
default:
9188
return "\(self.rawValue)"
9289
}
9390
}
9491

9592
static func allValues() -> [AgoraAudioScenario] {
96-
return [.default, .chatRoomGaming, .education, .gameStreaming, .chatRoomEntertainment, .showRoom]
93+
return [.default, .gameStreaming, .highDefinition]
9794
}
9895
}
9996

10097
extension AgoraEncryptionMode {
10198
func description() -> String {
10299
switch self {
103-
case .AES128XTS: return "AES128XTS"
104-
case .AES256XTS: return "AES256XTS"
105-
case .AES128ECB: return "AES128ECB"
106-
case .SM4128ECB: return "SM4128ECB"
100+
case .AES128GCM: return "AES128GCM"
101+
case .AES256GCM: return "AES256GCM"
107102
default:
108103
return "\(self.rawValue)"
109104
}
110105
}
111106

112107
static func allValues() -> [AgoraEncryptionMode] {
113-
return [.AES128XTS, .AES256XTS, .AES128ECB, .SM4128ECB]
108+
return [.AES128GCM, .AES256GCM]
114109
}
115110
}
116111

@@ -142,27 +137,67 @@ extension AgoraAudioVoiceChanger {
142137
}
143138
}
144139

140+
extension AgoraVoiceBeautifierPreset{
141+
func description() -> String {
142+
switch self {
143+
case .presetOff:return "Off".localized
144+
case .presetChatBeautifierFresh:return "FemaleFresh".localized
145+
case .presetChatBeautifierMagnetic:return "MaleMagnetic".localized
146+
case .presetChatBeautifierVitality:return "FemaleVitality".localized
147+
case .timbreTransformationVigorous:return "Vigorous".localized
148+
case .timbreTransformationDeep:return "Deep".localized
149+
case .timbreTransformationMellow:return "Mellow".localized
150+
case .timbreTransformationFalsetto:return "Falsetto".localized
151+
case .timbreTransformationFull:return "Full".localized
152+
case .timbreTransformationClear:return "Clear".localized
153+
case .timbreTransformationResounding:return "Resounding".localized
154+
case .timbreTransformatRinging:return "Ringing".localized
155+
default:
156+
return "\(self.rawValue)"
157+
}
158+
}
159+
}
160+
145161
extension AgoraAudioReverbPreset {
146162
func description() -> String {
147163
switch self {
148164
case .off:return "Off".localized
149165
case .fxUncle:return "FxUncle".localized
150166
case .fxSister:return "FxSister".localized
151167
case .fxPopular:return "Pop".localized
152-
// case .popular:return "Pop(Old Version)".localized
153168
case .fxRNB:return "R&B".localized
154-
// case .rnB:return "R&B(Old Version)".localized
155-
// case .rock:return "Rock".localized
156-
// case .hipHop:return "HipHop".localized
157169
case .fxVocalConcert:return "Vocal Concert".localized
158-
// case .vocalConcert:return "Vocal Concert(Old Version)".localized
159170
case .fxKTV:return "KTV".localized
160-
// case .KTV:return "KTV(Old Version)".localized
161171
case .fxStudio:return "Studio".localized
162-
// case .studio:return "Studio(Old Version)".localized
163172
case .fxPhonograph:return "Phonograph".localized
164-
//TODO
165-
// case .virtualStereo:return "Virtual Stereo".localized
173+
default:
174+
return "\(self.rawValue)"
175+
}
176+
}
177+
}
178+
179+
extension AgoraAudioEffectPreset {
180+
func description() -> String {
181+
switch self {
182+
case .off:return "Off".localized
183+
case .voiceChangerEffectUncle:return "FxUncle".localized
184+
case .voiceChangerEffectOldMan:return "Old Man".localized
185+
case .voiceChangerEffectBoy:return "Baby Boy".localized
186+
case .voiceChangerEffectSister:return "FxSister".localized
187+
case .voiceChangerEffectGirl:return "Baby Girl".localized
188+
case .voiceChangerEffectPigKin:return "ZhuBaJie".localized
189+
case .voiceChangerEffectHulk:return "Hulk".localized
190+
case .styleTransformationRnb:return "R&B".localized
191+
case .styleTransformationPopular:return "Pop".localized
192+
case .roomAcousticsKTV:return "KTV".localized
193+
case .roomAcousVocalConcer:return "Vocal Concert".localized
194+
case .roomAcousStudio:return "Studio".localized
195+
case .roomAcousPhonograph:return "Phonograph".localized
196+
case .roomAcousVirtualStereo:return "Virtual Stereo".localized
197+
case .roomAcousSpatial:return "Spacial".localized
198+
case .roomAcousEthereal:return "Ethereal".localized
199+
case .roomAcous3DVoice:return "3D Voice".localized
200+
case .pitchCorrection:return "Pitch Correction".localized
166201
default:
167202
return "\(self.rawValue)"
168203
}
@@ -202,6 +237,25 @@ extension AgoraAudioReverbType {
202237
}
203238
}
204239

240+
extension AgoraVoiceConversionPreset {
241+
func description() -> String {
242+
switch self {
243+
case .off:
244+
return "Off".localized
245+
case .neutral:
246+
return "Neutral".localized
247+
case .sweet:
248+
return "Sweet".localized
249+
case .changerSolid:
250+
return "Solid".localized
251+
case .changerBass:
252+
return "Bass".localized
253+
@unknown default:
254+
return "\(self.rawValue)"
255+
}
256+
}
257+
}
258+
205259
extension UIAlertController {
206260
func addCancelAction() {
207261
self.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))

iOS/APIExample/Examples/Advanced/JoinMultiChannel/JoinMultiChannel.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@ class JoinMultiChannelMain: BaseViewController, AgoraRtcEngineDelegate {
128128
}
129129

130130
// join channel2
131-
let connectionIdPointer2 = UnsafeMutablePointer<UInt32>.allocate(capacity: MemoryLayout<UInt32>.stride)
131+
let connectionIdPointer2 = UnsafeMutablePointer<UInt>.allocate(capacity: MemoryLayout<UInt>.stride)
132132
mediaOptions = AgoraRtcChannelMediaOptions()
133133
// publish custom video track for channel 2
134134
mediaOptions.publishAudioTrack = .of(false)
135135
mediaOptions.publishCustomVideoTrack = .of(true)
136136
mediaOptions.channelProfile = .of((Int32)(AgoraChannelProfile.liveBroadcasting.rawValue))
137137
mediaOptions.clientRoleType = .of((Int32)(AgoraClientRole.broadcaster.rawValue))
138138
result = agoraKit.joinChannelEx(byToken: nil, channelId: channelName2, uid: 0, connectionId: connectionIdPointer2, delegate: channel2, mediaOptions: mediaOptions)
139-
channel2.connectionId = connectionIdPointer2.pointee
140-
connectionId2 = connectionIdPointer2.pointee
139+
channel2.connectionId = UInt32(connectionIdPointer2.pointee)
140+
connectionId2 = UInt32(connectionIdPointer2.pointee)
141141
channel2.connecitonDelegate = self
142142
connectionIdPointer2.deallocate()
143143
if result != 0 {
@@ -153,8 +153,8 @@ class JoinMultiChannelMain: BaseViewController, AgoraRtcEngineDelegate {
153153
if parent == nil {
154154
imageSource.stopSource()
155155
// leave channel when exiting the view
156-
agoraKit.leaveChannelEx(channelName1, connectionId: connectionId1 ?? 0, leaveChannelBlock: nil)
157-
agoraKit.leaveChannelEx(channelName2, connectionId: connectionId2 ?? 0, leaveChannelBlock: nil)
156+
agoraKit.leaveChannelEx(channelName1, connectionId: UInt(connectionId1 ?? 0), leaveChannelBlock: nil)
157+
agoraKit.leaveChannelEx(channelName2, connectionId: UInt(connectionId2 ?? 0), leaveChannelBlock: nil)
158158
}
159159
}
160160
}
@@ -170,7 +170,7 @@ extension JoinMultiChannelMain : AgoraYUVImageSourcePushDelegate {
170170
videoFrame.strideInPixels = Int32(size.width)
171171
videoFrame.height = Int32(size.height)
172172
videoFrame.rotation = Int32(rotation)
173-
agoraKit.pushExternalVideoFrame(videoFrame, connectionId: connectionId)
173+
agoraKit.pushExternalVideoFrame(videoFrame, connectionId: UInt(connectionId))
174174
}
175175
}
176176

@@ -198,7 +198,7 @@ extension JoinMultiChannelMain :JoinMultiChannelMainConnectionProtocol {
198198
// the view to be binded
199199
videoCanvas.view = connectionId == connectionId1 ? channel1RemoteVideo.videoView : channel2RemoteVideo.videoView
200200
videoCanvas.renderMode = .hidden
201-
agoraKit.setupRemoteVideoEx(videoCanvas, connectionId: connectionId)
201+
agoraKit.setupRemoteVideoEx(videoCanvas, connectionId: UInt(connectionId))
202202
}
203203

204204
func rtcEngine(_ engine: AgoraRtcEngineKit, connectionId: UInt32, didOfflineOfUid uid: UInt, reason: AgoraUserOfflineReason) {
@@ -212,7 +212,7 @@ extension JoinMultiChannelMain :JoinMultiChannelMainConnectionProtocol {
212212
// the view to be binded
213213
videoCanvas.view = nil
214214
videoCanvas.renderMode = .hidden
215-
agoraKit.setupRemoteVideoEx(videoCanvas, connectionId: connectionId)
215+
agoraKit.setupRemoteVideoEx(videoCanvas, connectionId: UInt(connectionId))
216216
}
217217

218218

iOS/APIExample/Examples/Advanced/StreamEncryption/StreamEncryption.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class StreamEncryptionEntry : UIViewController
1616
@IBOutlet weak var channelTextField: UITextField!
1717
@IBOutlet weak var encryptSecretField: UITextField!
1818
@IBOutlet weak var encryptModeBtn: UIButton!
19-
var mode:AgoraEncryptionMode = .AES128XTS
19+
var mode:AgoraEncryptionMode = .AES128GCM
2020
var useCustom:Bool = false
2121
let identifier = "StreamEncryption"
2222

@@ -104,6 +104,7 @@ class StreamEncryptionMain: BaseViewController {
104104
let config = AgoraEncryptionConfig()
105105
config.encryptionMode = mode
106106
config.encryptionKey = secret
107+
config.encryptionKdfSalt = getEncryptionSaltFromServer()
107108
let ret = agoraKit.enableEncryption(true, encryptionConfig: config)
108109
if ret != 0 {
109110
// for errors please take a look at:
@@ -155,6 +156,11 @@ class StreamEncryptionMain: BaseViewController {
155156
}
156157
}
157158

159+
func getEncryptionSaltFromServer() -> Data {
160+
161+
return "EncryptionKdfSaltInBase64Strings".data(using: .utf8)!
162+
}
163+
158164
override func willMove(toParent parent: UIViewController?) {
159165
if parent == nil {
160166
// leave channel when exiting the view

0 commit comments

Comments
 (0)