RtcEngineContext
Configurations for the RtcEngineContext instance.
@JsonSerializable(explicitToJson: true, includeIfNull: false) class RtcEngineContext { const RtcEngineContext( {this.appId, this.channelProfile, this.audioScenario, this.areaCode, this.logConfig, this.threadPriority, this.domainLimit, this.autoRegisterAgoraExtensions}); @JsonKey(name: 'appId') final String? appId; @JsonKey(name: 'channelProfile') final ChannelProfileType? channelProfile; @JsonKey(name: 'audioScenario') final AudioScenarioType? audioScenario; @JsonKey(name: 'areaCode') final int? areaCode; @JsonKey(name: 'logConfig') final LogConfig? logConfig; @JsonKey(name: 'threadPriority') final ThreadPriorityType? threadPriority; @JsonKey(name: 'domainLimit') final bool? domainLimit; @JsonKey(name: 'autoRegisterAgoraExtensions') final bool? autoRegisterAgoraExtensions; factory RtcEngineContext.fromJson(Map<String, dynamic> json) => _$RtcEngineContextFromJson(json); Map<String, dynamic> toJson() => _$RtcEngineContextToJson(this); }
Attributes
- appId
- The App ID issued by Agora for your project. Only users in apps with the same App ID can join the same channel and communicate with each other. An App ID can only be used to create one RtcEngine instance. To change your App ID, call release to destroy the current RtcEngine instance, and then create a new one.
- channelProfile
-
The channel profile. See ChannelProfileType.
- audioScenario
- The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType.
- areaCode
- The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions. For details on supported regions, see AreaCode. The area codes support bitwise operation.
- logConfig
-
Sets the log file size. See LogConfig.
By default, the SDK generates five SDK log files and five API call log files with the following rules:
- The SDK log files are:
agorasdk.log
,agorasdk.1.log
,agorasdk.2.log
,agorasdk.3.log
, andagorasdk.4.log
. - The API call log files are:
agoraapi.log
,agoraapi.1.log
,agoraapi.2.log
,agoraapi.3.log
, andagoraapi.4.log
. - The default size of each SDK log file and API log file is 2,048 KB. These log files are encoded in UTF-8.
- The SDK writes the latest logs in
agorasdk.log
oragoraapi.log
. - When
agorasdk.log
is full, the SDK processes the log files in the following order:- Delete the
agorasdk.4.log
file (if any). - Rename
agorasdk.3.log
toagorasdk.4.log
. - Rename
agorasdk.2.log
toagorasdk.3.log
. - Rename
agorasdk.1.log
toagorasdk.2.log
. - Create a new
agorasdk.log
file.
- Delete the
- The overwrite rules for the
agoraapi.log
file are the same as foragorasdk.log
.
- The SDK log files are:
- domainLimit
-
Whether to enable domain name restriction:
true
: Enables the domain name restriction. This value is suitable for scenarios where IoT devices use IoT cards for network access. The SDK will only connect to servers in the domain name or IP whitelist that has been reported to the operator.false
: (Default) Disables the domain name restriction. This value is suitable for most common scenarios.
- autoRegisterAgoraExtensions
-
Whether to automatically register the Agora extensions when initializing RtcEngine:
true
: (Default) Automatically register the Agora extensions when initializing RtcEngine.false
: Do not register the Agora extensions when initializing RtcEngine. You need to call enableExtension to register the Agora extensions.