我正在尝试将 AdMob 广告放入我的 ionic android 应用程序中,并测试我制作的名为 AdMobTest 的 ionic 应用程序的功能。我使用的插件是cordova-admob-pro插件。这是我的 AdMob 代码:
var admobid = {};
if (/(android)/i.test(navigator.userAgent)) { //Android
admobid = {
banner : 'ca-app-pub-2586564966169402/9782816366',
interstitial : 'ca-app-pub-2586564966169402/8345912938',
gotHereMsg1 : 'banner and interstitial have the android IDs'
};
} else if (/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { //iOS
admobid = {
banner : 'Stand in iOS banner ID',
interstitial: 'stand in iOS interstitial ID',
gotHereMsg1 : 'banner and interstitial have the iOS IDs'
};
} else { //Neither
admobid = { …Run Code Online (Sandbox Code Playgroud)