I followed the instructions of this post: AdMob not loading ads in ionic/angular app
When I run the app via \"ionic build ios && ionic emulate ios\" I get no ads
Follow these steps:
ionic platform add android
ionic platform add ios
cordova plugin add com.rjfun.cordova.plugin.admob
code:
$ionicPlatform.ready(function() {
if(window.plugins && window.plugins.AdMob) {
var admob_key = device.platform == "Android" ? "ANDROID_PUBLISHER_KEY" : "IOS_PUBLISHER_KEY";
var admob = window.plugins.AdMob;
admob.createBannerView( {
'publisherId': admob_key,
'adSize': admob.AD_SIZE.BANNER,
'bannerAtTop': false
},
function() {
admob.requestAd({ 'isTesting': false },
function() {
admob.showAd(true);
},
function() { console.log('failed to request ad'); });
},
function() { console.log('failed to create banner view'); });
}
});
Regards.