showPrivacyOptions static method

Future<bool> showPrivacyOptions()

Shows Google's privacy-options form and refreshes the ads gate.

Returns the post-form value of AdsService.canRequestAds. It returns false when consent integration was not enabled or initialization has not completed.

Implementation

static Future<bool> showPrivacyOptions() async {
  final manager = _consentManager;
  if (manager == null) return false;

  await manager.showPrivacyOptions();
  if (!AdsService.isInitialized) return manager.canRequestAds();

  await AdsService.instance.refreshConsent();
  return AdsService.instance.canRequestAds;
}