{"id":13547954,"url":"https://github.com/floatinghotpot/cordova-admob-pro","last_synced_at":"2025-05-15T14:08:30.930Z","repository":{"id":19521141,"uuid":"22768263","full_name":"floatinghotpot/cordova-admob-pro","owner":"floatinghotpot","description":":fire: Cordova Plugin for Google AdMob, DFP, ADX. Easy monetization using mobile Ad, with single line of JavaScript. Compatible with Cordova CLI, Inoic, PhoneGap Build, etc.","archived":false,"fork":false,"pushed_at":"2023-07-19T18:39:06.000Z","size":288335,"stargazers_count":723,"open_issues_count":62,"forks_count":336,"subscribers_count":89,"default_branch":"master","last_synced_at":"2025-05-11T05:02:07.385Z","etag":null,"topics":["admob","admob-plugin","cordova","cordova-plugin","doubleclick","google-admob","ionic","monetization","phonegap"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/floatinghotpot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-08-08T18:55:06.000Z","updated_at":"2025-05-03T12:07:53.000Z","dependencies_parsed_at":"2022-07-14T04:50:30.416Z","dependency_job_id":"f68c4ddb-351e-4f88-b18a-dba985983ff8","html_url":"https://github.com/floatinghotpot/cordova-admob-pro","commit_stats":{"total_commits":251,"total_committers":11,"mean_commits":"22.818181818181817","dds":"0.28685258964143423","last_synced_commit":"cd984c9cb5295da929e211fd902f45b333f4cfe5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcordova-admob-pro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcordova-admob-pro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcordova-admob-pro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floatinghotpot%2Fcordova-admob-pro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floatinghotpot","download_url":"https://codeload.github.com/floatinghotpot/cordova-admob-pro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253774581,"owners_count":21962199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admob","admob-plugin","cordova","cordova-plugin","doubleclick","google-admob","ionic","monetization","phonegap"],"created_at":"2024-08-01T12:01:03.670Z","updated_at":"2025-05-15T14:08:25.918Z","avatar_url":"https://github.com/floatinghotpot.png","language":"Java","funding_links":[],"categories":["Java","Cordova plugins"],"sub_categories":["Incompatible"],"readme":"## AdMob Plugin Pro \n\nCordova / PhoneGap Plugin for Google Ads, including AdMob / DFP (doubleclick for publisher) and mediations to other Ad networks.\n\n## Contents\n\n1. [Description](#description)\n2. [History](#history)\n3. [Features](#features)\n4. [Demo](#quick-demo)\n5. [Quick Start](#quick-start)\n6. [Installation](#installation)\n7. [Usage](#usage)\n8. [API](#api)\n9. [Wiki and Docs](#wiki-and-docs)\n10. [Important Tips \u0026 Warning](#tips)\n11. [Video Tutorial](#video-tutorial)\n12. [Screenshots](#screenshots)\n13. [License](#license)\n14. [Credits](#credits)\n\n## Description\n\nThis Cordova / PhoneGap plugin enables displaying mobile Ads with single line of javascript code. Designed for the use in HTML5-based cross-platform hybrid games and other applications.\n\n## History\n\nCommunity-driven project. Designed and maintained by [Raymond Xie](http://github.com/floatinghotpot/) since August 2014. It also features integration in AngularJS projects via [ngCordova] (http://www.ngcordova.com).\n\nIt was published to Cordova registry with id \"com.google.cordova.admob\" since Aug 2014, and  has been downloaded more than 120,000 times. Now it's the No. 1 monetization plugin for Cordova community.\n\n![ScreenShot](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/trend.png)\n\nFrom May 2015, Cordova team announced the deprecation of Cordova registry, and suggest all plugins to be moved to npm repository. Now, the AdMob plugin is published to npm and renamed as \"cordova-plugin-admobpro\".\n\n## Features\n\nPlatforms supported:\n- [x] iOS, via SDK v8.13.0 (see [Release Notes](https://developers.google.com/admob/ios/rel-notes))\n- [x] Android, via Android SDK (part of Google Play service, see [Release Notes](https://developers.google.com/admob/android/rel-notes))\n\nAd Types:\n- [x] Banner\n- [x] Interstitial (text, picture, video), highly recommended. :fire:\n- [x] Reward Video, highly recommended. :fire:\n- [ ] Reward Interstitial (on roadmap)\n- [ ] Native Ads (not applicable to Cordova web apps)\n- [ ] Native Ads Advanced (not applicable to Cordova web apps)\n\nMediation to other Ad networks:\n* [x] AdMob (built-in)\n* [x] DFP (DoubleClick for Publisher, built-in)\n* [x] Meta Audience Network\n* [x] Flurry\n* [x] InMobi\n* [x] Millennial Media\n* [x] MobFox\n\n## Quick Demo\n\nWanna quickly see the mobile ad on your simulator or device? Try the following commands.\n\n```bash\n    # install cordova CLI\n    [sudo] npm install cordova -g\n\n    # install a small utility to run all the commands for you\n    [sudo] npm install plugin-verify -g\n\n    # Demo 1: run admob demo with sample index.html\n    plugin-verify cordova-plugin-admobpro\n\n    # Demo 2/3: run admob demo in game powered by PIXI/phaser HTML5 engine\n    plugin-verify admob-demo-game-pixi ios --landscape\n    plugin-verify admob-demo-game-phaser ios --landscape\n\n    # Demo 4: run admob demo in app powered by ionic/angular framework\n    plugin-verify admob-demo-app-ionic ios --portrait\n```\n\n## Quick start\n```bash\n\t# create a demo project\n    cordova create test1 com.rjfun.test1 Test1\n    cd test1\n    cordova platform add android\n    cordova platform add ios\n\n    # now add the plugin, cordova CLI will handle dependency automatically\n    cordova plugin add cordova-plugin-admobpro\n\n    # now remove the default www content, copy the demo html file to www\n    rm -r www/*;\n    cp plugins/cordova-plugin-admobpro/test/* www/;\n\n\t# now build and run the demo in your device or emulator\n    cordova prepare; \n    cordova run android; \n    cordova run ios;\n    # or import into Xcode / eclipse\n```\n\n## Installation\n\n* If use with Cordova CLI:\n```bash\ncordova plugin add cordova-plugin-admobpro\n\ncordova plugin add cordova-plugin-admobpro --save --variable PLAY_SERVICES_VERSION=20.4.0 --variable ADMOB_ANDROID_APP_ID=\"__your_admob_android_app_id___\" --variable ADMOB_IOS_APP_ID=\"__your_admob_ios_app_id___\"\n```\n\nIf use other tools or online build services, see:\n* [x] Apache Cordova CLI, v7.0+ ([How To ...](https://github.com/floatinghotpot/cordova-admob-pro/wiki/01.-How-to-Use-with-Cordova-CLI))\n* [x] Google Mobile Chrome App ([How To ...](https://github.com/floatinghotpot/cordova-admob-pro/wiki/05.-How-to-Use-with-Mobile-Chrome-App))\n* [x] Meteor ([How To ...](https://github.com/floatinghotpot/cordova-admob-pro/wiki/06.-How-To-Use-with-Meteor))\n* [x] Ionic V1, [Ionic V1 Demo](https://github.com/jaivehall/admob-ionic-demo)\n* [x] Ionic, [Ionic Demo](https://github.com/jaivehall/admob-ionic2-demo)\n\nNotice:\n* If build locally using ```cordova-plugin-admobpro```, to avoid build error, you need install some extras in Android SDK manager (type ```android sdk``` to launch it):\n![android extra](https://cloud.githubusercontent.com/assets/2339512/8176143/20533ec0-1429-11e5-8e17-a748373d5110.png)\n\n## Usage\n\nShow Mobile Ad with single line of javascript code.\n\nStep 1: Create Ad Unit Id for your banner and interstitial, in [AdMob portal](http://www.admob.com/), then write it in your javascript code.\n\n```javascript\n// select the right Ad Id according to platform\n  var admobid = {};\n  if( /(android)/i.test(navigator.userAgent) ) { // for android \u0026 amazon-fireos\n    admobid = {\n      banner: 'ca-app-pub-xxx/xxx', // or DFP format \"/6253334/dfp_example_ad\"\n      interstitial: 'ca-app-pub-xxx/yyy'\n    };\n  } else { // for ios\n    admobid = {\n      banner: 'ca-app-pub-xxx/zzz', // or DFP format \"/6253334/dfp_example_ad\"\n      interstitial: 'ca-app-pub-xxx/kkk'\n    };\n  }\n```\n\nStep 2: Want cheap and basic banner? single line of javascript code.\n\n```javascript\n// it will display smart banner at top center, using the default options\nif(AdMob) AdMob.createBanner({\n  adId: admobid.banner,\n  position: AdMob.AD_POSITION.TOP_CENTER,\n  autoShow: true });\n```\n\nStep 3: Want interstitial Ad to earn more money ? Easy, 2 lines of code. \n\n```javascript\n// preppare and load ad resource in background, e.g. at begining of game level\nif(AdMob) AdMob.prepareInterstitial( {adId:admobid.interstitial, autoShow:false} );\n\n// show the interstitial later, e.g. at end of game level\nif(AdMob) AdMob.showInterstitial();\n```\n\nOr, you can just copy this [admob_simple.js](https://github.com/floatinghotpot/cordova-admob-pro/blob/master/test/admob_simple.js) to your project, change the ad unit id to your own, and simply reference it in your index.html, like this:\n```html\n\u003cscript type=\"text/javascript\" src=\"admob_simple.js\"\u003e\u003c/script\u003e\n```\n\nRemember to remove `isTesting:true` if release for production.\n\n## AdMob Mediation Adapters ##\n\nOptional mediations to increase your revenue (Read about [AdMob Mediation Networks](https://developers.google.com/mobile-ads-sdk/docs/admob/android/mediation-networks)):\n```bash\ncordova plugin add cordova-plugin-admob-facebook\ncordova plugin add cordova-plugin-admob-flurry\ncordova plugin add cordova-plugin-admob-unityads\ncordova plugin add cordova-plugin-admob-inmobi\ncordova plugin add cordova-plugin-admob-mmedia\ncordova plugin add cordova-plugin-admob-mobfox\n```\n\nNotice: If you want to add multiple mediations, please balance flexibility and binary size.\n\n## API\n\nMethods:\n```javascript\n// use banner\ncreateBanner(adId/options, success, fail);\nremoveBanner();\nshowBanner(position);\nshowBannerAtXY(x, y);\nhideBanner();\n\n// use interstitial\nprepareInterstitial(adId/options, success, fail);\nshowInterstitial();\nisInterstitialReady(function(ready){ if(ready){ } });\n\n// use reward video\nprepareRewardVideoAd(adId/options, success, fail);\nshowRewardVideoAd();\n\n// set values for configuration and targeting\nsetOptions(options, success, fail);\n\n// get user ad settings\ngetAdSettings(function(inf){ inf.adId; inf.adTrackingEnabled; }, fail);\n```\n\nEvents:\n```javascript\n// onAdLoaded\n// onAdFailLoad\n// onAdPresent\n// onAdDismiss\n// onAdLeaveApp\ndocument.addEventListener('onAdFailLoad', function(e){\n    // handle the event\n});\n```\n## Use AdMobPro with Ionic\n\nUse with Capacitor:\n```bash\n$ npm install cordova-plugin-admobpro\n$ npm install @awesome-cordova-plugins/admob-pro\n$ ionic cap sync\n```\nOr, use with Cordova:\n```bash\n$ ionic cordova plugin add cordova-plugin-admobpro\n$ npm install @awesome-cordova-plugins/admob-pro\n```\n\nCode for Angular:\n```javascript\nimport { AdMobPro } from '@awesome-cordova-plugins/admob-pro/ngx';\nimport { Platform } from '@ionic/angular';\n\nconstructor(private admob: AdMobPro, private platform: Platform ) { }\n\nionViewDidLoad() {\n  this.admob.onAdDismiss()\n    .subscribe(() =\u003e { console.log('User dismissed ad'); });\n}\n\nonClick() {\n  let adId;\n  if(this.platform.is('android')) {\n    adId = 'YOUR_ADID_ANDROID';\n  } else if (this.platform.is('ios')) {\n    adId = 'YOUR_ADID_IOS';\n  }\n  this.admob.prepareInterstitial({adId: adId})\n    .then(() =\u003e { this.admob.showInterstitial(); });\n}\n```\n\nSee more:\n[https://ionicframework.com/docs/native/admob-pro](https://ionicframework.com/docs/native/admob-pro)\n\n## Wiki and Docs\n\nQuick start, simply copy \u0026 paste:\n* [Example Code](https://github.com/floatinghotpot/cordova-admob-pro/wiki/1.0-Quick-Start-Example-Code)\n* [Complete Demo index.html](https://github.com/floatinghotpot/cordova-admob-pro/blob/master/test/index.html)\n\nAPI Reference:\n* [API Overview](https://github.com/floatinghotpot/cordova-admob-pro/wiki/1.1-API-Overview)\n* [How to Use Banner](https://github.com/floatinghotpot/cordova-admob-pro/wiki/1.3-Methods-for-Banner)\n* [How to Use Interstitial](https://github.com/floatinghotpot/cordova-admob-pro/wiki/1.4-Methods-for-Interstitial)\n* [How to Handle Ad Events](https://github.com/floatinghotpot/cordova-admob-pro/wiki/1.5-Events)\n* [Chinese/中文文档](https://github.com/floatinghotpot/cordova-admob-pro/wiki/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3)\n\nOther Documentations:\n* [ChangeLog](https://github.com/floatinghotpot/cordova-admob-pro/wiki/ChangeLog)\n* [Known issues \u0026 solutions/workarounds](https://github.com/floatinghotpot/cordova-admob-pro/wiki/Known-Issues-\u0026-Solution---Workaround)\n* [FAQ](https://github.com/floatinghotpot/cordova-admob-pro/wiki/FAQ)\n* [Notice for Android Proguard](https://github.com/floatinghotpot/cordova-admob-pro/wiki/Notice-for-Android-Proguard)\n\nDemo projects:\n* [App demo for Ionic V1](https://github.com/jaivehall/admob-ionic-demo), by Jaive\n* [App demo for Ionic](https://github.com/jaivehall/admob-ionic2-demo), by Jaive\n* [Game demo using phaser game engine](https://github.com/floatinghotpot/admob-demo-game-phaser/tree/master/demo)\n* [Game demo using PIXI game engine](https://github.com/floatinghotpot/admob-demo-game-pixi/tree/master/demo)\n\n## Video Tutorial\n\n* Using Cordova CLI to Add AdMob Plugin:\n\n[![Video](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/youtube_video0.jpg)](http://youtu.be/dBCRW_swoYU)\n\n* Run AdMob Demo App on Android:\n\n[![Video](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/youtube_video.jpg)](http://youtu.be/GsBI97WjFQo)\n\nMore video by developers:\n* [How to add Banner ads To Ionic apps with Admob Pro For android](https://youtu.be/qNg8c4J03dE), by pointDeveloper\n* [How To Add Banner Ads To Ionic 2 with AdMob Cordova Plugin](https://youtu.be/dfHPlVvIUR0), by pointDeveloper\n* [How to add Interstitial Add on navigation for phonegap using JavaScript and AdMob Pro plugin](https://youtu.be/5YvikM3ySXc), by pointDeveloper\n* Interesting [Evolution of cordova-admob-pro (Gource Visualization)](https://youtu.be/yH66cHnY06M), by Landon Wilkins\n\n## Screenshots\n\niPhone Banner | iPhone Interstitial\n-------|---------------\n![ScreenShot](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/iphone.jpg) | ![ScreenShot](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/iphone_interstitial.jpg)\nAndroid Banner | Android Interstitial\n![ScreenShot](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/android.jpg) | ![ScreenShot](https://github.com/floatinghotpot/cordova-admob-pro/raw/master/docs/android_interstitial.jpg)\n\n## Tips\n\nSome important tips, FYI.\n\n- [x] Why Google AdMob is recommended ?\n\nAdvertisement is main business and income source of Google, so clients are all around the world. Google is one of the most rialable partners for its high standard service.\n\n* High fill rate, nearly 100% all around world.\n* High quality Ad, bring high RPM.\n* Stable price, auto pay on time. Pay on every 20th next month.\n\n- [x] Strongly recommend Interstitial, more than 10 times profit than banner Ad. \n\nAd Format | Banner | Interstitial\n---|-------|--------------\nClick Rate | \u003c 1% | 3-15%\nRPM (revenue per 1000 impression) |  US$ 0.5~4 | US$ 10~50\n\n- [x] Using SMART_BANNER to auto-fit the screen width, avoid using BANNER or FULL_BANNER (unless you are using DFP)\n\n⚠：Remember Google's slogan: \"Don't be evil\". Invalid usage violating Google rules, may cause your AdMob account suspended ! \n\n* AdMob publisher may NOT abuse or encourage abuse any Google products, including Google Play, YouTube or Blogger, incuding allow user downloading YouTube video, or embed YouTube video in your own apps.\n\n* Publishers may NOT click their own ads or use any means to inflate impressions and/or clicks artificially, including manual methods. Testing your own ads by clicking on them is not allowed.\n\nMore details, please read [AdMob \u0026 AdSense policies](https://support.google.com/admob/answer/6128543?hl=en\u0026ref_topic=2745287)\n\n## License\n\nYou can use the plugin for free, or you can also pay to get a license. IMPORTANT!!! Before using the plugin, please read the following content and accept the agreement. THIS WILL AVOID POTENTIAL PROBLEM AND DISPUTE.\n\nThere are 3 license options, fully up to you:\n1. Free and Open Source, no support\n2. Commercial, with email/skype support\n3. Win-win partnership, with forum support\n\nIf you hope to get a fully open source plugin (either need DIY, or hope to get full control on the code), use this open source one instead. Fork and pull request is welcome, but please mention it's derived source. Simply renaming then publishing to npm is forbidden. Open source project URL:\nhttps://github.com/floatinghotpot/cordova-plugin-admob\n\nIf use in commercial project, please [get a license](http://rjfun.github.io/), or, you have monetized more than $1000 using this plugin, you are also required to either get a commercial license ($20). As a commercial customer, you will be supported with high priority, via private email or even Skype chat.\n\nIf you don't want to get a license as your apps may not earn too much, or you don't have a PayPal account to pay, here is a compromised option. You don't have to pay, we are also okay if just share 2 percent user traffic, so that we can cover our effort and focus on maintenance and online support. (We have maintained this project since Aug 2014, and closed more than 560 support issues)\n\nPlease read the [License Agreement](https://github.com/floatinghotpot/cordova-admob-pro/wiki/License-Agreement) for details.\n\n## Credits\n\nThis project is created and maintained by Raymond Xie.\n\nMore Cordova/PhoneGap plugins by Raymond Xie, [find them in plugin registry](http://plugins.cordova.io/#/search?search=rjfun), or [find them in npm](https://www.npmjs.com/~floatinghotpot).\n\nProject outsourcing and consulting service is also available. Please [contact us](mailto:rjfun.mobile@gmail.com) if you have the business needs.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatinghotpot%2Fcordova-admob-pro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloatinghotpot%2Fcordova-admob-pro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloatinghotpot%2Fcordova-admob-pro/lists"}