How to add Google Admob ads to my app?


How to add Google Admob ads to my app?


here is what i’ve done n work. it works only in built app, not in scanner. you need to add this cordova plugin in ur build settings. you also need to register admob to get app-pub id from google.


and then add this code to ur index.js

document.addEventListener(‘deviceready’, function () {
‘publisherId’: ‘ca-app-pub-9604015245563184/6464053554’,
}, function () { // success
‘isTesting’: false,
‘extras’: {
‘colorbg’: ‘e54747’,
‘colorborder’: ‘666666’,
‘colorlink’: ‘ffffff’,
‘colortext’: ‘ffffff’,","
‘color_url’: ‘ffcc33’
}, false);


Thank you a lot.


I added the repository to the build setting and added your code, but it still not showing the ads in my built app…


normally it take several seconds to load ads. did you wait long enough?


Yes I waited 10 minutes and more, but nothing happened. Maybe the problem comes because I installed the app from my Phone storage, not from the Google Play ?


it doesn’t matter where u installed from, as long as it is built apk. how did u add these code to ur index.js? wanna share?


Hey, i tried the plugin today. The successcallback for requestad works. But i am not seeing anything on the page. What could be wrong?

How do i know if my ad unit is serving ads?


Does this still work?

  1. I registered our app at Admob and was assigned an Ad unit ID.

  2. I added the source in the build settings:

  3. I added your code to the apps’s JavaScript with our ca-app-pub number.

  4. I built the app on the Appgyver build service, downloaded and installed the apk on my test device. The app is broken.

  5. If I try to open index.html in Chrome it shows Uncaught syntax error: Unexpected token ILLEGAL for the publisherId in createBannerView,

Any thoughts?