getStartupConfiguration method

Map<String, dynamic> getStartupConfiguration()

Generating the Startup configuration for a manual startup. Only relevant configurations will be passed to the native agents. Currently this is applicationId, beaconUrl and loglevel.

Implementation

Map<String, dynamic> getStartupConfiguration() {
  Map<String, dynamic> startupConfiguration = {};

  if (!StringUtils.isStringNullEmptyOrWhitespace(_applicationId)) {
    startupConfiguration["applicationId"] = _applicationId;
  }

  if (!StringUtils.isStringNullEmptyOrWhitespace(_beaconUrl)) {
    startupConfiguration["beaconUrl"] = _beaconUrl;
  }

  if (_logLevel == LogLevel.Debug) {
    // Only sending the non-default value which is debug
    startupConfiguration["logLevel"] = "debug";
  }

  if (!_certificateValidation) {
    // Only sending the non-default value which is false
    startupConfiguration["certificateValidation"] = false;
  }

  if (_userOptIn) {
    // Only sending the non-default value which is true
    startupConfiguration["userOptIn"] = true;
  }

  if (!_reportCrash) {
    // Only sending the non-default value which is false
    startupConfiguration["crashReporting"] = false;
  }

  return startupConfiguration;
}