0

我正在尝试将 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 文件中添加了此处提到的所有内容。我已经在应用程序标签中添加了所有权限,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 诊断是否有问题(Sohan 在他的评论中这么说)。

4

1 回答 1

1

我来自 InMobi 团队。您是否将代码中的“Property-Id”替换为您的实际属性 ID?我不确定您上面提供的代码是您的实际代码还是仅用于说明目的...

于 2014-12-14T06:37:47.010 回答