离子 - 显示AdMob横幅/插页式广告(iOS)的问题

时间:2018-03-15 12:36:04

标签: ios ionic-framework admob

在Android设备上展示横幅广告和插页式广告没有任何问题,但在iOS设备上它们无论如何都不显示,仅在页脚区域显示空白框并且没有弹出窗口 - 但是在模拟器上工作得非常好,显示测试广告。

在AdMob中 - 我只创建了一个应用(iOS),因此我只使用了两个广告单元ID(横幅和插页式广告),这可能是问题还是?

您可以在下面看到我的代码:

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { AdMobFree, AdMobFreeBannerConfig, AdMobFreeInterstitialConfig } from '@ionic-native/admob-free';

import { ProjectlistPage } from '../pages/projectlist/projectlist';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = ProjectlistPage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, private admobFree : AdMobFree) {
    platform.ready().then(() => {
      statusBar.styleDefault();
      splashScreen.hide();
      this.showAdmobBannerAds();
      this.showAdmobInterstitialAds();

    });
  }

  showAdmobBannerAds(){
    const bannerConfig: AdMobFreeBannerConfig = {
        id: 'ca-app-pub-xxxxxx', 
        isTesting: false,
        autoShow: true,

      };
    this.admobFree.banner.config(bannerConfig);

    this.admobFree.banner.prepare()
    .then(() => {

        this.admobFree.banner.show();
    })
    .catch(e => console.log(e));    
    }


    showAdmobInterstitialAds(){
      const interstitialConfig: AdMobFreeInterstitialConfig = {
          id: 'ca-app-pub-xxxxxx', 
          isTesting: false,
          autoShow: true,

        };
        this.admobFree.interstitial.config(interstitialConfig);

        this.admobFree.interstitial.prepare()
        .then(() => {
            this.admobFree.interstitial.show();
        })
        .catch(e => console.log(e));    
      } 
}

有人有任何建议吗?

感谢。

1 个答案:

答案 0 :(得分:0)

通过调整AdMob中的付款详细信息来解决此问题,以反映我公司100%的DUNS信息。

https://github.com/ratson/cordova-plugin-admob-free/issues/157#issuecomment-374006844