This article will introduce the instructions and precautions when upgrading the Express SDK version to version 3.0.0 or later.
Discard the three scenarios of General, Communication, and Live in the ZegoScenario scene enumeration. Please refer to the Scenario Audio and Video Configuration document for adaptation.
From version 3.0.0, the Express iOS SDK no longer supports bitcode. For details, please refer to Xcode 14 Release Notes for instructions on deprecating bitcode.
Adaptation method: Open the configuration page of the Xcode project, find the "Enable Bitcode" option in the "Build Settings" page of the App Target, and set it to "No".
Removed the following interfaces that were deprecated in previous versions.
| method name | Description |
|---|---|
| SetDebugVerbose | Set debug detail switch and Language. This function is deprecated in version 2.3.0, please use EnableDebugAssistant to implement the original function. |
| LoginMultiRoom | Multiple Rooms to MultiRoom. This method is deprecated after version 2.9.0. To implement multi-room function, please call SetRoomMode function to set multi-room mode before engine initialization, and then use LoginRoom to Multiple Rooms. If calling LoginRoom function to Multiple Rooms , please make sure to pass in the same user information. |
| SetPlayStreamVideoLayer | Set to select the Video layer for play streams video. This function is deprecated after version 2.3.0, please use SetPlayStreamVideoType instead. |
| EnableAudioDataCallback | Enable additional callback for receiving Audio data. This function is deprecated since version 2.7.0, please use StartAudioDataObserver and StopAudioDataObserver instead. |
| SetBuiltInSpeakerOn | Whether to use the built-in speaker to play sound. This function is deprecated after version 2.3.0, please use SetAudioRouteToSpeaker instead. |
| OnDeviceError | Device exception notification. This function is deprecated in version 2.15.0 and above, please use OnLocalDeviceExceptionOccurred instead. |
You can refer to the following sample code to make interface changes.
ZegoExpressEngine.GetEngine().SetDebugVerbose(true, ZegoLanguage.English);
// Note, do not enable this feature in the online version! Use only during development phase!
// Note, do not enable this feature in the online version! Use only during development phase!"
ZegoExpressEngine.GetEngine().EnableDebugAssistant(true);
ZegoExpressEngine.CreateEngine(profile, null);
ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.GetEngine().LoginRoom("first_room", user);
ZegoExpressEngine.GetEngine().LoginMultiRoom("second_room", null);
For related interface usage, please refer to the Multiple Rooms documentation.
// Must be set before calling [createEngine] to take effect, otherwise it will fail.
// Must be set before calling [createEngine] to take effect, otherwise it will fail.
ZegoExpressEngine.SetRoomMode(ZegoRoomMode.MULTI_ROOM);
ZegoExpressEngine.CreateEngine(profile, null);
ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.GetEngine().LoginRoom("first_room", user);
ZegoExpressEngine.GetEngine().LoginRoom("second_room", user);
ZegoExpressEngine.GetEngine().SetPlayStreamVideoLayer("stream1", ZegoPlayerVideoLayer.Auto);
For related interface usage, please refer to the Set Video Encoding Method document.
ZegoExpressEngine.GetEngine().SetPlayStreamVideoType("stream1", ZegoVideoStreamType.Default);
int bitmask = ZegoAudioDataCallbackBitMask.Captured | ZegoAudioDataCallbackBitMask.Player;
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannel.Mono;
// Start
ZegoExpressEngine.GetEngine().SetAudioDataHandler(handler);
ZegoExpressEngine.GetEngine().EnableAudioDataCallback(true, bitmask, param);
// Stop
ZegoExpressEngine.GetEngine().SetAudioDataHandler(null);
ZegoExpressEngine.GetEngine().EnableAudioDataCallback(false, bitmask, param);
int bitmask = ZegoAudioDataCallbackBitMask.Captured | ZegoAudioDataCallbackBitMask.Player;
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannel.Mono;
// Start
ZegoExpressEngine.getEngine().SetAudioDataHandler(handler);
ZegoExpressEngine.getEngine().StartAudioDataObserver(bitmask, param);
// Stop
ZegoExpressEngine.getEngine().SetAudioDataHandler(null);
ZegoExpressEngine.getEngine().StopAudioDataObserver();
ZegoExpressEngine.GetEngine().SetBuiltInSpeakerOn(true);
ZegoExpressEngine.GetEngine().SetAudioRouteToSpeaker(true);
public void OnDeviceError(int errorCode, string deviceName) {
// Handle device error
// Handling device errors
}
engine.onDeviceError = OnDeviceError;
public void OnLocalDeviceExceptionOccurred(ZegoDeviceExceptionType exceptionType, ZegoDeviceType deviceType, string deviceID) {
// Handle device error
// Handling device errors
}
engine.onLocalDeviceExceptionOccurred = OnLocalDeviceExceptionOccurred;
