setHasUserConsent static method

void setHasUserConsent(
  1. bool? hasUserConsent
)

Sets the user's GDPR consent status manually, bypassing CMP frameworks.

Pass true if the user consented, false if denied, or null to clear the manual override and defer to CMP-provided signals (GPP/TCF). Can be called before initialize.

Implementation

static void setHasUserConsent(bool? hasUserConsent) {
  _methodChannel.invokeMethod('setHasUserConsent', {
    'hasUserConsent': hasUserConsent,
  });
}