Please, I've been struggling with integrating admob into my apps..
Everytime I try to integrate admob into my app . I don't see any banners.But I notice in admob it says "Link App" I tried using the floatinghotpot/cordova-admob-pro in my app it doesn't work. I don't see any ad banners still . I usually embed the codes within a comment and after the close body tag.
My questions are:
1.If I want to use floatinghotpot's plugin , I download them as described from their source and embed the sample code in the position their example cited (below </body> tag) must I also tick the admob plugin from intel xdk?
2.I use floatinghotpot because they have option for admob for Windows Phone 8, Should I leave this external plugin and live with the one provided in intel xdk that supplies only for Android and IOS .
Thanks for your time.Please see my code below (Or should I put the <script>codes between my header tags ?). Am veery confused
</body> <!--Start As for Admob Test--> <script> var admobid = {}; if( /(android)/i.test(navigator.userAgent) ) { admobid = { // for Android banner: ' ca-app-pub-9089133254696423/9109051197', interstitial: 'ca-app-pub-9089133254696423/4105271992' }; } else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { admobid = { // for iOS banner: 'ca-app-pub-6869992474017983/4806197152', interstitial: 'ca-app-pub-6869992474017983/7563979554' }; } else { admobid = { // for Windows Phone banner: ' ca-app-pub-9089133254696423/5582005196', interstitial: 'ca-app-pub-9089133254696423/7992244796' }; } function initApp() { if (AdMob) { AdMob.createBanner({ adId : admobid.banner, position : AdMob.AD_POSITION.BOTTOM_CENTER, autoShow : true }); } } document.addEventListener('deviceready', initApp, false); </script> <!--End As for Admob Test--> </html>
</body>
<!--Start As for Admob Test-->
<script>
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: ' ca-app-pub-9089133254696423/9109051197',
interstitial: 'ca-app-pub-9089133254696423/4105271992'
<!---->
} else {
admobid = { // for Windows Phone
banner: ' ca-app-pub-9089133254696423/5582005196',
interstitial: 'ca-app-pub-9089133254696423/7992244796'
};
}
function initApp() {
if (AdMob) {
AdMob.createBanner({
adId : admobid.banner,
position : AdMob.AD_POSITION.BOTTOM_CENTER,
autoShow : true
});
}
}
document.addEventListener('deviceready', initApp, false);
</script>
<!--End As for Admob Test-->
</html>
I use admob pro as well ( com.google.cordova.admob ) and use the exact code as above after the </body> tag .
it should work fine , when you test the apk file ( on device) before you upload it you should see ads immediately but for the results to show in your admob account, it takes few hours .
For more complete information about compiler optimizations, see our Optimization Notice.