InMobi interstitial ads are not getting displayed android

a 夏天 提交于 2019-12-11 10:15:26

问题


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);
            }
        });

回答1:


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?



来源:https://stackoverflow.com/questions/26053583/inmobi-interstitial-ads-are-not-getting-displayed-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!