sunnycupertino / cordova-plugin-admob-simple

Cordova plugin allowing Admob interstitials and banner ads.
MIT License
164 stars 150 forks source link

window.plugins.admob always undefined #17

Closed s4u2017 closed 7 years ago

s4u2017 commented 7 years ago

window.plugins.AdMob always return undefined

function initAd(){ if ( window.plugins && window.plugins.AdMob ) {

Please Help

sunnycupertino commented 7 years ago

This usually happens if you call initAd() before cordova is ready.

Call initAd() from onDeviceReady()....

s4u2017 commented 7 years ago

I call it inside the function onDeviceReady() but still retun undefined Please help

sunnycupertino commented 7 years ago

Is it window.plugins or window.plugins.AdMob that is undefined? If it is the first one, then Cordova is not initialized properly, if the second, then try uninstalling the plugin and reinstalling.

s4u2017 commented 7 years ago

both of them , i'm working on it from 4 days ago without solution ,

i installed the app many times , and the error not solved

sunnycupertino commented 7 years ago

Did you try recreating the whole project? Can you get the basic project to work without any changes or plugins first?

s4u2017 commented 7 years ago

yes i created a empty project using phonegap desktop app , and i installed the app via nodejs commande nmp but not working ,

i worked with other admob plugins and always return me undefined.

can you send me a simple project working with cordova-plugin-admob-simple please?

sunnycupertino commented 7 years ago

Sure, give me a few hours, I will do it later today.

s4u2017 commented 7 years ago

Thanks a lot bro 👍 this is my email : s4u.opensource@gmail.com

sunnycupertino commented 7 years ago

Is this for Android or IOS?

s4u2017 commented 7 years ago

For Android please

sunnycupertino commented 7 years ago

Ok I sent it to your email, remember to put in your own admob id's in the \platforms\android\assets\www\js\index.js file.

If anyone else wants a copy you can get it from here https://drive.google.com/open?id=0B_etFuFoOzoNVmxpeXZzbWx3d3M

s4u2017 commented 7 years ago

Thanks bro ;)

sunnycupertino commented 7 years ago

Welcome.

s4u2017 commented 7 years ago

hello bro,

the same problem , not working and always return undefined :(

sunnycupertino commented 7 years ago

Did you put in your admob id? I ran that code myself and it worked. All i did was comment out the id before sending it to you.

s4u2017 commented 7 years ago

i copied your code in www/index.html and it's not working

s4u2017 commented 7 years ago

i copied the code from hallo2\plugins\cordova-plugin-admob-simple\test\index.html and i past it on www/index.html and not working

i run the same project you sent me

sunnycupertino commented 7 years ago

Of course not.

s4u2017 commented 7 years ago

so what i should do ?

s4u2017 commented 7 years ago

what i should do ?

2017-03-30 21:19 GMT+01:00 Sunny Cupertino notifications@github.com:

Closed #17 https://github.com/sunnycupertino/cordova-plugin-admob-simple/issues/17.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sunnycupertino/cordova-plugin-admob-simple/issues/17#event-1023021399, or mute the thread https://github.com/notifications/unsubscribe-auth/AZcJY_5gp0rrZRoiJHG4PFxn-HGcHkKdks5rrA5hgaJpZM4MsKsx .

rlam3 commented 6 years ago

@s4u2017 any resolution? I'm facing a similar issue.