Exemplo n.º 1
0
    public override void CreateInterstitial()
    {
#if MOPUB
        MoPub.RequestInterstitialAd(_interstitialAdUnits[0]);
        MoPub.RequestInterstitialAd(_interstitialAdUnits[1]);
#endif
    }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
        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
        }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
        /// <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);
        }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
    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);
        }
    }
Exemplo n.º 8
0
    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();
    }
Exemplo n.º 9
0
    /// <summary>
    /// 开始缓冲插屏
    /// </summary>
    public void FetchInsertAd()
    {
        currentInterstitialAdUnits = GetInsertId();
        //if (tempListener!=null)
        //{
        //    tempListener.FetchInsertAd(currentInterstitialAdUnits);
        //}
        //else
        //{

        //    MoPub.RequestInterstitialAd(currentInterstitialAdUnits);
        //}
        MoPub.RequestInterstitialAd(currentInterstitialAdUnits);
    }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
 private void RequestInterstitial()
 {
     // Load an interstitial ad.
     MoPub.RequestInterstitialAd(_interstitialAdUnits[0]);
 }
Exemplo n.º 12
0
 public void LoadStandard()
 {
     MoPub.RequestBanner(bannerAdUnitID, MoPub.AdPosition.BottomCenter, MoPub.MaxAdSize.ScreenWidthHeight50);
     MoPub.RequestInterstitialAd(interstitialAdUnitID);
 }
Exemplo n.º 13
0
 private void Start()
 {
     MoPub.RequestInterstitialAd(interstitialId);
 }
Exemplo n.º 14
0
 /// <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]);
 }
Exemplo n.º 15
0
 public void loadInterstitial()
 {
     MoPub.RequestInterstitialAd(strInterstitialKey);
 }
Exemplo n.º 16
0
 // MoPub Create interstitial
 private void CreateInterstitialsSection()
 {
     MoPub.RequestInterstitialAd(_interstitialAdUnits[0]);
     MoPub.ShowInterstitialAd(_interstitialAdUnits[0]);
 }
Exemplo n.º 17
0
 public void LoadInterstitial()
 {
     Debug.Log("Button load");
     MoPub.RequestInterstitialAd("3fa7d633bf8246f3a4ec0d92f477d3ca");
 }
Exemplo n.º 18
0
 private void SetupInterstitial()
 {
     MoPub.RequestInterstitialAd(ADUNIT_INTERSTITIAL);
     MoPubManager.OnInterstitialShownEvent += _ => MoPub.RequestInterstitialAd(ADUNIT_INTERSTITIAL);
     MoPubManager.OnInterstitialShownEvent += _ => _onInterstitialShown.OnNext(default);
Exemplo n.º 19
0
    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();
    }