The VMAX SDK provides various mechanisms to request for Ads in your WP 8.1 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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
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. adView.TimeOut = 20; // To specify the timeout in case of Ad failure. Default is 20 // Location and demographic targeting information may also be specified. Out of respect for user privacy, VMAX asks that you only specify location and demographic data if that information is already used by your app. Below are example of optional properties: adView.UserInfo.Age ="age"; adView.UserInfo.City = "city"; adView.UserInfo.Email = "email"; adView.UserInfo.Gender = "gender"; Note* - where "age", "city", "email" and "gender" should be replaced with the actual values meeting your targeting requirements. for e.g.- Note: Kindly don’t copy paste the code as it is. As that may have bad impact on targeting of Ads served to user. adView.UserInfo.Age = 23; adView.UserInfo.City = "Mumbai"; adView.UserInfo.Gender = eGender.Male; adView.UserInfo.Email = "abc@xyz.com"; adView.LoadAd(); // This will load the Ad and on success provides a callBack named DidLoadAd. You need to handle this to perform any action on this event in your application. //Interstitial Caching //To Cache Interstitial Ads for later viewing is possible through the below API: adView.CacheAd(); // To perform caching of the Ad. If required, this event can be used to run any custom code. //Showing Cached Ads: adView.ShowAd(); // To show the Cached Ad //Cancel Ads: adView.CancelAd(); // To cancel the Cached Ad and free up all adview resources . |