私有化配置
更新时间: 2023/07/31 02:46:58
本文介绍呼叫组件如何将私有化配置相关参数透传给 NERTC SDK。
注意事项
- 呼叫组件集成 IM SDK 和 NERTC SDK 功能,因此呼叫组件的私有化配置需要配置 IM SDK 的私有化配置以及 NERTC SDK 的私有化配置。
- 呼叫组件没有包含 IM SDK 的初始化,因此 IM SDK 的私有化配置需要您自行实现,具体步骤请咨询网易云信技术支持工程师。
- 只有 V1.4.2 及以上的呼叫组件版本才支持私有化配置。
实现方式
以下是呼叫组件中,将私有化配置相关参数透传给 NERTC SDK的示例代码。
V2.0 版本
在初始化呼叫组件时,创建 NERtcEngineContext
方法,配置 RTC 私有化服务器相关参数。
NESetupConfig *setupConfig = [[NESetupConfig alloc] initWithAppkey:@"app key"];
NERtcEngineContext *context = [[NERtcEngineContext alloc] init];
NERtcServerAddresses *address = [[NERtcServerAddresses alloc] init];
address.channelServer = @"your channel server"; // 设置RTC私有化服务地址
...
// 设置私有化服务器地址信息
context.serverAddress = address;
setupConfig.rtcInfo = context;
[[NECallEngine sharedInstance] setup:setupConfig];
参数说明如下:
address.channelServer
:请配置 RTC 私有化服务地址,具体请参见NERtcServerAddresses。context.serverAddress
:请配置为应用服务在私有化中的 URL 地址。
V1.x 版本
在初始化呼叫组件时,配置 NERtcEngineContext
方法。
NERtcCallOptions *option = [NERtcCallOptions new];
option.APNSCerName = @"推送证书名";
NERtcEngineContext *context = [[NERtcEngineContext alloc] init];
option.supportAutoJoinWhenCalled = YES;
NERtcCallKit *callkit = [NERtcCallKit sharedInstance];
context.appKey = @"app key";
NERtcServerAddresses *serverAddress = [[NERtcServerAddresses alloc] init];
// 参考 NERtc 文档对 serverAddress 进行私有化参数配置
// 私有化服务器配置
context.serverAddress = serverAddress;
[callkit setupAppKey:@"app key" options:option withContext:context];
参数说明如下:
context.serverAddress
:请配置为应用服务在私有化中的 URL 地址。NERtcServerAddresses *serverAddress
:请参见NERtcServerAddresses。
此文档是否对你有帮助?