ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
495 stars 211 forks source link

Getting error "Can't find variable: admob" #181

Closed SharkyPT closed 6 years ago

SharkyPT commented 6 years ago

Hi,

i'm testing this plugin in my app using PhoneGap. When I use iOS i get the error "Can't find variable: admob". on initialization. If I test using the browser (i know it does not wotk on browser), I do not get this error and the init works ok.

On init i have something like:

`

    admob.interstitial.config(
    {
        id: admobid.interstitial,
        isTesting: true,
        autoShow: false,
    });
    admob.interstitial.prepare();
} `

And I have this error in iOS. I 've already removed the plugin and add it again and also removed the platform and add it again.

Does anyone has a clue?

Thanks

rlam3 commented 6 years ago

@SharkyPT Any luck? I'm having a similar issue. Thanks.

SharkyPT commented 6 years ago

No luck.

I will continue developing the App and will let the Ads to the end of the development. Not sure if the plugin does not work inside Phonegap desktop and Phonegap App and if it works only after a proper build using Phonegap Build or the native android and iOS buils.

rlam3 commented 6 years ago

Do you mind sharing how you are importing admob? I'm getting the following error with my vue-js app When I try to call upon the admob plugin.

Thanks!

ReferenceError: admob is not defined
rlam3 commented 6 years ago

@SharkyPT Any luck yet? Been trying out other frameworks such as quasar. But to no avail.

SharkyPT commented 6 years ago

Hi rlam3.

Apparentely the plugin does not work while emulating with Phonegap App. If you build it, either in native mode or using PhoneGap build it works.

tennist commented 6 years ago

It would not work in the emulator because it is dependent upon google play services and the android sdk. Therefore you need to get it into either an android simulator or an actual device. Please close this issue if the problem is resolved.

kshvsharma960 commented 4 years ago

I am facing the same issue of admob is not defined error statement. I am using actual device. Please provide admob import detail on android. Thanks