The VMAX SDK provides various mechanisms to request for Ads in your WP 8 application. The SDK makes available both simple fully-managed Ad request methods and also the Cache & Show Ad methods to enable prefetching of ads for later viewing.
Managed Interstitials using LoadAd()
To request an interstitial, call the LoadAd() method.
For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
VMAXAdView adView=new VMAXAdView (); // To initialize the VMAXAdView adView.UX=AdUX.Interstitial; // To specify Interstitial ads. adView.AdspotId = "MY_ADSPOT_ID"; // To specify the Adspot Id. Replace "MY_ADSPOT_ID" with your actual Adspot Id. //Interstitial Caching (Recommended) //To Cache Ads and show later will be possible through below api: adView.DidCacheAd += adView_DidCacheAd; adView.FailedToCacheAd += adView_FailedToCacheAd; adView.CacheAd(); // To perform caching of the Ad. If required, this event can be used to run any custom code. private void adView_DidCacheAd(object sender, EventArgs e) { adView.ShowAd(); // To show the Cached Ad } private void adView_FailedToCacheAd(object sender, com.vmax.windows.ads.wp8.VMAXAdView.AdFailedEventArgs e) { } |