Forked from https://github.com/ratson/cordova-plugin-admob-free - Rona Dini Hari (rona.dinihari@gmail.com)
Cordova AdMob Plugin
A free, no ad-sharing version of Google AdMob plugin for Cordova.
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,
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.
Installation
cordova plugin add cordova-plugin-admob-free --save
Usage
1. Ceate Ad Unit ID for your banner and interstitial.
Go to AdMob portal, click "Monetize a new app" button to create new ad unit.
2. Define configiration for differrent platforms.
var admobid = {};if //i // for android & amazon-fireos admobid = banner: 'ca-app-pub-xxx/xxx' interstitial: 'ca-app-pub-xxx/xxx' ; else if //i // for ios admobid = banner: 'ca-app-pub-xxx/xxx' interstitial: 'ca-app-pub-xxx/xxx' ; else // for windows phone admobid = banner: 'ca-app-pub-xxx/xxx' interstitial: 'ca-app-pub-xxx/xxx' ;
3. Set options
AdMob;
4. Display advertisements
Banner Ad
// Create bannerAdMob; // Close the bannerAdMob; // Hide the bannerAdMob; // Show the bannerAdMob;
Interstitial Ad
// prepare and load ad resource in background, e.g. at the beginning of game levelAdMob; // show the interstitial later, e.g. at end of game levelAdMob;
5. Profit
Screenshots
Android Banner | Android Interstitial |
---|---|
iPhone Banner | iPhone Interstitial |
---|---|
API
Methods:
// set default value for other methodsAdMob; // use bannerAdMob;AdMob;AdMob; // use interstitialAdMob;AdMob;// low-level methodsAdMob;AdMob;AdMob;
Events:
document;document;document;document;document;document;document;document;
Status
This plugin is forked from cordova-plugin-admob-simple and removed the ad-sharing related code. All APIs are remaining the same as the original fork.
For Android, there are also some enhanced options. If anyone wants them on iOS, please open an issue and let me know.
If you find this plugin useful, please star it on Github.
Contributing
You can use this Cordova plugin for free. You can contribute to this project in many ways:
- Reporting issues.
- Patching and bug fixing, especially when submitted with test code. Open a pull request.
- Other enhancements.
Help with documentation is always appreciated and can be done via pull requests.
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.