Testing and Troubleshooting

Retrieve the CreativeID

At times, there are rogue advertisers who escape all the ad quality checks and end up compromising the user experience on the app by showcasing either an irrelevant, distasteful or disrupting creative to the user. To combat such situations, you can retrieve the creativeID of the ad instance and report back to your InMobi point of contact with the encrypted creativeID. CreativeID is a property of IMBanner, IMInterstitial and IMNative object, which can be retrieve as follow:

Objective

- (void)bannerDidFinishLoading:(IMBanner*)banner { 
    NSString* creativeId = banner.creativeId;
}


Swift

public func bannerDidFinishLoading(_ banner: IMBanner!) {
    bannerAd.creativeId
}

Test the Integration

  1. Configure the test mode on InMobi portal.
  2. Go to Tools - Diagnostics and switch Test Mode to either Global ON or Selective ON.

If you are integrating an ad unit for the first time

Set Test Mode to Global ON.

If you want to selectively turn on test traffic for a set of devices.

You already have a prior version of the SDK integrated for this ad unit and therefore you should restrict your testing to only few devices.

Set Test Mode to Selective ON.

In the device section:

  1. In the Device ID box, type the device ID.
  2. In the Device Name box, set any name.
  3. Click Add Device to add the test device.

If you already have a device configured, you can select the device and test mode will be enabled.

Remember

You MUST turn off the test mode before going live or else your app will fail to monetize.

Now you are all set to get test ads.


Get the Device ID

The device id is basically the IDFA or IFA (Identifier for Advertising). To get device ID:

Objective

#import AdSupport 
NSString* deviceID = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];


Swift

import AdSupport 
let deviceId = ASIdentifierManager.shared().advertisingIdentifier.uuidString

Helpful Debug Information

  1. Set log level to debug: [IMSdk setLogLevel: kIMSDKLogLevelDebug]
  2. You will get feedback on the diagnostics tab on the ad unit and ad request and this can be particularly helpful during integration.


The important set of logs are documented in the following tables.

SDK Initialization

Scenario

Log Level

Logs

Publisher passed valid account id

Debug

InMobi SDK initialized with account id:

Publisher passed an invalid account Id

Error

Invalid account id passed to init. Please provide a valid account id.

Newer version of SDK is available

Debug

A newer version (ver. 9.0.0) of the InMobi SDK is available! You are currently on an older version (ver. 5.3.1). Download the latest InMobi SDK from http://www.inmobi.com/products/sdk/#downloads.

Ads Common

Scenario

Log Level

Logs

Ad requested when no network available

Error

Network not reachable currently. Please try again.

Ad requested when ad state is loading or available

Error

An ad load is already in progress. Please wait for the load to complete before requesting for another ad (Placement id : ).

Ad requested when ad is viewed by user

Error

An ad is currently being viewed by the user. Please wait for the user to close the ad before requesting for another ad (Placement id : ).


Messages for Ad Integrations

 Banner

Scenario

Log Level

Logs

Publisher created a banner without initializing the SDK

Error

Please initialize the SDK before creating a Banner ad

Publisher created a banner with an invalid/null placement id

Error

Please provide a valid placement id to create a Banner ad

Publisher called load on a banner from IB/xml with improper placement id

Error

Please provide a valid placement id to create a Banner ad

Publisher called load on a banner

Debug

Fetching a Banner ad for placement id: ()

Successfully fetched ad

Debug

Banner ad successfully fetched for placement id: ()

Failed to fetch the ad

Debug

Failed to fetch Banner ad for placement id: ( with error: )

Started loading the banner in a webview

Debug

Started loading Banner ad markup in the webview for placement id: ()

Banner successfully loaded in the webview

Debug

Successfully loaded Banner ad markup in the webview for placement id: ()

Failed to load banner in the webview

Debug

Failed to load the Banner markup in the webview for placement id: ()

Banner refresh is initiated

Debug

Initiating Banner refresh for placement id: ()


Interstitial

Scenario

Log Level

Logs

Publisher created a interstitial without initializing the SDK

Error

Please initialize the SDK before creating a interstitial ad

Publisher created a interstitial with an invalid placement id

Error

Please provide a valid placement id to create a interstitial ad

Publisher called load on an interstitial

Debug

Fetching an interstitial ad for placement id:

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id:

Failed to fetch the ad

Error

Failed to fetch Interstitial ad for placement id: with error:

Started loading the interstitial in a webview

Debug

Started loading Interstitial ad markup in the webview for placement id:

Interstitial successfully loaded in the webview

Debug

Successfully loaded Interstitial ad markup in the webview for placement id:

Failed to load interstitial in the webview

Error

Failed to load the Interstitial markup in the webview for placement id:

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show

Full screen ad cannot be displayed without a view controller. Please pass a view controller to present the full screen ad.

Error

Full screen ad cannot be displayed without a view controller. Please pass a view controller to present the full screen ad.

Rewarded Video

Scenario

Log Level

Logs

Publisher created a interstitial without initializing the SDK

Error

Please initialize the SDK before creating a interstitial ad

Publisher created a interstitial with an invalid placement id

Error

Please provide a valid placement id to create a interstitial ad

Publisher called load on an interstitial

Debug

Fetching an interstitial ad for placement id:

Successfully fetched ad

Debug

Interstitial ad successfully fetched for placement id:

Failed to fetch the ad

Error

Failed to fetch Interstitial ad for placement id: with error:

Started loading the interstitial in a webview

Debug

Started loading Interstitial ad markup in the webview for placement id:

Interstitial successfully loaded in the webview

Debug

Successfully loaded Interstitial ad markup in the webview for placement id:

Failed to load interstitial in the webview

Error

Failed to load the Interstitial markup in the webview for placement id:

Interstitial Ad displayed

Debug

Successfully displayed Interstitial for placement id:

Interstitial Ad dismissed

Debug

Interstitial ad dismissed for placement id:

Ad show before ready Show ad before it's ready

Error

Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show

Full screen ad cannot be displayed without a view controller. Please pass a view controller to present the full screen ad.

Error

Full screen ad cannot be displayed without a view controller. Please pass a view controller to present the full screen ad.

Native

Scenario

Log Level

Log Message

Publisher created a native ad without initializing the SDK

Error

Please initialize the SDK before creating a Native ad

Publisher created a native ad with an invalid placement id

Error

Please provide a valid placement id to create a native ad

Publisher called load on a native

Debug

Fetching a Native ad for placement id:

Ad is successfully fetched from server

Debug

Native ad successfully fetched for placement id:

Failed to fetch the ad

Error

Failed to fetch Native ad for placement id : with error : 

On This Page

Last Updated on: 21 Sep, 2020