No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to access cordova AdMobPro plugin?

    Framework
    3
    7
    2724
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mustotto last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • nestebe
        nestebe last edited by

        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,
        position: AdMob.AD_POSITION.BOTTOM_CENTER,
        autoShow: true,
        success: function () {
        console.log(‘fsuccessr’);
        },
        error: function () {
        console.log(‘failed to create banner’);
        }
        });

        M 1 Reply Last reply Reply Quote 0
        • M
          mustotto @nestebe last edited by mustotto

          Hello mate! Thank You so much for your help!

          I tried your code but while building I got these errors:

          ✘ http://eslint.org/docs/rules/curly Expected { after ‘if’ condition
          C:\Users\mustafa\Desktop\deneme\qua\src\components\Index.vue:44:5
          if (AdMob) AdMob.createBanner({
          ^

          ✘ http://eslint.org/docs/rules/no-undef ‘AdMob’ is not defined
          C:\Users\mustafa\Desktop\deneme\qua\src\components\Index.vue:44:9
          if (AdMob) AdMob.createBanner({
          ^

          ✘ http://eslint.org/docs/rules/no-undef ‘AdMob’ is not defined
          C:\Users\mustafa\Desktop\deneme\qua\src\components\Index.vue:44:16
          if (AdMob) AdMob.createBanner({
          ^

          ✘ http://eslint.org/docs/rules/no-undef ‘admobid’ is not defined
          C:\Users\mustafa\Desktop\deneme\qua\src\components\Index.vue:45:13
          adId: admobid.banner,
          ^

          ✘ http://eslint.org/docs/rules/no-undef ‘AdMob’ is not defined
          C:\Users\mustafa\Desktop\deneme\qua\src\components\Index.vue:46:17
          position: AdMob.AD_POSITION.BOTTOM_CENTER,
          ^

          1 Reply Last reply Reply Quote 0
          • M
            mustotto last edited by

            I have a completelly different problem now.

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

            What can I do?

            1 Reply Last reply Reply Quote 0
            • M
              mustotto last edited by

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

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

              1 Reply Last reply Reply Quote 0
              • M
                mustotto last edited by

                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 () {
                window.AdMob.createBanner({
                adId: ‘ca-app-pub-3940256099942544/6300978111’,
                position: window.AdMob.AD_POSITION.BOTTOM_CENTER,
                autoShow: true })
                },

                1 Reply Last reply Reply Quote 0
                • A
                  aznric3boi91 last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post