protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); Chocolate.EnableChocolateTestAds(DO_ENABLE_TEST_ADS); Chocolate.Init(this, CHOCOLATE_API_KEY, chocolateAdRequest, this); /* admobBannerAd = FindViewById<AdView>(Resource.Id.adView); * var adRequest = new AdRequest.Builder().Build(); * admobBannerAd.LoadAd(adRequest); */ chocolateInviewAdContainer = FindViewById <ViewGroup>(Resource.Id.chocolateInviewAdContainer); loadInterstitialButton = FindViewById <Button>(Resource.Id.load_interstitial_button); loadInterstitialButton.SetOnClickListener(new OnClickListener(this, ADTYPE_INTERSTITIAL)); loadRewardedButton = FindViewById <Button>(Resource.Id.load_rewarded_button); loadRewardedButton.SetOnClickListener(new OnClickListener(this, ADTYPE_REWARDED)); loadInviewButton = FindViewById <Button>(Resource.Id.load_inview_button); loadInviewButton.SetOnClickListener(new OnClickListener(this, ADTYPE_INVIEW)); chocolateAdRequest = new LVDOAdRequest(this); chocolateRewardedAd = new LVDORewardedAd(this, CHOCOLATE_API_KEY, this); chocolateInterstitialAd = new LVDOInterstitialAd(this, CHOCOLATE_API_KEY, this); chocolateInviewAd = new LVDOBannerAd(this, LVDOAdSize.IabMrect, CHOCOLATE_API_KEY, this); }
// The interstitial has been cached and is ready to be shown. public void OnInterstitialLoaded(LVDOInterstitialAd interstitialAd) { chocolateInterstitialAd.Show(); }
// The interstitial has being dismissed. Resume / load state accordingly. public void OnInterstitialDismissed(LVDOInterstitialAd interstitialAd) { }
// The interstitial has been clicked and take actions accordingly. public void OnInterstitialClicked(LVDOInterstitialAd interstitialAd) { }
// The interstitial has been shown. Pause / save state accordingly. public void OnInterstitialShown(LVDOInterstitialAd interstitialAd) { }
// The interstitial has failed to load. Inspect errorCode for additional information. public void OnInterstitialFailed(LVDOInterstitialAd interstitialAd, LVDOConstants.LVDOErrorCode errorCode) { }