Reputation: 145
I'm working on ionic project. I have integrate Admob by using this plugin cordova-plugin-admobpro, it work perfectly this is the code that i use :
//======admob code start=============
var admobid = {};
// select the right Ad Id according to platform
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: 'ca-app-pub-84538xxxxxxxxxxxxxxxxxx',
interstitial: 'ca-app-pub-845xxxxxxxxxxxxxxxxx'
};
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
admobid = { // for iOS
banner: 'ca-app-pub-845xxxxxxxxxxxxxxxx',
interstitial: 'ca-app-pub-84xxxxxxxxxxxxxxxxxx'
};
} else {
admobid = { // for Windows Phone
banner: 'ca-app-pub-xxxxxxxxxxxxxxxxxx',
interstitial: 'ca-app-pub-xxxxxxxxxxxxx'
};
}
if(window.AdMob) AdMob.createBanner( {
adId:admobid.banner,
position:AdMob.AD_POSITION.BOTTOM_CENTER,
autoShow:true} );
//=======AdMob Code End=======
Now what i neeed is to add more add inside the view in my content ( ADMOB NATIVE i think ) any idea? Can I use ADsense Ads ?
Upvotes: 0
Views: 3096
Reputation: 91
In ionic with google admob we can't create 'Native ads'
we can use 'Facebook audience network' ads for integrating the native ads in ionic.
we have a clear cordova plugin to integrate facebook ads which make my work simpler.
you can refer this cordova plugin : https://github.com/floatinghotpot/cordova-plugin-facebookads
Upvotes: 1