AgoraRtcEngineConfig
配置 AgoraRtcEngineKit 实例的参数。
Objective-C
__attribute__((visibility("default"))) @interface AgoraRtcEngineConfig: NSObject
@property (copy, nonatomic) NSString * _Nullable appId;
@property (assign, nonatomic) AgoraChannelProfile channelProfile;
@property (copy, nonatomic) NSString * _Nullable license;
@property (assign, nonatomic) AgoraAudioScenario audioScenario;
@property (assign, nonatomic) AgoraAreaCodeType areaCode;
@property (strong, nonatomic) AgoraLogConfig * _Nullable logConfig;
@property (assign, nonatomic) AgoraThreadPriorityType threadPriority;
@property (weak, nonatomic) id<AgoraMediaFilterEventDelegate> _Nullable eventDelegate;
@property (assign, nonatomic) BOOL domainLimit;
@property (assign, nonatomic) BOOL autoRegisterAgoraExtensions;
@end
appId
由声网为你的项目签发的 App ID。只有使用相同 App ID 的用户才能加入同一个频道并互相通信。一个 App ID 只能用于创建一个 AgoraRtcEngineKit 实例。如需更换 App ID,需先调用 destroy 销毁当前实例,再创建新的实例。
channelProfile
频道场景,详见 AgoraChannelProfile。
license
用于连接频道时验证的 License。根据 License 收费。
audioScenario
音频场景。在不同音频场景下,设备使用不同的音量类型。详见 AgoraAudioScenario。
areaCode
连接区域。该高级功能适用于有区域限制的场景。支持的区域详见 AgoraAreaCodeType。区域码支持按位操作。
logConfig
日志配置。默认情况下,SDK 会生成五个 SDK 日志文件和五个 API 调用日志文件,文件大小为 2,048 KB,采用 UTF-8 编码。日志轮转规则详见注释。详见 AgoraLogConfig。
threadPriority
SDK 通用线程的线程优先级。
eventDelegate
domainLimit
是否启用域名限制:
- YES:启用域名限制。适用于物联网设备使用物联网卡接入网络的场景。SDK 仅连接已向运营商报备的域名或 IP 白名单中的服务器。
- NO:(默认)不启用域名限制。适用于大多数常见场景。
autoRegisterAgoraExtensions
初始化 AgoraRtcEngineKit 时是否自动注册声网扩展:
- YES:(默认)自动注册。
- NO:不自动注册。需调用 enableExtensionWithVendor:extension:enabled:sourceType: 手动注册。