private void RequestForMopubAd() { localCount++; if (localCount == displayAdAfterLvl && !UserPrefs.isIgnoreAds) { Debug.Log("----------- Show MoPub Ad State: " + " Request sent"); #if UNITY_ANDROID if (MoPubAndroidManager.INTERSTITIAL_AD_STATE != MoPubAndroidManager.INTERSTITIAL_STATES.LOADED && MoPubAndroidManager.INTERSTITIAL_AD_STATE != MoPubAndroidManager.INTERSTITIAL_STATES.LOADING) { MoPubAndroid.requestInterstitalAd(Constants.INTERSTITIAL_ID_ANDROID); MoPubAndroidManager.INTERSTITIAL_AD_STATE = MoPubAndroidManager.INTERSTITIAL_STATES.LOADING; } #endif #if UNITY_IPHONE MoPubBinding.requestInterstitialAd(Constants.INTERSTITIAL_ID_IOS, null); #endif localCount = 0; } }
// Starts loading an interstitial ad public static void requestInterstitialAd(string adUnitId, string keywords = "") { MP.requestInterstitialAd(adUnitId, keywords); }