Example #1
0
            void onNativeExpressAdLoad(AndroidJavaObject ads)
            {
                var size = ads.Call <int>("size");
                List <ExpressAd> expressAds = new List <ExpressAd>();

                for (int i = 0; i < size; ++i)
                {
                    ExpressAd ad = new ExpressAd(
                        ads.Call <AndroidJavaObject>("get", i));
                    expressAds.Insert(i, ad);
                }
                UnityDispatcher.PostTask(
                    () => this.callback.OnExpressAdLoad(expressAds));
            }
Example #2
0
 private static void ExpressAd_OnAdDislikeMethod(int index, int dislikeID, string dislikeReason, int context)
 {
     UnityDispatcher.PostTask(() =>
     {
         IDislikeInteractionListener listener;
         if (dislikeListeners.TryGetValue(context, out listener))
         {
             ExpressAd expressAd = expressAds[index];
             listener.OnSelected(dislikeID, dislikeReason);
         }
         else
         {
             Debug.LogError(
                 "The ExpressAd_OnAdDislike can not find the context.");
         }
     });
 }
Example #3
0
 private static void ExpressAd_DidClickMethod(int index, int context)
 {
     UnityDispatcher.PostTask(() =>
     {
         IExpressAdInteractionListener listener;
         if (interactionListeners.TryGetValue(context, out listener))
         {
             ExpressAd expressAd = expressAds[index];
             listener.OnAdClicked(expressAd);
         }
         else
         {
             Debug.LogError(
                 "The ExpressAd_DidClick can not find the context.");
         }
     });
 }
Example #4
0
 private static void ExpressAd_OnAdViewRenderErrorMethod(int index, int code, string message, int context)
 {
     UnityDispatcher.PostTask(() =>
     {
         IExpressAdInteractionListener listener;
         if (interactionListeners.TryGetValue(context, out listener))
         {
             ExpressAd expressAd = expressAds[index];
             listener.OnAdViewRenderError(expressAd, code, message);
         }
         else
         {
             Debug.LogError(
                 "The ExpressAd_OnAdViewRenderError can not find the context.");
         }
     });
 }
Example #5
0
 private static void ExpressAd_OnAdViewRenderSuccMethod(int index, float width, float height, int context)
 {
     UnityDispatcher.PostTask(() =>
     {
         IExpressAdInteractionListener listener;
         if (interactionListeners.TryGetValue(context, out listener))
         {
             ExpressAd expressAd = expressAds[index];
             listener.OnAdViewRenderSucc(expressAd, width, height);
         }
         else
         {
             Debug.LogError(
                 "The ExpressAd_OnAdViewRenderSucc can not find the context.");
         }
     });
 }
Example #6
0
 public void LoadNativeExpressAd(
     AdSlot adSlot, IExpressAdListener listener)
 {
     ExpressAd.LoadExpressAdAd(adSlot, listener);
 }