我尝试按照此处提到的说明将 InMobi 插页式广告集成到我的 android 应用程序中。
下面是我在我的活动类中加入的用于显示插页式广告的代码。
我没有例外,但每次运行代码时,都会调用回调方法onInterstitialFailed显示消息“广告请求成功但未找到广告”。
期待回复/解决方案
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);
}
});