Unable to close AdMob interstitial ad

Viewed 4534

Lately, my android app has been showing Admob interstitial ads that cannot be dismissed. It seems the back button action to dismiss an ad was discontinued. Most interstitial ads include a "Close" button on the ad itself, but not all of them do. When an interstitial ad is delivered without a close button, the only way to close the ad is to kill the app.

Here is an example of an ad we received without a close button:

enter image description here

I am using implementation 'com.google.android.gms:play-services-ads:17.0.0'

in my Gradle build.

So the question is: Is there any way to close an interstitial ad aside from pressing the close button on the ad?

3 Answers

If the interstitial should be cropped so that the close button does not appear, it may be due to the max_aspect setting in your AndroidManifest.

For Interstitial the android.resizeableActivity setting has to be true.

In may application I have set the android.resizeableActivity=true in the application tag but set my android.max_aspect to 1.8 which is needed for my game. And only in my main acticity tag i set the android:resizeableActivity="false"

<application
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:resizeableActivity="true"
   >

    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="@string/admob_App_id" />

    <meta-data android:name="com.google.android.gms.games.APP_ID"
        android:value="@string/app_id" />

    <meta-data android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <meta-data android:name="android.max_aspect" android:value="1.8" />

    <activity
        android:name="com.entwicklerx.macedefense.MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="landscape"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:resizeableActivity="false">

I hope this helps someone who has stumbled into the same problem as I recently

It seem like AdMob did some A/B testing on Back button (back button closed the Ads for some users and did not do anything for other users) but now it seems that AdMob chose the later option (back button do nothing)

I noticed this with some Ads, most probably it is an AdMob bug related to certain Ads creative sizes on some phones.

Also I've noticed that it stopped happening using newer SDK versions.

Interstitital ads can be closed by back button.

Remove all minterstitial.loadad code, and also showad code , which you call fram callback you implemented , like onadclose callback.

                 mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("ca-app-pub-........");
    // mInterstitialAd.setAdUnitId("ca-app-pub-......."); /// test ads

    MobileAds.initialize(this, new OnInitializationCompleteListener() {
        @Override
        public void onInitializationComplete(InitializationStatus initializationStatus) {


            mInterstitialAd.loadAd(new AdRequest.Builder().build());


            mInterstitialAd.setAdListener(new AdListener(){

                @Override
                public void onAdLoaded() {
                    super.onAdLoaded();

                    mInterstitialAd.show();

                }

                @Override
                public void onAdFailedToLoad(int i) {
                    super.onAdFailedToLoad(i);
                }

                @Override
                public void onAdClicked() {
                    super.onAdClicked();
                }

                @Override
                public void onAdLeftApplication() {
                    super.onAdLeftApplication();
                }

                @Override
                public void onAdOpened() {
                    super.onAdOpened();
                }
            });

        }
    });
Related