Here is a checklist to help you find an eventual problem you could encounter while implementing the Monetization features in your application.

Before contacting us, please check each point so we can help you more quickly in your debugging process.

  1. Is the library correctly initialized?
  2. Are the ads loaded from the web service?
  3. Is there a modal ad to display?
  4. What if requesting a modal doesn’t work?
  5. Still a problem?

1. Is the library correctly initialized?

Before anything, the library needs to initialize itself. Most of the time it’ll be done in the first two seconds. But here’s how to check if the process was successful:

if (m_adSdk.isInitialized()) {
    Log.d (CLASS_TAG, "Monetization SDK is initialized");
}

It’s best to implement the delegate method which will let you know when the library initialized:

@Override
public void onAdUnitInitialized() {
     // Ad unit initialized
   Log.d (CLASS_TAG, "Monetization SDK is initialized");
}

Why is it that the library doesn't initialize?

  • The process isn’t finished.
  • You haven’t set an API key (in basic SDK requirements).
  • The device isn’t connected to the internet.

2. Are the ads loaded from the web service?

The second thing you should verify is the connection between the library and the web service. When the library is initialized, we try to fetch the latest ads from the web service. Once received, we’ll process any eventual pending request.

Like for the library initialization, you can check if this process was successful. This doesn’t mean there’ll be an ad available, but only that the synchronization with the server was correctly done.

if (m_adSdk.areAdsLoaded()) {
    Log.d (CLASS_TAG, "Ads correctly loaded from web service");
}

Why is it that the ads will not load?

  • The library isn’t initialized.
  • The initialization process isn’t finished.
  • The device isn’t connected to the internet.

3. Is there a modal ad to display?

Now you are sure ads are correctly loaded, you can check if there is any modal ad available. As for the library initialization, you have two ways to know it.

The first one is pretty simple and can be done whenever you want.

// Check if a modal ad of type Sushi is available
if (m_adSdk.isAModalAdOfTypeAvailable("SUSHI_ZONE_ID", AFAdSDKModalType.AFAdSDKModalTypeSushi)) {
    Log.d (CLASS_TAG, "A Modal Ad is Available");
}

It’s best to implement the delegate method which will let you know when ads are loaded and there is a modal ad available:

@Override
public void onModalAdAvailable(String zoneId) {
    // A modal ad (sushi interstitial) is available
    Log.i (CLASS_TAG, "onModalAdAvailable for zone " + zoneId);
}

Why is it that there is no modal ad available?

  • Ads aren’t loaded from the web service.
  • You're no longer in debug mode, and there is no ad to display at that time in your country

If you're not seeing your app because of the second reason, be sure to toggle “debug mode”, which will display an app whatever the conditions. Just make sure to disable “debug mode” before submitting your app And know that it is perfectly normal if you've turned off "debug mode" in preparation for submission and are not seeing ads. You'll see it once we do have a campaign in your geography.

4. What if requesting a modal doesn’t work?

First be sure to implement the event hander that alerts you when a modal failed to display. It may give you a clue! Check the method onModalAdFailedToDisplay(AFAdSDKError errCode)

5. Still a problem?

Don’t hesitate to contact us (see the Support section), we’ll do our best to help you.