setPrivacyConsent static method

Future<bool> setPrivacyConsent(
  1. PrivacyConsentType privacyConsentType,
  2. bool value
)

Pass privacy consent flag to unity sdk.

  • privacyConsentType - provacy consent type
  • value - flag

Returns true if the flag is set, otherwise false.

Read more about Privacy Consent: https://docs.unity.com/ads/ImplementingDataPrivacy.html

Implementation

static Future<bool> setPrivacyConsent(
  PrivacyConsentType privacyConsentType,
  bool value,
) async {
  final args = <String, dynamic>{
    privacyConsentValueParameter: value,
    privacyConsentTypeParameter: privacyConsentType
        .toString()
        .split('.')
        .last,
  };
  return await _channel.invokeMethod(privacyConsentSetMethod, args);
}