4. Integration Testing
4.1. Integration Testing Instructions
This section explains how to enable test ads in ad integration. Enabling test ads during development is very important so you can click on them without charging advertisers.
Methods to obtain test ads are as follows:
- Enable test requests
- Enable test devices
- Others
4.2. Enable Test Requests
TAdManager.init(this, new TAdManager.AdConfigBuilder()
// Whether to print ad logs, default is false; if set to true, logs will be printed with keywords ADSDK_M, ADSDK_N
.setDebug(false)
// Whether to request test ads, default is false; if true, request test ads from ad platforms, otherwise request production ads
.testDevice(false)
.build());
Important Reminder: Before going live, be sure to change all the above parameters to false to avoid confidential data leakage and dirty data affecting online statistics.
Enable Log Commands
adb shell setprop log. tag. ADSDK DEBUG//Enable advertising log
adb shell setprop log.tag.AD_ NET_ LOG DEBUG//Enable ad network request log
4.3. Enable Test Devices
If you want more rigorous testing with ads that look similar to the actual production environment, you can configure your device as a test device. For specific procedures, please refer to Add Test Device
4.4. Testing Process
- Apply for official app id and related ad unit ids from the Hisavana platform. If you have questions, please contact Operations Personnel.
- If you need to verify test ads, set the testDevice method parameter to true when enabling test requests, or when enabling test devices, maintain pre-release parameter settings and simply Add Test Device.
- If you want to test third-party ads like Admob, Facebook, etc., first register on the Admob, Facebook and other platforms, then aggregate Admob, Facebook and other ad sources on the Hisavana platform.
- Before going live, be sure to change the testDevice method parameter to false.
Reminder: When switching ad units, due to the need to update ad unit configuration information, please clear the app cache data promptly. Clear cache operation is in app details, or execute the command adb shell pm clear package name, otherwise the following error may occur:
9009 ad unit is closed by operational staff
4.5. Integration Examples
Please download the integration example code and refer to the code for integration.
4.6. Test Ad Sources
Important Reminder: Please configure the third-party advertising ID on the Hisavana platform.