public override void CreateInterstitial() { #if MOPUB MoPub.RequestInterstitialAd(_interstitialAdUnits[0]); MoPub.RequestInterstitialAd(_interstitialAdUnits[1]); #endif }
private void CreateInterstitialsSection() { GUILayout.Space(_sectionMarginSize); GUILayout.Label("Interstitials"); if (!IsAdUnitArrayNullOrEmpty(_interstitialAdUnits)) { foreach (var interstitialAdUnit in _interstitialAdUnits) { GUILayout.BeginHorizontal(); GUI.enabled = !_adUnitToLoadedMapping[interstitialAdUnit]; if (GUILayout.Button(CreateRequestButtonLabel(interstitialAdUnit))) { Debug.Log("requesting interstitial with AdUnit: " + interstitialAdUnit); UpdateStatusLabel("Requesting " + interstitialAdUnit); MoPub.RequestInterstitialAd(interstitialAdUnit); } GUI.enabled = _adUnitToLoadedMapping[interstitialAdUnit]; if (GUILayout.Button("Show")) { ClearStatusLabel(); MoPub.ShowInterstitialAd(interstitialAdUnit); } GUI.enabled = true; GUILayout.EndHorizontal(); } } else { GUILayout.Label("No interstitial AdUnits available", _smallerFont, null); } }
protected override void InternalLoadInterstitialAd(AdPlacement placement) { #if EM_MOPUB string id = placement == AdPlacement.Default ? mAdSettings.DefaultInterstitialAdId.Id : FindIdForPlacement(mAdSettings.CustomInterstitialAdIds, placement); if (string.IsNullOrEmpty(id)) { Debug.LogFormat("Attempting to load {0} interstitial ad with an undefined ID at placement {1}", Network.ToString(), AdPlacement.GetPrintableName(placement)); return; } if (placement.Equals(AdPlacement.Default)) // Default interstitial ad... { MoPub.RequestInterstitialAd(id); } else // Custom interstitial ad... { if (!mCustomInterstitialAds.ContainsKey(placement)) { mCustomInterstitialAds.Add(placement, false); } MoPub.RequestInterstitialAd(id); } #endif }
private void CreateInterstitial() { // Requests an interstitial ad with the given (optional) keywords to be loaded. // The two possible resulting events are MoPubManager.OnInterstitialLoadedEvent and MoPubManager.OnInterstitialFailedEvent. // If a user is in a GDPR region and MoPub doesn’t obtain consent from the user, keywords will be sent to the server, // but userDataKeywords will be excluded. Refer to CanCollectPersonalInfo. MoPub.RequestInterstitialAd(m_ADParams.adUnitId); }
/// <summary> /// Loads MoPub interstitial /// </summary> private void LoadInterstitial() { if (debug) { Debug.Log(this + " Start Loading Interstitial"); ScreenWriter.Write(this + " Start Loading Interstitial"); } MoPub.RequestInterstitialAd(interstitialAdUnit); }
public void LoadInterstitialAd(string adUnitId) { Debug.LogFormat("LoadInterstitialAd {0}, {1}", adUnitId, _requestStatus); if ((!_adUnitId.Equals(string.Empty) && !adUnitId.Equals(_adUnitId)) || _requestStatus == AdRequestStatus.LOADED) { Debug.LogWarningFormat("이미 로드 중인 광고가 있습니다. 로드된 광고 : {0} / 요청한 광고 : {1}", adUnitId, _adUnitId); return; } _requestStatus = AdRequestStatus.LOADING; _adUnitId = adUnitId; MoPub.RequestInterstitialAd(adUnitId); }
private void CreateInterstitialsSection() { GUILayout.Space(_sectionMarginSize); GUILayout.Label("Interstitials"); if (!IsAdUnitArrayNullOrEmpty(_interstitialAdUnits)) { foreach (var interstitialAdUnit in _interstitialAdUnits) { GUILayout.BeginHorizontal(); GUI.enabled = !_adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; if (GUILayout.Button(CreateRequestButtonLabel(interstitialAdUnit))) { Debug.Log("requesting interstitial with AdUnit: " + interstitialAdUnit); UpdateStatusLabel("Load " + interstitialAdUnit); MoPub.RequestInterstitialAd( adUnitId: interstitialAdUnit, keywords: "interstitial, mopub"); } GUI.enabled = _adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; if (GUILayout.Button("Show")) { ClearStatusLabel(); MoPub.ShowInterstitialAd(interstitialAdUnit); if (completed) { Debug.Log("Completed watching"); } else { Debug.Log("Not completed watching"); } } /* * GUI.enabled = _adUnitToLoadedMapping[interstitialAdUnit] || ForceEnableButtons; * if (GUILayout.Button("Destroy")) { * ClearStatusLabel(); * MoPub.DestroyInterstitialAd(interstitialAdUnit); * _adUnitToLoadedMapping[interstitialAdUnit] = false; * } */ GUI.enabled = true; GUILayout.EndHorizontal(); } } else { GUILayout.Label("No interstitial AdUnits available", _smallerFont, null); } }
void OnGUI() { var fontSize = (int)(0.035f * Screen.width); GUI.skin.box.fontSize = fontSize; GUI.skin.button.fontSize = fontSize; var buttonWidth = 0.35f * Screen.width; var buttonHeight = 0.15f * Screen.height; var buttonRowCount = 3; var groupWidth = buttonWidth * 2 + 30; var groupHeight = fontSize + (buttonHeight * buttonRowCount) + (buttonRowCount * 10) + 10; var screenWidth = Screen.width; var screenHeight = Screen.height; var groupX = (screenWidth - groupWidth) / 2; var groupY = (screenHeight - groupHeight) / 2; GUI.BeginGroup(new Rect(groupX, groupY, groupWidth, groupHeight)); GUI.Box(new Rect(0, 0, groupWidth, groupHeight), "Select ADXLibrary function"); if (GUI.Button(new Rect(10, fontSize + 10, buttonWidth, buttonHeight), "GetData")) { GetData(); } if (GUI.Button(new Rect(10, fontSize + 20 + buttonHeight, buttonWidth, buttonHeight), "Load Interstitial")) { MoPub.RequestInterstitialAd(interstitialAdUnitID); } if (GUI.Button(new Rect(10, fontSize + 30 + buttonHeight * 2, buttonWidth, buttonHeight), "Load RV")) { LoadRV(); } if (GUI.Button(new Rect(20 + buttonWidth, fontSize + 10, buttonWidth, buttonHeight), "Load Banner")) { MoPub.RequestBanner(bannerAdUnitID, MoPub.AdPosition.BottomCenter, MoPub.MaxAdSize.ScreenWidthHeight50); } if (GUI.Button(new Rect(20 + buttonWidth, fontSize + 20 + buttonHeight, buttonWidth, buttonHeight), "Show Interstitial")) { ShowInterstitial(); } if (GUI.Button(new Rect(20 + buttonWidth, fontSize + 30 + buttonHeight * 2, buttonWidth, buttonHeight), "Show RV")) { ShowRV(); } GUI.EndGroup(); }
/// <summary> /// 开始缓冲插屏 /// </summary> public void FetchInsertAd() { currentInterstitialAdUnits = GetInsertId(); //if (tempListener!=null) //{ // tempListener.FetchInsertAd(currentInterstitialAdUnits); //} //else //{ // MoPub.RequestInterstitialAd(currentInterstitialAdUnits); //} MoPub.RequestInterstitialAd(currentInterstitialAdUnits); }
protected override bool DoPreLoadAd() { if (string.IsNullOrEmpty(m_Config.unitID)) { return(false); } MoPub.RequestInterstitialAd(m_Config.unitID); if (!m_IsInitUnitId) { m_IsInitUnitId = true; } return(true); }
private void RequestInterstitial() { // Load an interstitial ad. MoPub.RequestInterstitialAd(_interstitialAdUnits[0]); }
public void LoadStandard() { MoPub.RequestBanner(bannerAdUnitID, MoPub.AdPosition.BottomCenter, MoPub.MaxAdSize.ScreenWidthHeight50); MoPub.RequestInterstitialAd(interstitialAdUnitID); }
private void Start() { MoPub.RequestInterstitialAd(interstitialId); }
/// <summary> /// Handle MoPub Menu Load Interstitial Ad Button Pressed event /// <param name="pAdUnitId">The Ad Unit ID assocated with this ad.</param> /// </summary> public void OnLoadInterstitialAd(int pAdUnitIndex) { MoPub.RequestInterstitialAd(_interstitialAdUnits[pAdUnitIndex]); }
public void loadInterstitial() { MoPub.RequestInterstitialAd(strInterstitialKey); }
// MoPub Create interstitial private void CreateInterstitialsSection() { MoPub.RequestInterstitialAd(_interstitialAdUnits[0]); MoPub.ShowInterstitialAd(_interstitialAdUnits[0]); }
public void LoadInterstitial() { Debug.Log("Button load"); MoPub.RequestInterstitialAd("3fa7d633bf8246f3a4ec0d92f477d3ca"); }
private void SetupInterstitial() { MoPub.RequestInterstitialAd(ADUNIT_INTERSTITIAL); MoPubManager.OnInterstitialShownEvent += _ => MoPub.RequestInterstitialAd(ADUNIT_INTERSTITIAL); MoPubManager.OnInterstitialShownEvent += _ => _onInterstitialShown.OnNext(default);
void OnGUI() { GUI.backgroundColor = Color.green; GUILayoutOption[] option = new GUILayoutOption[] { GUILayout.Height(80) }; Texture2D texture = new Texture2D(128, 128); GUIStyle style = new GUIStyle(GUI.skin.button); style.normal.background = texture; Destroy(texture); style.normal.textColor = Color.yellow; style.fontSize = 48; style.active.textColor = Color.blue; GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height)); GUILayout.BeginVertical(); GUILayout.Space(20); GUIStyle lableStyle = new GUIStyle(); lableStyle.fontSize = 56; lableStyle.alignment = TextAnchor.MiddleCenter; GUILayout.Label("Mopub + Vungle", lableStyle); if (GUILayout.Button("Init", style, option)) { initMediation(); } GUILayout.Space(20); GUILayout.BeginHorizontal(); if (GUILayout.Button("Load Interstitial", style, option)) { MoPub.RequestInterstitialAd(interstitialAdUnitId); } if (GUILayout.Button("Play Interstitial", style, option)) { MoPub.ShowInterstitialAd(interstitialAdUnitId); } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); if (GUILayout.Button("Load Reward", style, option)) { MoPub.RequestRewardedVideo(rewardAdUnitId); } if (GUILayout.Button("Play Reward", style, option)) { MoPub.ShowRewardedVideo(rewardAdUnitId); } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); if (GUILayout.Button("Load Banner", style, option)) { loadBanner(); } if (GUILayout.Button("Play Banner", style, option)) { playBanner(); } if (GUILayout.Button("Destroy Banner", style, option)) { MoPub.DestroyBanner(bannerAdUnitId); } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); if (GUILayout.Button("Load MREC", style, option)) { loadMREC(); } if (GUILayout.Button("Play MREC", style, option)) { playMREC(); } if (GUILayout.Button("Destroy MREC", style, option)) { MoPub.DestroyBanner(mrecAdUnitId); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndArea(); }