public static void Init(AdsConfiguration config, Action <string> onComplete = null) { if (inst == null) { DebugLog("AdsRequestHelper.Init()"); try { DebugLog("MoPub.InitializeSdk()"); if (onComplete != null) { MoPubManager.OnSdkInitializedEvent += onComplete; } MoPubBase.SdkConfiguration sdkConfiguration = new MoPubBase.SdkConfiguration { AdUnitId = config.mopubRewarded, LogLevel = MoPubBase.LogLevel.MPLogLevelDebug }; sdkConfiguration.MediatedNetworks = new MoPubBase.MediatedNetwork[] { new MoPubBase.SupportedNetwork.AdMob(), new MoPubBase.SupportedNetwork.AppLovin(), new MoPubBase.SupportedNetwork.Facebook(), new MoPubBase.SupportedNetwork.IronSource(), new MoPubBase.SupportedNetwork.Unity() }; MoPubAndroid.InitializeSdk(sdkConfiguration); DebugLog("MoPub.LoadRewardedVideoPluginsForAdUnits()"); string[] rewardedVideoAdUnitIds = new string[] { config.mopubRewarded }; MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(rewardedVideoAdUnitIds); Type[] components = new Type[] { typeof(AdsRequestHelper) }; GameObject target = new GameObject("AdsHelperObject", components); Object.DontDestroyOnLoad(target); inst = target.GetComponent <AdsRequestHelper>(); inst.config = config; } catch (Exception exception) { Debug.LogException(exception); } } }
private void Start() { MoPubBase.SdkConfiguration sdkConfiguration = default(MoPubBase.SdkConfiguration); sdkConfiguration.AdUnitId = _interstitialAdUnits[0]; sdkConfiguration.NetworksToInit = new MoPubBase.RewardedNetwork[9] { MoPubBase.RewardedNetwork.AdColony, MoPubBase.RewardedNetwork.Facebook, MoPubBase.RewardedNetwork.Unity, MoPubBase.RewardedNetwork.AdMob, MoPubBase.RewardedNetwork.AppLovin, MoPubBase.RewardedNetwork.Chartboost, MoPubBase.RewardedNetwork.IronSource, MoPubBase.RewardedNetwork.Tapjoy, MoPubBase.RewardedNetwork.Vungle }; sdkConfiguration.AdvancedBidders = new MoPubBase.AdvancedBidder[1] { MoPubBase.AdvancedBidder.Facebook }; MoPubBase.SdkConfiguration sdkConfiguration2 = sdkConfiguration; MoPubAndroid.InitializeSdk(sdkConfiguration2); MoPubAndroid.LoadBannerPluginsForAdUnits(_bannerAdUnits); MoPubAndroid.LoadInterstitialPluginsForAdUnits(_interstitialAdUnits); MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(_rewardedVideoAdUnits); }
public void Check() { string anyAdUnitId = (!SafeLayout.IsTablet) ? "6bc3898062484e71a114d0ab59cb1c78" : "0543e571406140dd96252ac1351b99f5"; this.time = DateTime.UtcNow; MoPubAndroid.InitializeSdk(anyAdUnitId); FMLogger.vCore("mopub pre int consent status " + MoPubAndroid.CurrentConsentStatus); }
public static void InitializeSdk(string anyAdUnitId) { MoPubBase.ValidateAdUnitForSdkInit(anyAdUnitId); MoPubAndroid.InitializeSdk(new MoPubBase.SdkConfiguration { AdUnitId = anyAdUnitId }); }
private void InternalInit(string anyAdUnit) { if (this.inited || string.IsNullOrEmpty(anyAdUnit)) { return; } MoPubAndroid.InitializeSdk(anyAdUnit); this.inited = true; }
private void Start() { string anyAdUnitId = this._bannerAdUnits[0]; MoPubAndroid.InitializeSdk(anyAdUnitId); MoPubAndroid.LoadBannerPluginsForAdUnits(this._bannerAdUnits); MoPubAndroid.LoadInterstitialPluginsForAdUnits(this._interstitialAdUnits); MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(this._rewardedVideoAdUnits); MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(this._rewardedRichMediaAdUnits); GameObject gameObject = GameObject.Find("MoPubNativeAds"); if (gameObject != null) { gameObject.SetActive(false); } }
private void Start() { string str = this._bannerAdUnits[0]; MoPubBase.SdkConfiguration sdkConfiguration = new MoPubBase.SdkConfiguration { AdUnitId = str, LogLevel = MoPubBase.LogLevel.MPLogLevelDebug, MediatedNetworks = new MoPubBase.MediatedNetwork[0] }; MoPubAndroid.InitializeSdk(sdkConfiguration); MoPubAndroid.LoadBannerPluginsForAdUnits(this._bannerAdUnits); MoPubAndroid.LoadInterstitialPluginsForAdUnits(this._interstitialAdUnits); MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(this._rewardedVideoAdUnits); MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(this._rewardedRichMediaAdUnits); GameObject obj2 = GameObject.Find("MoPubNativeAds"); if (obj2 != null) { obj2.SetActive(false); } }