Step 7: Test your integration
You can test the SDK integration using one of the following methods:
- Set your integration to Test mode for certain devices.
- Set your integration to use Test Adspot Ids, which VMAX provides.
To add Test Devices
The VMAX SDK allows you to set a number of devices as Test Devices by passing their AdvertisingID to the SDK. You can add test devices by using the TestDevice property which takes a list of id (string) as its parameters.
1 |
adView.TestDevice = new List<string>() { [your advertising id/ids here] }; |
Each Device’s AdvertisingID can be fetched by using the following piece of code in your application.
1 2 3 4 5 6 |
// Place this snippet in a method and take the value returned by it and use it as device id. try { var advertisingIdToPrint = Windows.System.UserProfile.AdvertisingManager.AdvertisingId; } catch { } |
Once you have this list of device ids, this is how you can enable test mode.
The sdk exposes an API by name SetTestDevices() with a couple of parameters as:
SetTestDevices(VMAXAdView.TestMode testMode, List<string> listOfStringsOfDeviceIDs)
VMAXAdView.TestMode: This parameter will allow you to set the test mode that you want to set. It can have any of these values.
TEST_VIA_ADVID: this mode will need the list of device ids that is the second parameter. Test mode will be enabled for only those devices.
TEST_FOR_ALL_DEVICES: This mode will not require the list in the second parameter. You can pass a null there. All the devices will show test ads if this mode has been selected.
TEST_VIA_ID_FROM_NETWORKS: Reserved for future use.
Using this api you can set the test mode for your list of devices as shown below.
1 2 3 |
adView.SetTestDevices(VMAXAdView.TestMode.TEST_FOR_ALL_DEVICES, null); //or adView.SetTestDevices(VMAXAdView.TestMode.TEST_VIA_ADVID, listDeviceIds); |
Test Adspot Ids
Interstitial: 8063
Banner: 20846
Native In-feed: 010116d2
Native Content stream: V76062644
Reward Video Incent Ads: f2f24f2a
Offerwall Ads: ac19acf0
Video Ads: V762947e3
Note: Please ensure that your production app does not utilize these Adspots as these Adspots are only for testing and do not contribute to revenue.