protected override bool InternalIsInterstitialAdReady(AdPlacement placement) { VungleInterstitialAd ad = GetInterstitialVungleAd(placement); if (ad == null) { return(false); } return(ad.IsReady()); }
protected override void InternalShowInterstitialAd(AdPlacement placement) { VungleInterstitialAd ad = GetInterstitialVungleAd(placement); if (ad == null) { return; } ad.Show(); }
protected override void InternalInit() { mAdSettings = EM_Settings.Advertising.VungleAds; #if EM_VUNGLE if (mAdSettings.UseAdvancedSetting) { options = new Dictionary <string, object>(); VungleAdOrientation orientation = VungleAdOrientation.All; switch (mAdSettings.AdvancedSettings.adOrientation) { case VungleSettings.VungleAdvancedSettings.AdOrientation.Portrait: orientation = VungleAdOrientation.Portrait; break; #if UNITY_IOS case VungleSettings.VungleAdvancedSettings.AdOrientation.LandscapeLeft: orientation = VungleAdOrientation.LandscapeLeft; break; case VungleSettings.VungleAdvancedSettings.AdOrientation.LandscapeRight: orientation = VungleAdOrientation.LandscapeRight; break; case VungleSettings.VungleAdvancedSettings.AdOrientation.PortraitUpsideDown: orientation = VungleAdOrientation.PortraitUpsideDown; break; #endif case VungleSettings.VungleAdvancedSettings.AdOrientation.Landscape: orientation = VungleAdOrientation.Landscape; break; case VungleSettings.VungleAdvancedSettings.AdOrientation.All: orientation = VungleAdOrientation.All; break; #if UNITY_IOS case VungleSettings.VungleAdvancedSettings.AdOrientation.AllButUpsideDown: orientation = VungleAdOrientation.AllButUpsideDown; break; #endif #if UNITY_ANDROID case VungleSettings.VungleAdvancedSettings.AdOrientation.MatchVideo: orientation = VungleAdOrientation.MatchVideo; break; #endif } options.Add("orientation", orientation); options.Add("alertTitle", mAdSettings.AdvancedSettings.prematureAdClosePopup.alertTitle); options.Add("alertText", mAdSettings.AdvancedSettings.prematureAdClosePopup.alertText); options.Add("closeText", mAdSettings.AdvancedSettings.prematureAdClosePopup.closeText); options.Add("continueText", mAdSettings.AdvancedSettings.prematureAdClosePopup.continueText); } #endif customBannerPlacementDict = new Dictionary <AdPlacement, VungleBannerAd>(); customRewardedPlacementDict = new Dictionary <AdPlacement, VungleRewardedAd>(); customInterstitialPlacementDict = new Dictionary <AdPlacement, VungleInterstitialAd>(); foreach (var keyPair in mAdSettings.CustomBannerAdIds) { if (customBannerPlacementDict.ContainsKey(keyPair.Key)) { continue; } customBannerPlacementDict.Add(keyPair.Key, new VungleBannerAd(keyPair.Value, keyPair.Key)); } foreach (var keyPair in mAdSettings.CustomInterstitialAdIds) { if (customInterstitialPlacementDict.ContainsKey(keyPair.Key)) { continue; } customInterstitialPlacementDict.Add(keyPair.Key, new VungleInterstitialAd(keyPair.Value, keyPair.Key, options)); } foreach (var keyPair in mAdSettings.CustomRewardedAdIds) { if (customRewardedPlacementDict.ContainsKey(keyPair.Key)) { continue; } customRewardedPlacementDict.Add(keyPair.Key, new VungleRewardedAd(keyPair.Value, keyPair.Key, options)); } defaultInterstitial = new VungleInterstitialAd(mAdSettings.DefaultInterstitialAdId, AdPlacement.Default, options); defaultRewarded = new VungleRewardedAd(mAdSettings.DefaultRewardedAdId, AdPlacement.Default, options); defaultBanner = new VungleBannerAd(mAdSettings.DefaultBannerAdId, AdPlacement.Default); #if EM_VUNGLE Vungle.onInitializeEvent += OnInitialized; Vungle.onAdStartedEvent += OnAdStarted; Vungle.onAdFinishedEvent += OnAdFinished; Vungle.adPlayableEvent += OnAdPlayableEvent; if (mAdSettings.UseAdvancedSetting) { Vungle.setSoundEnabled(mAdSettings.AdvancedSettings.enableAdSound); Vungle.SetMinimumDiskSpaceForInitialization(mAdSettings.AdvancedSettings.minimumDiskSpaceForInitialization); Vungle.SetMinimumDiskSpaceForAd(mAdSettings.AdvancedSettings.minimumDiskSpaceForAds); Vungle.EnableHardwareIdPrivacy(mAdSettings.AdvancedSettings.disableHardwareId); } GameObject appStateHandler = new GameObject("VungleAppstateHandler"); appStateHandler.hideFlags = HideFlags.HideAndDontSave; appStateHandler.AddComponent <AppStateHandler>(); Vungle.init(mAdSettings.AppId.Id); #endif ApplyDataPrivacyConsent(GetApplicableDataPrivacyConsent()); }