Debugging - tapdaq/cordova-plugin GitHub Wiki

Debugging

Contents

Display the debugger

Tapdaq's debugger enables you to test your SDK integration. You can specify and test different ad types from each ad network you have integrated to ensure you are receiving ads as expected.

Please note, for the debugger to work you will also need to have input the correct ad network keys on the Tapdaq dashboard.

To display the debugger, add the following:

Tapdaq.launchDebugger();

Export your build and run your application, you should have a popup appear with a list of networks to test.

Adding test devices

To add any test devices, go back to your options object you created to initialise the Tapdaq SDK, and add the following:

var options = {
    ios: {
        appId: "YOUR_IOS_APP_ID",
        clientKey: "YOUR_IOS_CLIENT_KEY",
        testDevices: [
            {
                network: Tapdaq.AdNetwork.AdMob,
                devices: ["YOUR_ADMOB_DEVICE_HASH"]
            },
            {
                network: Tapdaq.AdNetwork.FacebookAN,
                devices: ["YOUR_FB_DEVICE_HASH"]
            }
        ]
    },
    android: {
        appId: "YOUR_ANDROID_APP_ID",
        clientKey: "YOUR_ANDROID_CLIENT_KEY",
        testDevices: [
            {
                network: Tapdaq.AdNetwork.AdMob,
                devices: ["YOUR_ADMOB_DEVICE_HASH"]
            },
            {
                network: Tapdaq.AdNetwork.FacebookAN,
                devices: ["YOUR_FB_DEVICE_HASH"]
            }
        ]
    }, 
    ...
};

Export your build and run your application, you will now see test ads for AdMob and Facebook.

Retrieving test device hashes

Devices hashes can be found in your logs when loading an ad from AdMob and Facebook, they look like this:

// Android AdMob
I/Ads: Use AdRequest.Builder.addTestDevice("4D32C4G30407EPC0EBB847E0E2694ACE") to get test ads on this device.

// Android Facebook
D/AdSettings: Test mode device hash: 441g39532c1fy296e2840753c9c217b0

// iOS AdMob
<Google> To get test ads on this device, call: request.testDevices = @[ @"d3fsh152gbac80cbcf774dd4520a4696" ];

// iOS Facebook
[FBAudienceNetworkLog/FBAdSettings:133 thread:1] Test mode device hash: 0aaea61262f466eedc5efacf191bd33a321e676c

Network Status

The method networkStatuses() will return a list of all supported networks and their current status, as detailed in Adapter Status above. This will state if a network if successfully intergrated and initialised, or if not an error will be provided.

Tapdaq.networkStatuses(function(value) {
    console.log("Network Statuses: " + JSON.stringify(value));
});

What's next?

Now that you have successfully tested the ad networks that you wish to mediate, what would you like to do next?

⚠️ **GitHub.com Fallback** ⚠️