setInboxConsentState method

  1. @override
Future<bool> setInboxConsentState(
  1. String inboxId,
  2. String state
)
override

Set consent state for an inbox by inbox ID

Implementation

@override
Future<bool> setInboxConsentState(String inboxId, String state) async {
  try {
    final params = <String, dynamic>{
      'inboxId': inboxId,
      'state': state,
    }.jsify() as JSObject;

    await _promiseToFuture(
      _clientManager.setInboxConsentState(params),
    );

    return true;
  } catch (e) {
    throw Exception('Failed to set inbox consent state: $e');
  }
}