From da8100f1fab4607a191ed91d21f12b98dca4d95d Mon Sep 17 00:00:00 2001 From: Cupertino Date: Wed, 24 Feb 2016 16:25:53 +0100 Subject: [PATCH] updated readme and others --- LICENSE | 2 +- README.md | 31 +++++++++++++++++++++---------- package.json | 2 +- plugin.xml | 2 +- src/ios/CDVAdMob.m | 4 ++-- src/wp8/AdMob.cs | 8 ++++---- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/LICENSE b/LICENSE index 723f621..bb1caf3 100644 --- a/LICENSE +++ b/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 diff --git a/README.md b/README.md index 925aa57..909c421 100644 --- a/README.md +++ b/README.md @@ -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 : { @@ -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(){}); @@ -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 @@ -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 - + ``` - 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. @@ -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. diff --git a/package.json b/package.json index 0c78656..789c84a 100644 --- a/package.json +++ b/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", diff --git a/plugin.xml b/plugin.xml index 15dad9c..1baa5d7 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ + version="1.0.8"> AdMob Robust, reliable and easy to use Cordova Admob plugin for Android. Allows preloading and automatic loading of interstitials. diff --git a/src/ios/CDVAdMob.m b/src/ios/CDVAdMob.m index d5ad396..fe946ec 100644 --- a/src/ios/CDVAdMob.m +++ b/src/ios/CDVAdMob.m @@ -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" diff --git a/src/wp8/AdMob.cs b/src/wp8/AdMob.cs index 3b752f8..1fc6713 100644 --- a/src/wp8/AdMob.cs +++ b/src/wp8/AdMob.cs @@ -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"; @@ -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(() => @@ -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(() =>