1

I tried integrating InMobi interstitial ad to my android application by following the instructions mentioned here.

Below is the code I have incorporated in my activity class for displaying interstitial ads.

I get no exceptions but every time I run the code, the callback method onInterstitialFailed gets called displaying the message "The ad request was successful but no ad was found".

Looking forward to responses/solutions

interstitial = new IMInterstitial(this,
                "I mention the property_id");
        interstitial.loadInterstitial();
interstitial.setIMInterstitialListener(new IMInterstitialListener() {

            @Override
            public void onShowInterstitialScreen(IMInterstitial arg0) {
                Log.i("onShowInterstitialScreen", "inside");
            }

            @Override
            public void onLeaveApplication(IMInterstitial arg0) {
                Log.i("onLeaveApplication", "inside");
            }

            @Override
            public void onDismissInterstitialScreen(IMInterstitial arg0) {
                Log.i("onDismissInterstitialScreen", "inside");
            }

            @Override
            public void onInterstitialLoaded(IMInterstitial arg0) {

                if (interstitial.getState() == IMInterstitial.State.READY) {
                    Log.i("Inside Interstitial Ready state", "Ready");
                    interstitial.loadInterstitial();
                    interstitial.show();
                }

            }

            @Override
            public void onInterstitialInteraction(IMInterstitial interstitial,
                    Map<String, String> params) {
                Log.i("onInterstitialInteraction", "inside");
            }

            @Override
            public void onInterstitialFailed(IMInterstitial arg0,
                    IMErrorCode arg1) {
                Log.i("onInterstialFailed", "Failed " + arg1);
            }
        });
Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58

1 Answers1

0

I work for InMobi.

You should call

interstitial.loadInterstitial() in onInterstitialFailed instead of onInterstitialLoaded() of the call back.

Let me know if this works. Also, can you give me your property ID please?

Sohan
  • 1,287
  • 1
  • 15
  • 29
  • I tried the above suggestion of calling interstitial.loadInterstial() in onInterstialFailed instead of onInterstitialLoaded(). But it ran into an infinite loop giving the message "Ad download in progress. Your request cannot be processed at this time. Try again later." and later the app crashed by giving a fatal exception: Stack Overflow error. The Property id is "f068f49b6490464ba27703bd3e83bd44". – Swetha Baburao Sep 29 '14 at 08:02
  • Hm. Yes that my bad. That will turn into an infinite loop in this case. Which version of the SDK are you using? – Sohan Sep 29 '14 at 11:15
  • Checked your property ID and it isn't active. Are you trying in test mode? The ad is being served from our end. There is a small chance it's some server (on our side) being down too. Can you try in a day's time and see if it works? – Sohan Sep 29 '14 at 12:09
  • Yes, I was trying in the test mode. How do I activate the property id? I integrated it last week and not being able to see the ad from many days. Is the inMobi server down from many days? – Swetha Baburao Sep 29 '14 at 12:22
  • Looks like there is indeed a bug on our end regarding interstitials sent in diagnostic mode. Give us couple of days tops and we'll get it fixed. – Sohan Sep 30 '14 at 12:22
  • There is a problem displaying native ads also. Moreover there is no proper tutorial. It will be very helpful if I'm educated more about native ads as well. Will look forward to your reply – Swetha Baburao Oct 01 '14 at 03:57