removeConsent static method

Future<String?> removeConsent(
  1. List<String> consents
)

Implementation

static Future<String?> removeConsent(List<String> consents) async {
  if (!_instance._countlyState.isInitialized) {
    String message = '"initWithConfig" must be called before "removeConsent"';
    log('removeConsent, $message', logLevel: LogLevel.ERROR);
    return message;
  }
  String consentsString = consents.toString();
  log('Calling "removeConsent":[$consentsString]');
  if (consents.isEmpty) {
    String error = 'removeConsent, consents List is empty';
    log(error, logLevel: LogLevel.WARNING);
  }
  log(consents.toString());
  final String? result = await _channel.invokeMethod('removeConsent', <String, dynamic>{'data': json.encode(consents)});

  return result;
}