setConsent method

Future<void> setConsent(
  1. ConsentState state
)

Record the user's answer, as the consent tool reports it.

Safe to repeat. consent changes straight away and the native SDK is told in the order calls were made, so an identify started after this call sees the new state whether or not the returned future was awaited. It also applies to a call already in flight: withdrawing consent stops a running identify before it starts another source or submits, and that call throws FingerlyConsentException.

Implementation

Future<void> setConsent(ConsentState state) {
  _consent = state;
  return _invokeVoid('setConsent', {'state': state.name});
}