AdMob

The most popular AdMob plugin for Cordova/PhoneGap, Intel XDK compatible. Support latest Google Play Services for Android, iOS and Windows Phone SDK.
Liming Xie2.1.7164
platforms: android,ios,wp8,windows
$ cordova plugin add com.rjfun.cordova.plugin.admob

cordova-plugin-admob

AdMob Cordova Plugin, provides a way to request AdMob ads natively from JavaScript.

Platform SDK supported

  • Android, using Google Play Service for Android, r19
  • iOS, using AdMob SDK for iOS, v6.12.2
  • Windows Phone, using AdMob SDK for Windows Phone 8, v6.5.13

How to use?

To install this plugin, follow the Command-line Interface Guide.

cordova plugin add com.rjfun.cordova.plugin.admob

Note: ensure you have a proper AdMob account and create an Id for your app.

Javascript API

APIs:

setOptions(options, success, fail);

createBannerView(options, success, fail);
requestAd(options, success, fail);  // optional, will be absolete
showAd(true/false, success, fail); 
destroyBannerView();

createInterstitialView(options, success, fail);
requestInterstitialAd(options, success, fail); // optional, will be absolete
showInterstitialAd();

Example code

Check the test/index.html.

See the working example code in demo under test folder, and here are some screenshots.

Screenshots (banner Ad / interstitial Ad)

iPhone:

ScreenShot

Credits

This plugin is mainly maintained by Raymond Xie, and also thanks to following contributors:

  • @jumin-zhu, added interstitial support for Android.
  • @fersingb, added interstitial support for iOS.
  • @AlexB71, improved WP8 support.
  • @ihshim523, added initial WP8 support.
  • And, bugfix patches from @chrisschaub, @jmelvin, @mbektchiev, @grahamkennery, @bastaware, @EddyVerbruggen, @codebykevin, @codebykevin, @zahhak.

You can use this plugin for FREE. To support the project, donation is welcome.

Forking and improving is welcome. Please ADD VALUE, instead of changing the name only.

AdMob PluginPro

Totally re-designed AdMob PluginPro is more recommended.

Highlights:

  • Easy-to-use: Display Ad with single line of javascript code.
  • Powerful: Support banner, interstitial, and video Ad.
  • Max revenue: Support mediation with up to 8 leading mobile Ad services.
  • Multi-size: Multiple banner size, also support custom size.
  • Flexible: Fixed and overlapped mode, put banner at any position with overlap mode.
  • Smart: Auto fit on orientation change.
  • Same API: Exactly same API with other Ad plugins, easy to switch from one Ad service to another.
  • Up to date: Latest SDK and Android Google play services.
  • Good support: Actively maintained, prompt response.

Platforms supported:

  • Android
  • iOS
  • Windows Phone

Tested with:

  • Apache Cordova CLI, v3.0+
  • Intel XDK, r1095+
  • IBM Worklight, v6.2+
  • Google Mobile Chrome App, v0.5.0+
  • Adobe PhoneGap Build, since 2014.12.9

Mediation with:

  • AdMob
  • DFP (DoubleClick for Publisher)
  • Facebook Audience Network
  • Flurry
  • iAd
  • InMobi
  • Millennial Media
  • MobFox

News:

  • Recommended by Telerik in Verified Plugins Marketplace. read more ...
  • Recommended by William SerGio in code project (20 Jun 2014), read more ...
  • Recommended by Arne in Scirra Game Dev Forum (07 Aug, 2014), read more ...
  • Recommended by Intel XDK team (08/22/2014), read more ...

See Also

Ad PluginPro series for the world leading Mobile Ad services:

All Ad plugins implemented with exactly same API, so very easy to switch from one Ad service to another.

More Cordova/PhoneGap plugins by Raymond Xie, find them in plugin registry.

Customization, project outsourcing and consulting service is also available. Please contact us if you have the business needs.