CallLib 2.X 升级到 5.X
本文描述 CallLib SDK 的升级步骤。
升级概述
CallLib SDK 5.X 对比 2.X,适配了 iPhone 新机型与新系统,使用起来更加稳定,并在之前版本上修复了大量问题,建议尽早升级至新版 CallLib SDK。
前置条件
- 5.X CallLib SDK 依赖 RongIMLibCore 请您确保已将 RongIMLibCore 升级至 5.X。
- RongIMLib SDK 5.X 做了拆分,请遵照 IMLib 的升级文档先将使用对应功能的 SDK 进行升级集成。
- 已遵照 IMLib 升级要求将您的 Cocoapod 版本升级到 1.10.0 以上。
手动集成
- 
将原先 SDK 依赖的系统库全部去掉,如果 App 或者其他 SDK 有依赖的系统库除外 - AssetsLibrary
- MapKit
- ImageIO
- Security
- SystemConfiguration
- QuartzCore
- AVFoundation
- GLKit
- OpenGLES
- CoreGraphics
- CoreLocation
- CoreTelephony
- CoreFoundation
- CoreMedia
- CoreAudio
- CoreVideo
- CFNetwork
- AudioToolbox
- VideoToolBox
- AVFoundation
- libc++.tbd
- libz.tbd
- libbz2.tbd
- libiconv.tbd
- libsqlite3.tbd
 
- 
将 2.X 的 RongCallLib.framework、RongRTCLib.framework、RongIMLib.framework、libopencore-amrnb.a (该库包含在 RongIMLib 软件包中) 删除并替换为 5.X 的 RongRTCLib.xcframework、RongIMLibCore.xcframework、RongCallLib.xcframework 
- 
General -> Frameworks,Libraries,and Embedded Binaries 中将 RongXX.framework 的 Embed 设置为 Embed & Sign 
pod 集成
- 
在 podfile 中添加如下内容 rubypod 'RongCloudRTC/RongCallLib', '~> x.y.z'
- 
请在终端中运行以下命令 rubypod install如果出现找不到相关版本的问题,可先执行 pod repo update ,再执行 pod install 。 
接口替换说明
初始化接口
将原有 AppKey 初始化方法进行替换
#import <RongIMLibCore/RongIMLibCore.h>
[[RCCoreClient sharedCoreClient] initWithAppKey:@"从控制台申请的 AppKey"];
连接接口
将原有连接 IM 方法进行替换
// 连接 IM 服务
[[RCCoreClient sharedCoreClient] connectWithToken:@"从您服务器端获取的 Token"
                                         dbOpened:^(RCDBErrorCode code) {}
                                          success:^(NSString *userId) {}
                                            error:^(RCConnectErrorCode status) {}];
接收到取消通话的远程通知的回调方法
将原有 didCancelCallRemoteNotification:inviterUserId:mediaType:userIdList: 接口替换为
- (void)didCancelCallRemoteNotification:(nullable NSString *)callId
                          inviterUserId:(nullable NSString *)inviterUserId
                              mediaType:(RCCallMediaType)mediaType
                             userIdList:(nullable NSArray<NSString *> *)userIdList
                             pushConfig:(nullable RCMessagePushConfig *)pushConfig
                         isRemoteCancel:(BOOL)isRemoteCancel;
将原有 didReceiveCallRemoteNotification:inviterUserId:mediaType:userIdList:userDict: 与 didReceiveCallRemoteNotification:inviterUserId:mediaType:userIdList:userDict:isVoIPPush: 接口统一替换为
- (void)didReceiveCallRemoteNotification:(nullable NSString *)callId
                           inviterUserId:(nullable NSString *)inviterUserId
                               mediaType:(RCCallMediaType)mediaType
                              userIdList:(nullable NSArray<NSString *> *)userIdList
                                userDict:(nullable NSDictionary *)userDict
                              isVoIPPush:(BOOL)isVoIPPush
                              pushConfig:(nullable RCMessagePushConfig *)pushConfig;
本地视频数据上报
本地数据上报接口由 processVideoFrame: 接口替换为
/*!
 摄像头采集视频帧数据上报
 @param pixelBuffer 摄像头采集视频帧数据
 @discussion
 当前视频通话摄像头采集视频帧数据回调,如果修改了该视频数据,会影响显示本地和发送视频帧数据
 @remarks 代理
 */
- (void)processCaptureVideoFrame:(nullable CVPixelBufferRef)pixelBuffer;
原有的控制此回调接口的开关 setEnableBeauty: 废弃,默认实现该接口后会主动回调。