How to access cordova AdMobPro plugin?

  • Hello!
    I tried cordova.AdMob and cordova.plugins.AdMob but I still continue to get error “TypeError: Cannot read property ‘AdMob’ of undefined” .

    How to fix that?

  • Hi admob-pro plugin work for me:
    try just AdMob and not cordova.AdMob or cordova.plugins.AdMob

    var admobid = {
    banner: _self.$root.config.admobid//your admob id
    if (AdMob) AdMob.createBanner({
    adId: admobid.banner,
    autoShow: true,
    success: function () {
    error: function () {
    console.log(‘failed to create banner’);

  • Hello mate! Thank You so much for your help!

    I tried your code but while building I got these errors: Expected { after ‘if’ condition
    if (AdMob) AdMob.createBanner({
    ^ ‘AdMob’ is not defined
    if (AdMob) AdMob.createBanner({
    ^ ‘AdMob’ is not defined
    if (AdMob) AdMob.createBanner({
    ^ ‘admobid’ is not defined
    adId: admobid.banner,
    ^ ‘AdMob’ is not defined

  • I have a completelly different problem now.

    Withouth any AdMob decleration, it says AdMob is not defined in vendor.jpg

    What can I do?

  • Ok. Isolved admob decleration problem by “cordova platform remove android” and than add again.

    However, there is still problem on using it in vue.

  • Ok solved.

    here is the code I am using.

    by the way, I needed to rebuild quasar and delete and recreate cordova android project

    mounted () {
    adId: ‘ca-app-pub-3940256099942544/6300978111’,
    position: window.AdMob.AD_POSITION.BOTTOM_CENTER,
    autoShow: true })

  • @mustotto Do you mind sharing your code base? I’m having some difficulty in integrating admob as well. Thanks!

Log in to reply

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.