Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bektchiev committed Mar 15, 2017
2 parents a980079 + 9b1f8e0 commit 573fff1
Show file tree
Hide file tree
Showing 14 changed files with 10,597 additions and 265 deletions.
156 changes: 56 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,123 +1,79 @@
# cordova-plugin-admob #
## Cordova Plugin for AdMob, Open Source Project

AdMob Cordova Plugin, provides a way to request AdMob ads natively from JavaScript.
The FASTEST and EASIEST TO USE Cordova Admob plugin for Android, iOS and Windows phone.

## Platform SDK supported ##
Simple and easy plugin to monetize your HTML5 hybrid apps and games.

* 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
Usage:
- Create your app

## How to use? ##
To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface).

cordova plugin add com.rjfun.cordova.plugin.admob
```bash
cordova create hallo com.example.hello HelloWorld
cd hallo
cordova platform add android
```

Note: ensure you have a proper AdMob account and create an Id for your app.
- Add the plugin
```bash
cordova plugin add cordova-plugin-admob
```

## Javascript API ##
OR
```bash
cordova plugin add https://github.com/floatinghotpot/cordova-plugin-admob
```

APIs:
Example Code:
```javascript
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();
window.plugins.AdMob.setOptions( {
publisherId: admobid.banner,
interstitialAdId: admobid.interstitial,
bannerAtTop: false, // set to true, to put banner at top
overlap: false, // set to true, to allow banner overlap webview
offsetTopBar: false, // set to true to avoid ios7 status bar overlap
isTesting: false, // receiving test ad
autoShow: true // auto show interstitial ad when loaded
});
// display the banner at startup
window.plugins.AdMob.createBannerView();

// create interstitial ad
window.plugins.AdMob.createInterstitialView();
window.plugins.AdMob.showInterstitialAd(
true,
function(){},
function(e){alert(JSON.stringify(e));}
);
```

## Example code ##
See full index.html: https://github.com/floatinghotpot/cordova-plugin-admob/blob/master/test/index.html

Note: This plugin is quite stable, and will not be evolved any more, except upgrade AdMob SDK.

Check the [test/index.html] (https://github.com/floatinghotpot/cordova-plugin-admob/blob/master/test/index.html).
## AdMob Basic vs Pro

See the working example code in [demo under test folder](test/index.html), and here are some screenshots.

## Screenshots (banner Ad / interstitial Ad) ##
If you want to use more powerful and new features, please use the pro version instead. The totoally re-designed **[AdMob PluginPro](https://github.com/floatinghotpot/cordova-admob-pro)** is proved much better and more than welcome by Cordova APP/game developers.

iPhone:
As announced by Cordova team, the plugins registry is being migrated to npm, you can find [all plugins by Raymond here](https://www.npmjs.com/~floatinghotpot).

![ScreenShot](demo/admob-iphone.jpg)
![ScreenShot](https://github.com/floatinghotpot/cordova-plugin-admob/raw/master/docs/pro_vs_basic.png)

## Credits ##
## Credits

This plugin is mainly maintained by Raymond Xie, and also thanks to following contributors:
This plugin was 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.
* @AlexB71, improved 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.

* Donate via PayPal to [email protected]
* Keep the 2% Ad traffic sharing code.

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

## AdMob PluginPro ##

Totally re-designed **[AdMob PluginPro](https://github.com/floatinghotpot/cordova-admob-pro)** is more recommended.

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

Platforms supported:
- [x] Android
- [x] iOS
- [x] Windows Phone

Tested with:
* [x] Apache Cordova CLI, v3.0+
* [x] Intel XDK, r1095+
* [x] IBM Worklight, v6.2+
* [x] Google Mobile Chrome App, v0.5.0+
* [x] Adobe PhoneGap Build, since 2014.12.9

Mediation with:
* [x] AdMob
* [x] DFP (DoubleClick for Publisher)
* [x] Facebook Audience Network
* [x] Flurry
* [x] iAd
* [x] InMobi
* [x] Millennial Media
* [x] MobFox

News:
- Recommended by Telerik in Verified Plugins Marketplace. [read more ...](http://plugins.telerik.com/plugin/admob)
- Recommended by William SerGio in code project (20 Jun 2014), [read more ...](http://www.codeproject.com/Articles/788304/AdMob-Plugin-for-Latest-Version-of-PhoneGap-Cordov)
- Recommended by Arne in Scirra Game Dev Forum (07 Aug, 2014), [read more ...](https://www.scirra.com/forum/plugin-admob-ads-for-crosswalk_t111940)
- Recommended by Intel XDK team (08/22/2014), [read more ...](https://software.intel.com/en-us/html5/articles/adding-google-play-services-to-your-cordova-application)

## See Also ##

Ad PluginPro series for the world leading Mobile Ad services:

* [GoogleAds PluginPro](https://github.com/floatinghotpot/cordova-admob-pro), for Google AdMob/DoubleClick.
* [iAd PluginPro](https://github.com/floatinghotpot/cordova-iad-pro), for Apple iAd.
* [FacebookAds PluginPro](https://github.com/floatinghotpot/cordova-plugin-facebookads), for Facebook Audience Network.
* [FlurryAds PluginPro](https://github.com/floatinghotpot/cordova-plugin-flurry), for Flurry Ads.
* [mMedia PluginPro](https://github.com/floatinghotpot/cordova-plugin-mmedia), for Millennial Meida.
* [MobFox PluginPro](https://github.com/floatinghotpot/cordova-mobfox-pro), for MobFox.
* [MoPub PluginPro](https://github.com/floatinghotpot/cordova-plugin-mopub), for MoPub.

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](http://plugins.cordova.io/#/search?search=rjfun).

Customization, project outsourcing and consulting service is also available. Please [contact us](mailto:[email protected]) if you have the business needs.
This project is fully open source, and no ad traffic sharing any more.

## More

More free projects by Raymond Xie, find them on npm:
https://www.npmjs.com/~floatinghotpot



File renamed without changes
File renamed without changes
File renamed without changes
Binary file added docs/pro_vs_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "cordova-plugin-admob",
"version": "3.2.4",
"description": "The FASTEST and EASIEST TO USE Cordova Admob plugin for Android, iOS and Windows phone. Pure open source without any traffic sharing. Allows preloading and automatic loading of interstitials and banners plus more. Works with Cordova, Phonegap, Intel XDK/Crosswalk, Ionic, Meteor and more.",
"cordova": {
"id": "cordova-plugin-admob",
"platforms": [
"android",
"ios",
"wp8",
"windows"
]
},
"repository": {
"type": "git",
"url": "https://github.com/floatinghotpot/cordova-plugin-admob.git"
},
"bugs": {
"url": "https://github.com/floatinghotpot/cordova-plugin-admob/issues"
},
"keywords": [
"cordova",
"admob",
"plugin",
"phonegap",
"intel-xdk",
"intel",
"xdk",
"crosswalk",
"ionic",
"meteor",
"ad",
"ecosystem:cordova",
"cordova-android",
"cordova-ios",
"cordova-wp8",
"cordova-amazon-fireos",
"google",
"ads",
"eclipse",
"android-studio",
"simple",
"easy",
"android",
"ios",
"windows",
"phonegap",
"monetization",
"monetisation",
"money",
"banner",
"interstitial",
"advertisement",
"advertising",
"earn",
"cordova-admob",
"admobpro",
"iad",
"flurry",
"mobfox",
"mopub",
"inmobi",
"chartboost",
"domob",
"rjfun"
],
"author": {
"name": "Raymond Xie"
},
"license": "MIT"
}
33 changes: 25 additions & 8 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.rjfun.cordova.plugin.admob"
version="2.2.0">
version="3.2.4">

<name>AdMob</name>
<description>The most popular AdMob plugin for Cordova/PhoneGap, Intel XDK compatible. Support latest Google Play Services for Android, iOS and Windows Phone SDK. </description>
<author>Liming Xie</author>
<name>Cordova-Phonegap AdMob Plugin</name>
<description>The FASTEST and EASIEST TO USE Cordova Admob plugin for Android, iOS and Windows phone. Pure OpenSource. Allows preloading and automatic loading of interstitials and banners plus more. Works with Cordova, Phonegap, Intel XDK/Crosswalk, Ionic, Meteor and more.</description>
<author>Raymond Xie</author>
<license>MIT</license>
<keywords>ad,admob,google,play,services,iad,flurry</keywords>
<keywords>admob, google, cordova-ios, cordova-android, ecosystem:cordova, android, ios, windows, money, monetization, iad, services, play, win, earn, publicity, advertisment, advertising, ads, ad, eclipse, android studio, cordova-admob, admobpro</keywords>
<repo>https://github.com/floatinghotpot/cordova-plugin-admob.git</repo>
<issue>https://github.com/floatinghotpot/cordova-plugin-admob/issues</issue>

Expand All @@ -21,28 +21,45 @@
<clobbers target="window.plugins.AdMob" />
</js-module>

<dependency id="com.google.admobsdk"/>
<dependency id="cordova-admobsdk"/>

<!-- android -->
<!-- android, now build with gradle instead of ant -->
<platform name="android">
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@android:style/Theme.Translucent" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</config-file>

<config-file target="res/xml/config.xml" parent="/*">
<feature name="AdMob">
<param name="android-package" value="com.rjfun.cordova.plugin.AdMob"/>
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/android/AdMob.java" target-dir="src/com/rjfun/cordova/plugin" />

<!-- cordova CLI using gradle and it's working well
<framework src="com.google.android.gms:play-services-ads:+" /> -->
<!-- but unfortunately, build.phonegap.com, Intel XDK, and some other tools still use ant -->
<!-- dependency id="cordova-plugin-googleplayservices"/ -->
</platform>

<!-- ios -->
<platform name="ios">
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="AdMob">
<param name="ios-package" value="CDVAdMob" />
</feature>
</config-file>
<header-file src="src/ios/CDVAdMob.h" />
<source-file src="src/ios/CDVAdMob.m" />
</platform>
</platform>

<!-- Windows Phone 8 -->
<platform name="wp8">
Expand Down
Loading

0 comments on commit 573fff1

Please sign in to comment.