Test mode iOS

To test ads in your app, follow the steps below.

  1. Load your ads-integrated app and make an ad request.

  2. Check the console for a message that looks like this:
[myTarget debug] Current device's Instance Id is D346D6CE-3414-4C22-BFC8-B4DD4983B1C8, use this value in method withTestDevices() on ad instance in order to enable Test Mode.
Copy Instance Id of test device to clipboard.

3. Modify your code to set the test device ID through withTestDevices:(nullable NSArray<NSString *> *) and pass Instance Id of test device(s):
MTRGNativeAd *nativeAd = [[MTRGNativeAd nativeAdWithSlotId:12345] withTestDevices:@[@"D346D6CE-3414-4C22-BFC8-B4DD4983B1C8"]];
MTRGNativeAd *nativeAd = [MTRGNativeAd nativeAdWithSlotId:12345];
[nativeAd withTestDevices:@[@"D346D6CE-3414-4C22-BFC8-B4DD4983B1C8", @"D346D6CE-3414-4C22-BFC8-B4DD4983B1C8"]];
Be sure to remove the code that sets these test devices before you release your app.

4. Re-run your app
Was this article helpful?