Facebook 奖励广告未加载

时间:2021-03-30 00:17:21

标签: android facebook ads facebook-audience-network

我的插页式广告和横幅广告效果良好,但激励广告不起作用。 有我的代码。 其他广告效果很好,有什么问题?我错过了什么?感谢帮助。 其他广告效果很好,有什么问题?我错过了什么?感谢帮助。

 InterstitialAdListener interstitialAdListener = new InterstitialAdListener() {
            @Override
            public void onInterstitialDisplayed(Ad ad) {
                // Interstitial ad displayed callback
            }

            @Override
            public void onInterstitialDismissed(Ad ad) {
                // Interstitial dismissed callback
            }

            @Override
            public void onError(Ad ad, AdError adError) {
                // Ad error callback
            }

            @Override
            public void onAdLoaded(Ad ad) {
                // Interstitial ad is loaded and ready to be displayed
                // Show the ad
                interstitialAd.show();
            }

            @Override
            public void onAdClicked(Ad ad) {
                // Ad clicked callback
            }

            @Override
            public void onLoggingImpression(Ad ad) {
                // Ad impression logged callback
            }
        };

        interstitialAd.loadAd(
                interstitialAd.buildLoadAdConfig()
                        .withAdListener(interstitialAdListener)
                        .build());
        if (interstitialAd==null){
            interstitialAd.loadAd();

    public void goActivity(View view){
        progressBar.setVisibility(View.VISIBLE);
        Intent intent = new Intent(getApplicationContext(), activity2.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        getApplicationContext().startActivity(intent);
        progressBar.setVisibility(View.INVISIBLE);
        if (interstitialAd.isAdLoaded()) {
            Toast.makeText(this,"YES",Toast.LENGTH_SHORT).show();
            interstitialAd.show(); }
    }

0 个答案:

没有答案