5 - Test your integration with test Ads
Once the ads are integrated into the application, it is necessary to test that the integration is correct. For this purpose, X3M provides the capability to receive test ads from pre-configured placements.
Request Test Ads
When testing you should request ads by setting the test flag to true when initializing XMediator and when creating ad instances. We use this flag to ask the underlying networks to provide us with test ads when possible.
Info
Some mediation services (or their underlying networks) may not support this flag and might provide other means to test their integration, so make sure to always check their documentation for any additional steps.
We do provide test Placement Ids to enable a quick way to test the integration.
Test Placement Ids
Placement | X3M | MAX Mediation | LevelPlay Mediation |
---|---|---|---|
App key | 3-15 | 3-180 | 3-181 |
Banner | 3-15/28 | 3-180/1150 | 3-181/1153 |
Interstitial | 3-15/26 | 3-180/1151 | 3-181/1154 |
Rewarded | 3-15/27 | 3-180/1152 | 3-181/1155 |
Warning
Remember to replace these test placements with your own placements and always set the test flags to false in a production environment
Enable test mode
Set the test flag to true to see test ads when available.
val shouldRequestTestAds = BuildConfig.DEBUG
// Initialize
XMediatorAds.startWith(
activity = activity,
appKey = "3-15",
initSettings = InitSettings(test = shouldRequestTestAds),
initCallback = {
XMediatorAds.Banner.create("3-15/28", Banner.Size.Phone)
XMediatorAds.Interstitial.load("3-15/26")
XMediatorAds.Rewarded.load("3-15/27")
}
)
final boolean shouldRequestTestAds = BuildConfig.DEBUG;
// Initialize
XMediatorAds.startWith(
activity,
"3-15",
new InitSettings.Builder()
.setTest(shouldRequestTestAds)
.build(),
initResult -> {
XMediatorAds.getBanner().create("3-15/28", Banner.Size.Phone.INSTANCE);
XMediatorAds.getInterstitial().load("3-15/26");
XMediatorAds.getRewarded().load("3-15/27");
return Unit.INSTANCE;
}
);
Enable verbose logging
Setting the verbose flag to true will output extra logging information to Logcat.