private void FetchAndDisplay(string space)
        {
            adInterstitial = new FlurryAdInterstitial(space);

#if DEBUG
            // enable test ads
            var targeting = FlurryAdTargeting.Targeting;
            targeting.TestAdsEnabled = true;
            adInterstitial.Targeting = targeting;
#endif

            adInterstitial.DidFetchAd += delegate {
                statusLbl.Text = string.Format(" [{0}] Did Fetch Ad ", adInterstitial.Space);

                adInterstitial.Present(this);
            };
            adInterstitial.DidRenderAd += delegate {
                statusLbl.Text = string.Format(" [{0}] Did Render Ad ", adInterstitial.Space);
            };
            adInterstitial.DidDismissAd += delegate {
                statusLbl.Text = string.Format(" [{0}] Will Present Fullscreen Ad ", adInterstitial.Space);
            };
            adInterstitial.DidReceiveClick += delegate {
                statusLbl.Text = string.Format(" [{0}] Did Receive Click Ad ", adInterstitial.Space);
            };
            adInterstitial.DidDismissAd += delegate {
                statusLbl.Text = string.Format(" [{0}] Did Dismiss Fullscreen Ad ", adInterstitial.Space);
            };
            adInterstitial.WillLeaveApplication += delegate {
                statusLbl.Text = string.Format(" [{0}] Will Leave Application ", adInterstitial.Space);
            };
            adInterstitial.DidFinishVideo += delegate {
                statusLbl.Text = string.Format(" [{0}] Did Finish Video ", adInterstitial.Space);
            };
            adInterstitial.WillPresentAd += delegate {
                statusLbl.Text = string.Format(" [{0}] Will Present Fullscreen Ad ", adInterstitial.Space);
            };
            adInterstitial.Error += (_, e) => {
                statusLbl.Text = string.Format(" [{0}] Did Fail to Receive Ad with error [{1}] ", adInterstitial.Space, e.ErrorDescription);
            };

            statusLbl.Text = string.Format(" [{0}] Will Fetch Ad ", adInterstitial.Space);

            adInterstitial.FetchAd();
        }
Ejemplo n.º 2
0
        private void ShowInterstitialAd()
        {
            if (adInterstitial != null)
            {
                adInterstitial.Destroy();
            }

            adInterstitial = new FlurryAdInterstitial(this, "Takeover");

            adInterstitial.Fetched += delegate {
                statusLabel.Text = "Interstitial.Fetched";

                adInterstitial.DisplayAd();
            };
            adInterstitial.Rendered += delegate {
                statusLabel.Text = "Interstitial.Rendered";
            };
            adInterstitial.Display += delegate {
                statusLabel.Text = "Interstitial.Display";
            };
            adInterstitial.Clicked += delegate {
                statusLabel.Text = "Interstitial.Clicked";
            };
            adInterstitial.Close += delegate {
                statusLabel.Text = "Interstitial.Close";
            };
            adInterstitial.AppExit += delegate {
                statusLabel.Text = "Interstitial.AppExit";
            };
            adInterstitial.VideoCompleted += delegate {
                statusLabel.Text = "Interstitial.VideoCompleted";
            };
            adInterstitial.Error += (_, e) => {
                statusLabel.Text = string.Format("Interstitial.Error [{0}] [{1}] ", e.ErrorType, e.ErrorCode);
            };

            statusLabel.Text = "Interstitial.FetchAd";

            adInterstitial.FetchAd();
        }