@Override public void show() { Clog.d(Clog.mediationLogTag, "MillennialMediaInterstitial - show called"); if (iad == null) { Clog.e( Clog.mediationLogTag, "MillennialMediaInterstitial - show called while interstitial ad view was null"); return; } if (!iad.isAdAvailable()) { Clog.e( Clog.mediationLogTag, "MillennialMediaInterstitial - show called while interstitial ad was unavailable"); return; } if (iad.display(false)) Clog.d(Clog.mediationLogTag, "MillennialMediaInterstitial - display called successfully"); else Clog.e(Clog.mediationLogTag, "MillennialMediaInterstitial - display failed"); }
@Override public void requestAd( MediatedInterstitialAdViewController mIC, Activity activity, String parameter, String uid) { if (mIC == null) { Clog.e( Clog.mediationLogTag, "MillennialMediaInterstitial - requestAd called with null controller"); return; } if (activity == null) { Clog.e( Clog.mediationLogTag, "MillennialMediaInterstitial - requestAd called with null activity"); return; } Clog.d( Clog.mediationLogTag, String.format( "MillennialMediaInterstitial - requesting an interstitial ad: [%s, %s]", parameter, uid)); MMSDK.initialize(activity); iad = new MMInterstitial(activity); iad.setApid(uid); iad.setListener(new MillennialMediaListener(mIC, getClass().getSimpleName())); if (!iad.isAdAvailable()) { iad.fetch(); } else { Clog.w( Clog.mediationLogTag, "MillennialMediaInterstitial - ad was available from cache. show it instead of fetching"); mIC.onAdLoaded(); } }
@Override public boolean isReady() { return (iad != null) && (iad.isAdAvailable()); }