You can test the SDK integration by setting your integration to Test mode for certain devices.
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 7 |
// Place this snippet in a method and take the value returned by it and use it as device id. try { var value = (byte[])DeviceExtendedProperties.GetValue("DeviceUniqueId"); return Convert.ToBase64String(value); } catch { return string.Empty; } |
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); |