android/src/main/java/io/ivoca/flutter_admob_app_open/AppOpenManager.java
/** Shows the ad if one isn't already showing. */
Shows the ad if one isn't already showing.
Shows the ad if one isn ' t already showing .
public void showAdIfAvailable() {
        if(!FlutterAdmobAppOpenPlugin.getPause()){
            if (!isShowingAd && isAdAvailable()) {
                Log.d(LOG_TAG, "Will show ad.");
                FullScreenContentCallback fullScreenContentCallback =
                        new FullScreenContentCallback() {
                            @Override
                            public void onAdDismissedFullScreenContent() {
                                AppOpenManager.this.appOpenAd = null;
                                isShowingAd = false;
                                fetchAd();
                            }
                            @Override
                            public void onAdFailedToShowFullScreenContent(AdError adError) {}
                            @Override
                            public void onAdShowedFullScreenContent() {
                                isShowingAd = true;
                            }
                        };
                appOpenAd.setFullScreenContentCallback(fullScreenContentCallback);
                appOpenAd.show(currentActivity);
            } else {
                Log.d(LOG_TAG, "Can not show ad.");
                fetchAd();
            }
        }
    }
public void showAdIfAvailable ( ) { if ( ! FlutterAdmobAppOpenPlugin . getPause ( ) ) { if ( ! isShowingAd && isAdAvailable ( ) ) { Log . d ( LOG_TAG , "Will show ad." ) ; FullScreenContentCallback fullScreenContentCallback = new FullScreenContentCallback ( ) { @ Override public void onAdDismissedFullScreenContent ( ) { AppOpenManager . this . appOpenAd = null ; isShowingAd = false ; fetchAd ( ) ; } @ Override public void onAdFailedToShowFullScreenContent ( AdError adError ) { } @ Override public void onAdShowedFullScreenContent ( ) { isShowingAd = true ; } } ; appOpenAd . setFullScreenContentCallback ( fullScreenContentCallback ) ; appOpenAd . show ( currentActivity ) ; } else { Log . d ( LOG_TAG , "Can not show ad." ) ; fetchAd ( ) ; } } }
Shows the ad if one isn't already showing.
Shows the ad if one isn ' t already showing .
// Only show ad if there is not already an app open ad currently showing // and an ad is available. // Set the reference to null so isAdAvailable() returns false.