Skip to main content

Test Mode

Introduction#

After completing the integration of TradPlus, developers need to conduct testing. In order to facilitate developers to verify the integration effect, TradPlus provides a test mode. After the developer configures the test mode in the TradPlus background, it can be tested directly.

Step 1、Preconditions#

1.1 The test machine is a real machine#

The advertising platform does not adapt to the simulator. For example: when using a simulator to test overseas advertising sources, errors are often reported due to the lack of certain libraries in the simulator, which cannot be resolved.

1.2 Get Device ID#

  • (1)You must initiate an advertisement request after the initialization is successful before you can get the delivered configuration. The code example is as follows:
  • (2)When initializing the TP SDK, fill in the application ID correctly. Wrong application ID will result in no match.

Android Platform

TradPlusSdk.setTradPlusInitListener(new TradPlusSdk.TradPlusInitListener() {
@Override
public void onInitSuccess() {
// The initialization is successful, and the ad request can be initiated to get parameters such as GAID
}
});
TradPlusSdk.initSdk(context, "The application ID you created on the TradPlus platform");

Unity3D Platform

void Start()
{
TradplusAds.Instance().OnInitFinish += OnInitFinish;
//Init SDK
TradplusAds.Instance().InitSDK("The application ID you created on the TradPlus platform");
}
void OnInitFinish(bool success)
{
// The initialization is successful, and the ad request can be initiated to get parameters such as GAID
}
  • (3)After successful initialization, Logcat filters TradPlusLog to obtain the GAID and TpUserId of the test machine:
2022-03-22 14:15:57.197 2437-2437/? I/TradPlusLog: Is eu.false
2022-03-22 14:15:57.197 2437-2437/? I/TradPlusLog: Is ca.false
2022-03-22 14:15:57.200 2437-2437/? I/TradPlusLog: SDK Initialized.
2022-03-22 14:15:59.201 2437-2437/? I/TradPlusLog: Publisher Gaid is 3e6d946a-6adb-4e3f-9e57-10ca1ad1abe1
2022-03-22 14:15:59.202 2437-2437/? I/TradPlusLog: Publisher TpUserId is UID-923ce357-373a-40f5-922f-16fe5915faaa

Step 2、Background configuration test mode#

2.1 Enter the settings page#

In Advanced Settings --> Test Mode , enter the test mode setting page of the ad slot

2.2 Add test equipment#

  • When adding a test device, fill in the device ID, device name, application and ad network
  • The device ID supports the following content: Android supports GAID, OAID

2.3 Switch to test mode#

  • After the test device is successfully added, restart the application.
  • initialize the SDK, and initiate an ad request after receiving the initialization success callback, which will switch to the test mode (if the switch is not successful, you can request it again)

Step 3、Confirm to enable test mode#

  • LogCat filters "TradPlusLog" to confirm, if there is "----- TradPlus TestMode Is On ----- ", it indicates that it has been successfully turned on, otherwise there will be no Log printing (supported by V7.7.0.1 and above)
  • Development needs to pay attention to closing the test mode after the test is completed, otherwisethe advertisement configured in the test mode will be sent all the time
2022-03-22 15:01:37.209 7366-7753/? I/TradPlusLog: ----- TradPlus TestMode Is On -----
2022-03-22 15:01:37.209 7366-7753/? I/TradPlusLog: ----- Test Adsource PlacementId :TESTBANNER2-2508082 -----
2022-03-22 15:01:37.209 7366-7753/? I/TradPlusLog: ----- Test ChannlName :vungle -----

Step 4、Advertisement Source Test Precautions#

4.1 Meta(FaceBook)#

The meta test needs to meet many conditions. If you want to know more, please jump to the official instructions to view the Audience Network integration checklist and ad request error codes ,The following briefly describes the precautions:

  • (1)Install and log in the Facebook application on the test device;
  • (2)Check whether the above "Prerequisites for Configuring Test Mode" has been met, such as: real machine, overseas network, setting TestDevice, etc

4.2 Google AdMob#

  • Add your AdMob app ID to your app's AndroidManifest.xml file. The App ID can be found in the AdMob UI. Replace it with your own account APP ID before the official launch. The code below is for testing purposes only。If in doubt, please see the official instructions Set up your app in your AdMob account
  • AdMob 20.3.0 or lower, and Android S as the target platform application, you must add the com.google.android.gms.permission.AD_ID permission in the AndroidManifest.xml file
  • AdMob 20.4.0 or later, AdMob SDK has automatically declared permissions
<manifest>
<application>
<!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
<!-- For Android S devices & GMA SDK version 20.3.0 or lower -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
</application>
</manifest>