Ejemplo n.º 1
0
    public void Request()
    {
        TapsellPlus.RequestInterstitialAd(ZoneID,

                                          tapsellPlusAdModel => {
            Debug.Log("on response " + tapsellPlusAdModel.responseId);
            _responseId = tapsellPlusAdModel.responseId;
        },
                                          error => {
            Debug.Log("Error " + error.message);
        }
                                          );
    }
Ejemplo n.º 2
0
        public static void Request(Segment segment, System.Action <bool> callback = null)
        {
            if (OnPreRequest(segment) == false)
            {
                return;
            }

            var zone = segment.ZoneId;

            Debug.Log("FunAd.Interstitial.Request: " + zone);

            if (zone.IsNullOrEmpty())
            {
                admono.Call(callback, false);
                return;
            }

            if (segment.IsReady)
            {
                admono.Call(callback, true);
                return;
            }

#if ABR || TAPSELL
            TapsellPlus.RequestInterstitialAd(zone,
                                              zoneId =>
            {
                segment.ResponseZone = zoneId.zoneId;
                callback?.Invoke(true);
                OnLoaded?.Invoke(segment);
            },
                                              error =>
            {
                Debug.Log("Tapsell.RequestInterstitial.Error: " + error.message);
                callback?.Invoke(false);
                OnError?.Invoke(segment);
            });
#elif UAD
            UnityAd.Load(zone, success =>
            {
                if (success)
                {
                    segment.ResponseZone = zone;
                    callback?.Invoke(true);
                    OnLoaded?.Invoke(segment);
                }
                else
                {
                    OnError?.Invoke(segment);
                    callback?.Invoke(false);
                }
            });
#elif ADMOB
            AdMob.RequestInterstitial(zone,
                                      zid =>
            {
                segment.ResponseZone = zone;
                callback?.Invoke(true);
                OnLoaded?.Invoke(segment);
            },
                                      error =>
            {
                Debug.Log("AdMob.RequestInterstitial.Error: " + error);
                callback?.Invoke(false);
                OnError?.Invoke(segment);
            });
#else
            callback?.Invoke(false);
#endif
        }