showConsentFormIfNeeded method

Future<bool> showConsentFormIfNeeded()

Shows the consent form if it is available and required.

Implementation

Future<bool> showConsentFormIfNeeded() async {
  final status = await AppTrackingTransparency.trackingAuthorizationStatus;
  final permission = getTrackingPermission(status);
  final consentStatus = await getConsentStatus();

  if (permission == FastAppPermission.granted &&
      consentStatus == ConsentStatus.required) {
    _logger.debug('Consent status is required, will show consent form');
    return showConsentForm();
  }

  return false;
}