获得空白黑色的AdMob广告科尔多瓦用Admob的插件 [英] Getting Blank Black adMob ad in Cordova using Admob Plugin

查看:266
本文介绍了获得空白黑色的AdMob广告科尔多瓦用Admob的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这 AdMob的科尔多瓦插件。我已经安装了该插件的Icenium,把JavaScript的code在体内的:

I am using this admob cordova plugin. I've installed the plugin in Icenium and put the javascript code in the body:

document.addEventListener('deviceready', function () {
if (window.plugins && window.plugins.AdMob) {
    var admob_ios_key = 'xxxxxxxxxxxxxxx';
    var admob_android_key = 'xxxxxxxxxxxxxxx';
    var adId = (navigator.userAgent.indexOf('Android') >= 0) ? admob_android_key : admob_ios_key;
    var am = window.plugins.AdMob;

    am.createBannerView(
        {
            'publisherId': adId,
            'adSize': am.AD_SIZE.BANNER,
            'bannerAtTop': false
        },
         function () {
              am.requestAd(
                { 'isTesting': true },
                    function () {
                        am.showAd(true);
                    },
                    function () { alert('failed to request ad'); }
                );
            },
            function () { alert('failed to create banner view'); }
        );
} else {
    alert('AdMob plugin not available/ready.');
}

});

我的问题是,我没有看到广告,但只是一个黑色的矩形占位符在屏幕的底部。

My problem is that I don't see the ad, but just a black rectangle placeholder at the bottom of the screen.

我想知道为什么它不显示广告,如果这是必须做的asmob_ios_key和admob_android_key,我想知道放在那里。我把我的AdMob发布商ID号码(不含'pub-),但我不知道这是我应该把在外地

I wanted to know why it doesn't show the ad, and if that's have to do with the asmob_ios_key and admob_android_key, I want to know what to put there. I put my admob publisher id number (without the 'pub-'), but I am not sure that this what I should put in the field

推荐答案

我知道这是旧的,但我刚装了这个在X code,用科尔多瓦3.3.0。我用我的发布者ID。开始与A。我确实有它错了,我得到了一个空白的黑色画面的底部,竟然出现了标记之间有一些间隔

I know this is old but i have just installed this on xcode, using cordova 3.3.0. I used my publisher id. began with an 'a'. I did have it in wrong and i got a blank black screen at the bottom, actually had some spaces between the '' marks

这篇关于获得空白黑色的AdMob广告科尔多瓦用Admob的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆