RtcEngineContext

Definition of RtcEngineContext.

@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);
}

Properties

appId
The App ID issued by Agora to the app developer. Only apps using the same App ID can join the same channel for communication or live streaming. One App ID can only be used to create one RtcEngine. To change the App ID, you must first call release to destroy the current RtcEngine and then create a new one.
channelProfile
Channel usage scenario. See ChannelProfileType.
audioScenario
Audio scenario. Different audio scenarios correspond to different volume types on the device. See AudioScenarioType.
areaCode
The region for accessing the server. This is an advanced setting suitable for scenarios with access security restrictions. Supported regions are listed in AreaCode. The region code supports bitwise operations.
logConfig
Sets the log files output by the SDK. See LogConfig. By default, the SDK generates 5 SDK log files and 5 API call log files, following these rules:
domainLimit
Whether to enable domain name restriction:
  • true: Enable domain name restriction. This setting is suitable for IoT devices accessing the network using IoT SIM cards. The SDK will only connect to servers whose domain names or IPs are whitelisted and reported to the carrier.
  • false: (default) Disable domain name restriction. This setting is suitable for most general scenarios.
autoRegisterAgoraExtensions
Whether to automatically register Agora extensions when initializing RtcEngine:
  • true: (default) Automatically register Agora extensions when initializing RtcEngine.
  • false: Do not register Agora extensions when initializing RtcEngine. You need to call enableExtension to register the Agora extensions.