我正在尝试将InMobi集成到我的应用中,我可以成功展示横幅广告但无法添加插页式广告。
我已在我要展示广告的活动中添加了此代码。
InMobi.setLogLevel(InMobi.LOG_LEVEL.DEBUG);
InMobi.initialize(this, "Property-id");
final IMInterstitial interstitial = new IMInterstitial(this, "Property-id");
interstitial.setIMInterstitialListener(new IMInterstitialListener() {
@Override
public void onInterstitialFailed(IMInterstitial imInterstitial, IMErrorCode imErrorCode) {
Log.e(DEBUG_TAG, "Interstitial failed" + "... Error code = " + imErrorCode +
"... Internstial = " + imInterstitial);
}
@Override
public void onInterstitialLoaded(IMInterstitial imInterstitial) {
Log.e(DEBUG_TAG, "interstitial loaded");
if (interstitial.getState() == IMInterstitial.State.READY) {
interstitial.show();
}
}
@Override
public void onShowInterstitialScreen(IMInterstitial imInterstitial) {
}
@Override
public void onDismissInterstitialScreen(IMInterstitial imInterstitial) {
}
@Override
public void onInterstitialInteraction(IMInterstitial imInterstitial, Map<String, String> stringStringMap) {
}
@Override
public void onLeaveApplication(IMInterstitial imInterstitial) {
}
});
interstitial.loadInterstitial();
为了测试,我在AndroidManifest.xml文件中添加了here中提到的所有内容。我在应用程序标记中添加了所有权限,hardwareAccelerated = true,并且:
<activity
android:name="com.inmobi.androidsdk.IMBrowserActivity"
android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<receiver
android:name="com.inmobi.commons.analytics.androidsdk.IMAdTrackerReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="com.inmobi.share.id" />
</intent-filter>
</receiver>
<service
android:name="com.inmobi.commons.internal.ActivityRecognitionManager"
android:enabled="true" />
但我一直收到此错误“广告请求已成功,但未返回任何广告”,经过一小段时间间隔后,广告网络无法检索广告。
对于横幅广告,它可以成功运作。我再试一次,但现在不行。如所提到的那样,inmobi诊断是否有问题here(Sohan在他的评论中说过这一点)。
答案 0 :(得分:1)
我来自InMobi团队。您是否正在替换&#34; Property-Id&#34;在您的代码中使用您的实际属性ID?我不确定您上面提供的代码是您的实际代码还是仅用于说明目的......