Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@theunreal/cordova-plugin-admobx

theunreal2MIT0.28.0

Cordova AdMob Plugin for Google AdMob

cordova, admob, ecosystem:cordova, cordova-plugin-admob, cordova-admob, cordova-android, cordova-ios, plugin, google, admobpro

readme

Cordova AdMob Plugin

A free, no ad-sharing version of Google AdMob plugin for Cordova.

Status

I have been asking the interest about funding this project a while, got some encouraging feedback, finally have setup a funding page.

Please use admob-plus if possible.

While my focus is admob-plus, I will keep maintaining cordova-plugin-admob-free until all exisiting features are available with the new plugin.

If you are earning more than USD$200 monthly from using this plugin, please consider funding my work.

Features

  • No Ad-Sharing

    Unlike some other plugins, this plugin does not share your advertising revenue by randomly display developer's owned ads.

  • Fully Open Sourced

    Except Google provided AdMob SDKs, every line of code are on Github. You don't execute compiled binary without seeing the source code.

  • No Remote Control

    Do not send your application information to a remote server to control whether ad could be displayed. Therefore, you don't lose revenue because some server bugs,

    NOTE(2018-03-17): The above issue links are broken due to the author removed the discussions, the fact is the cordova-plugin-admobpro is sending requests to http://adlic.rjfun.com/adlic with application information for controling ad display, and some users reported losting more revenue than advertised, so use it at your own risk.

Compare to other projects

Project No Ad-Sharing Fully Open Sourced No Remote Control
admob Not Sure Not Sure
cordova-admob
cordova-plugin-ad-admob
cordova-plugin-admob-free
cordova-plugin-admob-simple
cordova-plugin-admobpro

Click ❌ to see the detail.

NOTE(2018-03-17): cordova-plugin-admobpro is using cordova-plugin-extension for its compiled code, the author removed the repository casusing the above broken links. For those interested could download the npm tarball for investigation.

Installation

cordova plugin add cordova-plugin-admob-free --save

Since the version 17 of play-services-ads and the 0.21.0 version of the plugin the ADMOB_APP_ID must be added to the AndroidManifest.xml. To install the plugin without errors and to insert the ADMOB_APP_ID to the manifest file automatically use the following code:

cordova plugin add cordova-plugin-admob-free --save --variable ADMOB_APP_ID="<YOUR_ANDROID_ADMOB_APP_ID_AS_FOUND_IN_ADMOB>"

Since version 7.42 of the Google AdMob Mobile Ads SDK for iOS, you must add the ADMOB_APP_ID to your Info.plist, which you can do by adding the folowing inside the <platform name="ios"> section in your config.xml file:

<config-file target="*-Info.plist" parent="GADApplicationIdentifier">
    <string>YOUR_IOS_ADMOB_APP_ID_AS_FOUND_IN_ADMOB</string>
</config-file>

Note that cordova plugin add [GIT_URL] is not supported.

Usage

1. Create Ad Unit ID for your banner and interstitial.

Go to the AdMob portal and add your app (if you haven't done so already), once your app is added to your AdMob account, create a new ad unit for it.

2. Display advertisements

Interstitial Ad

Reward Video Ad

3. Profit

If you find this plugin useful, please star it on Github.

Screenshots

Android Banner Android Interstitial
ScreenShot ScreenShot
iOS Banner iOS Interstitial
ScreenShot ScreenShot

API

See documentation page.

Customize Google Play Services versions (Android only)

The default PLAY_SERVICES_VERSION is set to 11.0.4. If you need a different version, edit config.xml with following,

<plugin name="cordova-admob-sdk" spec="~0.13.1">
    <variable name="PLAY_SERVICES_VERSION" value="11.6.0" />
</plugin>

Note that if you are adding these lines to an existing project, you need to remove both admob-free plugin and android platform and add them back again to affect the version number.

Contributing

You can use this Cordova plugin for free. You can contribute to this project in many ways:

Help with documentation is always appreciated and can be done via pull requests.

Read Contributing Guide to learn how to contribute.

Ionic Support

While the Ionic community have provided an Ionic Native Plugin, plugin users need more examples and tutorials.

As I (@ratson) don't use Ionic myself, it would be great if some experienced Ionic developers could help answering questions or come up with more examples. HELP WANTED HERE.

Credits

Thanks for the cordova-plugin-admob-simple author for forking the original project cordova-plugin-admob to make it functional and open source it.

Screenshots are copied from cordova-admob-pro.

Disclaimer

This is NOT an official Google product. It is just a community-driven project, which use the Google AdMob SDKs.

License

MIT

changelog

Releases

Next

0.26.0 (2019-03-30)

  • Update cordova-admob-sdk to v0.24.1.

0.25.0 (2018-12-20)

  • Update cordova-admob-sdk to v0.22.0.

0.24.0 (2018-12-07)

  • Fix iOS banner position.

0.23.0 (2018-11-20)

  • Update cordova-admob-sdk to v0.21.0.

0.22.0 (2018-10-27)

  • Display test ads in Test Lab.
  • Update cordova-admob-sdk to v0.20.2.

0.21.0 (2018-10-10)

0.20.0 (2018-10-06)

  • Update cordova-admob-sdk to v0.20.0.

0.19.0 (2018-09-27)

  • Emit COMPLETE event for Rewarded Video ad. (@Montoya in #281)
  • Update cordova-admob-sdk to v0.19.0.
  • Build with babel v7.

0.18.0 (2018-08-20)

  • Update cordova-admob-sdk to v0.18.0.

0.17.4 (2018-07-30)

0.17.3 (2018-07-14)

  • Fix banner locations on the iPhone X for top banners. (@tennist in #262)

0.17.2 (2018-06-25)

0.17.1 (2018-06-16)

0.17.0 (2018-05-22)

0.16.1 (2018-05-13)

  • Fix for iPhone X status bar improperly refreshed (@rafaellop in #218)

0.16.0 (2018-04-27)

  • Update cordova-admob-sdk to v0.16.0.
  • Fix not showing production ads on iOS (@MBuchalik in #208)
  • Fix crashes on Android (@tominou in #201)

0.15.0 (2018-03-25)

  • Update cordova-admob-sdk to v0.15.1.
  • Implement onRewardedVideoCompleted() callback for Android.
  • Add space for non-overlapping bottom banners on iPhone X (@MBuchalik in #186)
  • Add filenames to src attr to copy source-files. (@srikanth-wgl in #189)

0.14.0 (2018-02-09)

Breaking

  • Update cordova-admob-sdk to v0.15.0.

0.13.0 (2017-12-10)

Breaking

  • Update cordova-admob-sdk to v0.13.1. Now cordova-android >=6.3.0 is required.

0.12.1 (2017-11-25)

Fixed

0.12.0 (2017-11-19)

Breaking

  • Update Google AdMob SDK for iOS to v7.26.0.

Fixed

  • Fix banner size bug.

0.11.0 (2017-09-23)

Breaking

  • Update Google AdMob SDK for iOS to v7.24.0.
  • Update cordova-promise-polyfill to v0.0.2.

0.10.0 (2017-07-31)

Breaking

  • Update Google AdMob SDK for iOS to v7.21.0.

Fixed

0.9.0 (2017-05-07)

Breaking

  • Update Google AdMob SDK for iOS to v7.20.0.

0.8.0 (2017-03-22)

Breaking

  • Update Google AdMob SDK for iOS to v7.19.0.

0.7.0 (2017-02-21)

Added

  • Add availability methods for interstitials and reward videos. (@vintage in #54)

Breaking

  • Update Google AdMob SDK for iOS to v7.17.0.

0.6.1 (2017-01-25)

Added

  • Document events.

Fixed

  • Fix iOS InterstitialAd does not call failure callback. (@becvert in #47)

0.6.0 (2017-01-16)

Introduce whole new set of API, which focus on consistency and conciseness. All old API should just work as before, but emit warnings, it is strongly recommended to migrate to new API and give feedback.

New API

  • window.admob is introduced to replace window.AdMob and window.plugins.AdMob. Developer should no longer need to worry about missed upper-case causing Admob is not defined error.

  • admob.banner.prepare() is replacing createBannerView().

  • admob.banner.show() and admob.banner.hide() are replacing showAd().

  • admob.banner.remove() is replacing destroyBannerView().

  • admob.interstitial.prepare() is replacing prepareInterstitial()

  • admob.interstitial.show() is replacing showInterstitialAd()

Breaking

  • Update Google AdMob SDK for iOS to v7.16.0.

Internal

  • prepareInterstitial is now implemented natively, which should fix some race condition bugs.

Added

0.5.1 (2016-12-08)

Fixed

  • Add more Babel transforms for more compatible code.

0.5.0 (2016-12-08)

Breaking

  • Drop support for WP8.
  • Update Google AdMob SDK for iOS to v7.15.0.

Added

Fixed

  • Babel generated more compatible code.
  • Separate autoShow for banner and interstitial. (@oangelo in #27)

0.4.1 (2016-11-22)

Fixed

0.4.0 (2016-11-07)

Breaking

  • Drop support for Cordova < 4.
  • Update Google AdMob SDK for iOS to v7.14.0.

Added

  • Add FLUID ad size support.

0.3.1 (2016-10-26)

Fixed

0.3.0 (2016-10-23)

Added

  • Add LARGE_BANNER support.

Fixed

  • Fix displaying test ads on iOS devices. (@vintage in #17)