initialize method

Future<void> initialize(
  1. String serverURL,
  2. String activateToken,
  3. String activateCertificate, {
  4. bool showStatement = true,
  5. List<SSLConfig>? sslConfigs,
})

showStatement: this parts for Android only.

Implementation

Future<void> initialize(
  String serverURL,
  String activateToken,
  String activateCertificate, {
  bool showStatement = true,
  List<SSLConfig>? sslConfigs,
}) async {
  try {
    final Map<String, dynamic> arguments = {
      'serverUrl': serverURL,
      'activateToken': activateToken,
      'activateCertificate': activateCertificate,
      'showStatement': showStatement,
    };

    if (sslConfigs != null && sslConfigs.isNotEmpty) {
      arguments['sslConfigs'] =
          sslConfigs.map((config) => config.toMap()).toList();
    }

    await _channel.invokeMethod('initialize', arguments);
  } on PlatformException catch (_) {
    rethrow;
  }
}