'Appodeal Consent Manager won't show

  Future<void> checkConsent() async {
    ConsentManager.requestConsentInfoUpdate(Constants.kAppodealKey);

    ConsentManager.setConsentInfoUpdateListener(
        (onConsentInfoUpdated, consent) {
      print('PRINT: onConsentInfoUpdated $consent');
    }, (onFailedToUpdateConsentInfo, error) {
      print('PRINT: onFailedToUpdateConsentInfo $error');
    });

    var consentStatus = await ConsentManager.getConsentStatus();
    print('PRINT: consentStatus $consentStatus');
    if (consentStatus.toString() == 'Status.UNKNOWN') {
      var shouldShow = await ConsentManager.shouldShowConsentDialog();
      print('PRINT: shouldShow $shouldShow');

      if (shouldShow.toString() == 'ShouldShow.TRUE') {
        ConsentManager.loadConsentForm();

        var isLoaded = await ConsentManager.consentFormIsLoaded();
        print('PRINT: isLoaded $isLoaded');
        if (isLoaded == true) {
          ConsentManager.showAsDialogConsentForm();
          ConsentManager.showAsActivityConsentForm();

          ConsentManager.setConsentFormListener((onConsentFormLoaded) {
            print('PRINT: onConsentFormLoaded');
          }, (onConsentFormError, error) {
            print('PRINT: onConsentFormError $error');
          }, (onConsentFormOpened) {
            print('PRINT: onConsentFormOpened');
          }, (onConsentFormClosed, consent) {
            print('PRINT: onConsentFormClosed $consent');
          });
        }
      }
    }
  }

Constants.kAppodealKey is what I got in the Application key from here: https://app.appodeal.com/apps enter image description here

But this is what I got:

I/flutter ( 9497): PRINT: consentStatus Status.UNKNOWN
I/flutter ( 9497): PRINT: shouldShow ShouldShow.UNKNOWN

In the documentation ShouldShow.UKNOWN means this: https://wiki.appodeal.com/en/android/get-started/data-protection/gdpr-and-ccpa

UNKNOWN The value is undefined(the requestConsentInfoUpdate method was not called).

But I have called it on the first line of my method. May I know why it is having a problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source