通过将脚本集成到apppresser中,无admob插页式广告仅向我显示测试,而不向我显示真实广告

时间:2019-11-27 15:13:16

标签: javascript cordova-admob phonegap-admob

(function() {
  ready("#showAdDiaria", function(element) {

    var el = document.getElementById("showAdDiaria");
    var adunit;
    var userAgent = navigator.userAgent;

    if (/(android)/i.test(userAgent)) {
        // put android ad unit ID here
        adunit = 'ca-app-pub-xxx/xxxx'
    }

    if (/(iPad|iPhone|iPod)/.test(userAgent) ) {
        // put iOS ad unit id here
        adunit = 'ca-app-pub-xx/xx'
    }
    if (AdMob) {
      AdMob.prepareInterstitial({
        adId: adunit,
        isTesting: false,
        autoShow: false
      });
    }

    el.addEventListener("click", function() {
        console.log('clicked show ad', AdMob);
      // show the interstitial later, e.g. at end of game level
      if (AdMob) AdMob.showInterstitial();
    });

  });

})();

输入脚本时,我收到未定义Admob变量的错误

0 个答案:

没有答案