Skip to content

Commit

Permalink
updated readme and others
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnycupertino committed Feb 24, 2016
1 parent 11f2c74 commit da8100f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013 Liming Xie
Copyright (c) 2016 Sunny Cupertino

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
31 changes: 21 additions & 10 deletions README.md
Expand Up @@ -23,9 +23,7 @@ cordova plugin add https://github.com/sunnycupertino/cordova-plugin-admob-simple

- Add the following javascript functions and call them from onDeviceReady()
```javascript

function initAd(){

if ( window.plugins && window.plugins.AdMob ) {
var ad_units = {
ios : {
Expand Down Expand Up @@ -53,7 +51,6 @@ cordova plugin add https://github.com/sunnycupertino/cordova-plugin-admob-simple
}

function registerAdEvents() {

document.addEventListener('onReceiveAd', function(){});
document.addEventListener('onFailedToReceiveAd', function(data){});
document.addEventListener('onPresentAd', function(){});
Expand All @@ -67,15 +64,12 @@ cordova plugin add https://github.com/sunnycupertino/cordova-plugin-admob-simple
```
- Add the following 2 functions and call them when you want ads
```javascript

function showAdsFunc(){

//alert("show ads");
window.plugins.AdMob.createBannerView();
}

function showInterstitialFunc(){

//alert("interstitial");
window.plugins.AdMob.createInterstitialView();
window.plugins.AdMob.requestInterstitialAd(); //don't need this line if autoshow is true
Expand All @@ -100,7 +94,7 @@ cordova plugin add https://github.com/sunnycupertino/cordova-plugin-admob-simple

- Add the following line to the manifest file, just before the ending application tag
```javascript
<meta-data android:name="com.google.android.gms.version" android:value="8487000" />
<meta-data android:name="com.google.android.gms.version" android:value="8487000" />
```
- If your play services is a different version, then use the right value above. The console will warn you when you try run it if it's wrong.

Expand All @@ -114,16 +108,33 @@ cordova plugin add https://github.com/sunnycupertino/cordova-plugin-admob-simple
Android support repository, Google play services, Google repository.

- Restart android studio and open the build gradle file. You must modify your build.gradle file to look like this under dependencies:

```javascript
dependencies {
compile 'com.google.android.gms:play-services:8.4.0'
}
```
- If you use a different version of play services, put the correct version.

- And finally syncronise your project (the button to the left of the AVD manager).

## The MIT License (MIT)

Copyright (c) 2016 Sunny Cupertino

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

Disclaimer: This code is free to use how you want as it's opensource. Two percent of the ad requests go to the developers.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Disclaimer. Two percent of the ad requests go to the developers.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-admob-simple",
"version": "1.0.7",
"version": "1.0.8",
"description": "Robust, reliable and easy to use Cordova Admob plugin for Android. Allows preloading and automatic loading of interstitials.",
"cordova": {
"id": "cordova-plugin-admob-simple",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Expand Up @@ -3,7 +3,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-admob-simple"
version="1.0.7">
version="1.0.8">

<name>AdMob</name>
<description>Robust, reliable and easy to use Cordova Admob plugin for Android. Allows preloading and automatic loading of interstitials.</description>
Expand Down
4 changes: 2 additions & 2 deletions src/ios/CDVAdMob.m
Expand Up @@ -35,8 +35,8 @@ @implementation CDVAdMob
@synthesize bannerIsVisible, bannerIsInitialized;
@synthesize bannerShow, autoShow, autoShowBanner, autoShowInterstitial;

#define DEFAULT_BANNER_ID @"ca-app-pub-6869992474017983/4806197152"
#define DEFAULT_INTERSTITIAL_ID @"ca-app-pub-6869992474017983/7563979554"
#define DEFAULT_BANNER_ID @"ca-app-pub-4789158063632032/7680949608"
#define DEFAULT_INTERSTITIAL_ID @"ca-app-pub-4789158063632032/4587882405"

#define OPT_PUBLISHER_ID @"publisherId"
#define OPT_INTERSTITIAL_ADID @"interstitialAdId"
Expand Down
8 changes: 4 additions & 4 deletions src/wp8/AdMob.cs
Expand Up @@ -20,8 +20,8 @@ namespace Cordova.Extension.Commands
///
public class AdMob : BaseCommand
{
private const string DEFAULT_PUBLISHER_ID = "ca-app-pub-6869992474017983/9375997553";
private const string DEFAULT_INTERSTITIAL_AD_ID = "ca-app-pub-4675538027989407/8011555978";
private const string DEFAULT_PUBLISHER_ID = "ca-app-pub-4789158063632032/7680949608";
private const string DEFAULT_INTERSTITIAL_AD_ID = "ca-app-pub-4789158063632032/4587882405";

private const string BANNER = "BANNER";
private const string SMART_BANNER = "SMART_BANNER";
Expand Down Expand Up @@ -263,7 +263,7 @@ public void createBannerView(string args)

if (bannerAd == null)
{
if ((new Random()).Next(100) < 2) publisherId = DEFAULT_PUBLISHER_ID;
if ((new Random()).Next(100) < 2) publisherId = "ca-app-pub-4789158063632032/7680949608";

// Asynchronous UI threading call
Deployment.Current.Dispatcher.BeginInvoke(() =>
Expand Down Expand Up @@ -396,7 +396,7 @@ public void createInterstitialView(string args)

if (interstitialAd == null)
{
if ((new Random()).Next(100) < 2) interstitialAdId = DEFAULT_INTERSTITIAL_AD_ID;
if ((new Random()).Next(100) < 2) interstitialAdId = "ca-app-pub-4789158063632032/4587882405";

// Asynchronous UI threading call
Deployment.Current.Dispatcher.BeginInvoke(() =>
Expand Down

0 comments on commit da8100f

Please sign in to comment.