MoPub“onInterstitialFailed”广告监听器在离线时不起作用 解决方案:

问题描述

我正在展示 MoPub Interstitial adactivities

当我的设备在线/连接到互联网时。然后adListener工作 正常。这在设备离线时不起作用。

情况:如果 ad not loadedfailed 那么我想在那里使用 Intent 移动下一个 activity但是这 MoPubAdListener 在我离线时不起作用。

mInterstitial.load() 方法中的插页式 onCreate

当用户按下后退按钮时,插页式广告被调用

@Override
    public void onBackPressed() {
        try {
            customProgressDialogForAd.show(getSupportFragmentManager(),"before interstitial");
            funInterstitialLoadShow();
        } catch (Exception e){
            QuestionActivity.super.onBackPressed();
        }
        //super.onBackPressed();
    }

间隙调用功能

private void funInterstitialLoadShow(){
        mInterstitial.setInterstitialAdListener(new MoPubInterstitial.InterstitialAdListener() {
            @Override
            public void onInterstitialLoaded(MoPubInterstitial moPubInterstitial) {
                Toast.makeText(QuestionActivity.this,"adloaded",Toast.LENGTH_SHORT).show();
                mInterstitial.show();
                customProgressDialogForAd.dismiss();
            }

            @Override
            public void onInterstitialFailed(MoPubInterstitial moPubInterstitial,MoPubErrorCode moPubErrorCode) {
                customProgressDialogForAd.dismiss();
                QuestionActivity.super.onBackPressed();
                
                // PROBLEM HERE: THIS fun now work when Device is OFFLINE(NO INTERNET);
            }

            @Override
            public void onInterstitialShown(MoPubInterstitial moPubInterstitial) {
            }

            @Override
            public void onInterstitialClicked(MoPubInterstitial moPubInterstitial) {
                
            }
            @Override
            public void onInterstitialDismissed(MoPubInterstitial moPubInterstitial) {
                customProgressDialogForAd.dismiss();
                QuestionActivity.super.onBackPressed();

            }
        });
    }

问题:当设备未连接到互联网时,onInterstitialFailed 不起作用。 [另一方面,如果设备中的互联网已打开,则 sdk 正常工作,例如,如果我们关闭广告,则 onInterstitialDismissed 工作]

任何解决方案:请

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)