问题
I'm experimenting with the Admob plugin for Phonegap but it is complex. I have this code but it doesn't show the advertise and I really don't know why.. Can you guys see something wrong in the code? Yes I imported the plugin.
http://pastebin.com/zbEs6D7H
回答1:
If you are using this plugin: https://github.com/appfeel/admob-google-cordova (cordova plugin add com.admob.google
) you should wrap your code with deviceready event:
function configAds() {
var enabledAdMob = true; // easily enable/disable AdMob
...
}
document.addEventListener("deviceready", configAds, false);
See complete phonegap example here: https://github.com/appfeel/admob-google-demo
来源:https://stackoverflow.com/questions/30469049/admob-integration-for-phonegap-doesnt-show-the-advertise