【问题标题】:Ionic - Problems displaying AdMob banner/interstitial (iOS)Ionic - 显示 AdMob 横幅/插页式广告 (iOS) 时出现问题
【发布时间】:2018-03-15 12:36:04
【问题描述】:

在 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));    
      } 
}

大家有什么建议吗?

谢谢。

【问题讨论】:

    标签: ios ionic-framework admob


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-04
      相关资源
      最近更新 更多