Requesting Interstitial Ads – Windows Phone 8 Unity Plugin

ขออภัยรายการนี้จะใช้ได้เฉพาะในภาษาอังกฤษ English. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

The VMAX Unity Plugin provides various mechanisms to request for Ads in your Unity game. The plugin provides Ad request methods for Interstitials and Banners.

To request an Interstitial Ad:

Construct an object of the Class VMAXWP8Plugin.

Using the SetAdspotId() API, set an appropriate Adspot.

Using the SetAdUXType() API and the enum AdUXType to pass a parameter, set the Ad type as Interstitial.

After initialization, request for an Interstitial Ad, in any of the following 2 ways:Managed
For a managed interstitial ad request, call the loadAd() API.
The example below is set up to show an Interstitial Ad. VMAX recommends to call this function from the OnGUI () function.

1

2

3

4

5

6

7

8

9

10

11

publicVMAXWP8Plugin pluginVMAXAd;

voidStart(){

/*This is a test AdspotId, make sure you replace it before going live*/

pluginVMAXAd=newVMAXWP8Plugin();

pluginVMAXAd.SetAdspotId(“MY_ADSPOT_ID”);

pluginVMAXAd.SetAdUXType(VMAXWP8Plugin.AdUxType.Interstitial);

}

voidOnGUI(){

pluginVMAXAd.LoadAd();

}

Unmanaged
For an unmanaged interstitial ad request, call the CacheAd() API.
Show the cached ad whenever you wish to, using the showAd() API.
The example below is set up to show an Interstitial Ad using CacheAd() and ShowAd() APIs combination. VMAX recommends to call these functions from the OnGUI () function.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

publicVMAXWP8Plugin pluginVMAXAd;

voidStart(){

/*This is a test AdspotId, make sure you replace it before going live*/

pluginVMAXAd=newVMAXWP8Plugin();

pluginVMAXAd.SetAdspotId(“MY_ADSPOT_ID”);

pluginVMAXAd.SetAdUXType(VMAXWP8Plugin.AdUxType.Interstitial);

}

voidOnGUI(){

/*Call the CacheAd() API to cache the ad*/

pluginVMAXAd.CacheAd();

/*You can call the ShowAd() API whenever you need to show the cached ad*/