I'm the author of the plugin you are trying to use. It seems you are using the command line interface which it doesn't have any automatization on <gap:plugin ...> yet (and I'm not sure that it's comming in the near future).
As Sanfor says, if you are using Phonegap CLI, you should add every plugin manually:
phonegap local plugin add cordova-admob
Or if you are using Cordova:
cordova plugin add cordova-admob
If you are using Phonegap Build, you should put the tag in config.xml
:
<gap:plugin name="cordova-admob" source="npm" />
In that case, you can also follow the instructions at https://github.com/appfeel/admob-phonegap-build-demo.git to test the demo app in your Phonegap Build account.
Remember to always use admob after deviceready
event has been fired:
function onAdLoaded(e) {
if (e.adType === admob.AD_TYPE.INTERSTITIAL) {
admob.showInterstitialAd();
}
}
function onDeviceReady() {
document.removeEventListener('deviceready', onDeviceReady, false);
// Set AdMobAds options:
admob.setOptions({
publisherId: "YOUR_PUBLISHER_ID", // Required
interstitialAdId: "YOUR_PUBLISHER_OR_INTERSTITIAL_ID", // Optional
});
// Start showing banners inmediately:
admob.createBannerView();
// To show an interstitial, call admob.showInterstitialAd() when onAdLoaded is fired:
document.addEventListener(admob.events.onAdLoaded, onAdLoaded, false);
admob.requestInterstitial();
// You could also request and show an interstitial like this:
// admob.requestInterstitialAd({ autoShowInterstitial: true});
}
document.addEventListener('deviceready', onDeviceReady, false);
It's interesting to know if you are testing with CLI to later use PGB. However, I'm not sure if it helps a mock-up of the admob functionality. Let me know if it's your case. The only situation that comes to my mind is that you would like to test the app in a desktop browser, where plugins aren't supported. But even in that case I would suggest you to use ripple incubator from github (or even weinre, but if you are in a mac it's better to use safari developer tools).
EDIT 2016-04-22
Updated old plugin references to newest ones and npm source for phonegap build.
config.xml
only works for PGBuild. – Persia