googleads-mobile-android-examples icon indicating copy to clipboard operation
googleads-mobile-android-examples copied to clipboard

AppOpenExample hangs on Splash Screen when no internet or behind adblocker.

Open emvee-ha opened this issue 2 years ago • 3 comments

I expect it to resume to MainActivity.

emvee-ha avatar Apr 01 '24 20:04 emvee-ha

Would this be ok?

          if (consentError != null) {
            // Consent not obtained in current session.
            startMainActivity();
          }

emvee-ha avatar Apr 12 '24 19:04 emvee-ha

Hi @mvhuizen,

Making sure there are not errors is a good practice. Can you provide any additional details on this issue? What are the exact steps you are taking to replicate this issue? Is there some sample code you could provide?

NVentimiglia avatar Apr 29 '24 17:04 NVentimiglia

@NVentimiglia Thank you for your response.

I currently have this code in production and it seems to work fine, feel free to close this issue.

private boolean isConsentError = Boolean.FALSE;


if (consentError != null) {
    // Consent not obtained in current session.
    isConsentError=true;
    Log.w(
            LOG_TAG,
            String.format(
                    "%s: %s", consentError.getErrorCode(), consentError.getMessage()));
}


if (googleMobileAdsConsentManager.canRequestAds()||(isConsentError)) {
    showInterstitial();
}

emvee-ha avatar May 04 '24 18:05 emvee-ha