Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

admob-google

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

admob-google - npm Package Compare versions

Comparing version
3.2.15
to
3.2.17
+1
-1
LICENSE
The MIT License (MIT)
Copyright (c) 2014 appfeel
Copyright (c) 2014 AppFeel

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -1,1 +0,1 @@

{"name":"admob-google","version":"3.2.15","description":"AdMob plugin. Android SDK v7.5, iOS SDK v7.3.1.","cordova":{"id":"admob-google","platforms":["android","ios"]},"repository":{"type":"git","url":"git+https://github.com/appfeel/admob-google-cordova.git"},"keywords":["ad","ads","admob","google","advertising","advertisment","publicity","earn","win","play","services","iad","flurry","monetization","money","appfeel","tappx","ecosystem:cordova","cordova-android","cordova-ios"],"engines":[{"name":"cordova","version":">=4.0.0"}],"author":"AppFeel","license":"MIT","bugs":{"url":"https://github.com/appfeel/admob-google-cordova/issues"},"homepage":"https://github.com/appfeel/admob-google-cordova#readme"}
{"name":"admob-google","version":"3.2.17","description":"AdMob plugin. Android SDK v7.5, iOS SDK v7.3.1.","cordova":{"id":"admob-google","platforms":["android","ios"]},"repository":{"type":"git","url":"git+https://github.com/appfeel/admob-google-cordova.git"},"keywords":["ad","ads","admob","google","advertising","advertisment","publicity","earn","win","play","services","iad","flurry","monetization","money","appfeel","tappx","ecosystem:cordova","cordova-android","cordova-ios"],"engines":{"name":"cordova","version":">=4.0.0"},"author":"AppFeel","license":"MIT","bugs":{"url":"https://github.com/appfeel/admob-google-cordova/issues"},"homepage":"https://github.com/appfeel/admob-google-cordova#readme"}
<?xml version="1.0" encoding="UTF-8" ?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="admob-google" version="3.2.15">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="admob-google" version="3.2.17">
<description>AdMob plugin. Android SDK v7.5, iOS SDK v7.3.1.</description>

@@ -16,2 +16,3 @@ <name>AdMob Google Ads + Tappx</name>

<dependency id="cordova-connectivity-monitor" />
<dependency id="cordova-play-services-version-adapter" />

@@ -46,7 +47,6 @@ <js-module src="www/admob.js" name="AdMobAds">

</config-file-->
<framework src="com.google.android.gms:play-services-ads:+" />
<framework src="com.google.android.gms:play-services-ads:15.0.0" />
<source-file src="src/android/AdMobAds.java" target-dir="src/com/appfeel/cordova/admob" />
<source-file src="src/android/AdMobAdsAdListener.java" target-dir="src/com/appfeel/cordova/admob" />
<source-file src="src/android/AdMobAdsAppPurchaseListener.java" target-dir="src/com/appfeel/cordova/admob" />
<source-file src="src/android/res/xml/admob.xml" target-dir="res/xml" />

@@ -53,0 +53,0 @@ </platform>

@@ -1,2 +0,2 @@

*<p style="font-size: small;" align="right"><a color="#232323;" href>Made in Barcelona with <span color="#FCB">Love</span> and <span color="#BBCCFF">Code</span></a></p>*
*<p style="font-size: small;" align="right"><a style="color:#232323" color="#232323" href="http://appfeel.com">Made in Barcelona with <span color="#FCB">Love</span> and <span color="#BBCCFF">Code</span></a></p>*

@@ -6,3 +6,4 @@ Cordova AdMob plugin

Monetize your Cordova/Phonegap/XDK apps with AdMob ads, **using latest Google AdMob SDK**.
### It simply works :)
Monetize your Cordova/Phonegap/XDK HTML5 hybrid apps and games with AdMob ads, **using latest Google AdMob SDK**.
With this Cordova/Phonegap/XDK plugin you can show AdMob ads as easy as:

@@ -20,2 +21,25 @@

---
## Plugin update (phonega/cordova cli) ##
`cordova-admob~4.1.15` and later are now updated to Firebase (ios 7.13.1 and later and managed by gradle in android)
To update the plugin you should remove the plugin ad add it again:
```
$ cordova plugin rm cordova-admob
$ npm cache clear
$ cordova plugin add cordova-admob
```
Sometimes removing the plugin causes an error (it's been reported to cordova https://issues.apache.org/jira/browse/CB-12083). If that happens, remove first `cordova-libgoogleadmobads` manually:
```
$ rm plugins/cordova-libgoogleadmobads/ -rf
$ cordova plugin rm cordova-admob
$ npm cache clear
$ cordova plugin add cordova-admob
```
---
## Testimonials ##

@@ -39,3 +63,3 @@

* iOS, using AdMob SDK for iOS, v7.13.1
* Android, using latest Google Play Service for Android (via gradle)
* Android, using latest Google Play Service for Android (managed by gradle)

@@ -120,5 +144,2 @@

* [showInterstitialAd](https://github.com/appfeel/admob-google-cordova/wiki/showInterstitialAd)
* In app purchase
* [recordResolution](https://github.com/appfeel/admob-google-cordova/wiki/recordResolution)
* [recordPlayBillingResolution](https://github.com/appfeel/admob-google-cordova/wiki/recordPlayBillingResolution)
* [Events](https://github.com/appfeel/admob-google-cordova/wiki/Events)

@@ -130,3 +151,2 @@ * [onAdLoaded](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsonadloaded)

* [onAdLeftApplication](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsonadleftapplication)
* [onInAppPurchaseRequested](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsoninapppurchaserequested)
* [Complete example code](https://github.com/appfeel/admob-google-cordova/wiki/Complete-example-code)

@@ -207,3 +227,2 @@ * [Contributing](https://github.com/appfeel/admob-google-cordova/wiki/Contributing)

document.addEventListener(admob.events.onAdLeftApplication, function (e) {});
document.addEventListener(admob.events.onInAppPurchaseRequested, function (e) {});

@@ -210,0 +229,0 @@ document.addEventListener("pause", onPause, false);

@@ -64,3 +64,2 @@ /*

import com.google.android.gms.ads.mediation.admob.AdMobExtras;
import com.google.android.gms.ads.purchase.InAppPurchase;

@@ -84,4 +83,2 @@ public class AdMobAds extends CordovaPlugin implements IConnectivityChange {

private static final String ACTION_SHOW_INTERSTITIAL_AD = "showInterstitialAd";
private static final String ACTION_RECORD_RESOLUTION = "recordResolution";
private static final String ACTION_RECORD_PLAY_BILLING_RESOLUTION = "recordPlayBillingResolution";

@@ -108,3 +105,2 @@ /* options */

private AdMobAdsAdListener backFillInterstitialListener = new AdMobAdsAdListener(INTERSTITIAL, this, true);
private AdMobAdsAppPurchaseListener inAppPurchaseListener = new AdMobAdsAppPurchaseListener(this);
private boolean isInterstitialAvailable = false;

@@ -196,13 +192,2 @@ private boolean isNetworkActive = false;

result = executeShowInterstitialAd(callbackContext);
} else if (ACTION_RECORD_RESOLUTION.equals(action)) {
int purchaseId = args.getInt(0);
int resolution = args.getInt(1);
result = executeRecordResolution(purchaseId, resolution, callbackContext);
} else if (ACTION_RECORD_PLAY_BILLING_RESOLUTION.equals(action)) {
int purchaseId = args.getInt(0);
int billingResponseCode = args.getInt(1);
result = executeRecordPlayBillingResolution(purchaseId, billingResponseCode, callbackContext);
} else {

@@ -630,3 +615,2 @@ Log.d(ADMOBADS_LOGTAG, String.format("Invalid action passed: %s", action));

interstitialAd.setAdUnitId(_iid);
interstitialAd.setInAppPurchaseListener(inAppPurchaseListener);
interstitialAd.setAdListener(adListener);

@@ -709,47 +693,2 @@ interstitialAd.loadAd(buildAdRequest());

private PluginResult executeRecordResolution(final int purchaseId, final int resolution, final CallbackContext callbackContext) {
final InAppPurchase purchase = inAppPurchaseListener.getPurchase(purchaseId);
if (purchase != null) {
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(ADMOBADS_LOGTAG, "AdMobAds.recordResolution: Recording purchase resolution");
purchase.recordResolution(resolution);
inAppPurchaseListener.removePurchase(purchaseId);
if (callbackContext != null) {
callbackContext.success();
}
}
});
} else if (callbackContext != null) {
callbackContext.success();
}
return null;
}
private PluginResult executeRecordPlayBillingResolution(final int purchaseId, final int billingResponseCode, final CallbackContext callbackContext) {
final InAppPurchase purchase = inAppPurchaseListener.getPurchase(purchaseId);
if (purchase != null) {
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(ADMOBADS_LOGTAG, "AdMobAds.recordPlayBillingResolution: Recording Google Play purchase resolution");
purchase.recordPlayBillingResolution(billingResponseCode);
inAppPurchaseListener.removePurchase(purchaseId);
if (callbackContext != null) {
callbackContext.success();
}
}
});
} else if (callbackContext != null) {
callbackContext.success();
}
return null;
}
public void tryBackfill(String adType) {

@@ -756,0 +695,0 @@ if (BANNER.equals(adType)) {

@@ -20,5 +20,2 @@ # Summary

* [showInterstitialAd](https://github.com/appfeel/admob-google-cordova/wiki/showInterstitialAd)
* In app purchase
* [recordResolution](https://github.com/appfeel/admob-google-cordova/wiki/recordResolution)
* [recordPlayBillingResolution](https://github.com/appfeel/admob-google-cordova/wiki/recordPlayBillingResolution)
* [Events](https://github.com/appfeel/admob-google-cordova/wiki/Events)

@@ -30,5 +27,4 @@ * [onAdLoaded](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsonadloaded)

* [onAdLeftApplication](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsonadleftapplication)
* [onInAppPurchaseRequested](https://github.com/appfeel/admob-google-cordova/wiki/Events#admobeventsoninapppurchaserequested)
* [Complete example code](https://github.com/appfeel/admob-google-cordova/wiki/Complete-example-code)
* [Contributing](https://github.com/appfeel/admob-google-cordova/wiki/Contributing)
* [Screenshots](https://github.com/appfeel/admob-google-cordova/wiki/Screenshots)

@@ -37,3 +37,2 @@ /*

onAdClosed: "appfeel.cordova.admob.onAdClosed",
onInAppPurchaseRequested: "appfeel.cordova.admob.onInAppPurchaseRequested",
};

@@ -59,9 +58,2 @@

admob.PURCHASE_RESOLUTION = {
RESOLUTION_CANCELED: 2,
RESOLUTION_FAILURE: 0,
RESOLUTION_INVALID_PRODUCT: 3,
RESOLUTION_SUCCESS: 1
};
// This is not used by the plugin, it is just a helper to show how options are specified and their default values

@@ -178,38 +170,2 @@ admob.options = {

/**
* Records a resolution after an inAppPurchase.
*
* @param {Integer} purchaseId The id of the purchase.
* @param {Integer} resolution The resolution code.
* @param {function()} successCallback The function to call if the ad was shown successfully.
* @param {function()} successCallback The function to call if the ad was shown successfully.
* @param {function()} failureCallback The function to call if the ad failed to be shown.
*/
admob.recordResolution = function (purchaseId, resolution, successCallback, failureCallback) {
if (purchaseId === undefined || resolution === undefined) {
if (typeof failureCallback === 'function') {
failureCallback('purchaseId and resolution should be specified.');
}
}
cordova.exec(successCallback, failureCallback, 'AdMobAds', 'recordResolution', [purchaseId, resolution]);
};
/**
* Records a resolution after an inAppPurchase.
*
* @param {Integer} purchaseId The id of the purchase.
* @param {Integer} billingResponseCode The resolution code.
* @param {function()} successCallback The function to call if the ad was shown successfully.
* @param {function()} successCallback The function to call if the ad was shown successfully.
* @param {function()} failureCallback The function to call if the ad failed to be shown.
*/
admob.recordPlayBillingResolution = function (purchaseId, billingResponseCode, successCallback, failureCallback) {
if (purchaseId === undefined || billingResponseCode === undefined) {
if (typeof failureCallback === 'function') {
failureCallback('purchaseId and billingResponseCode should be specified.');
}
}
cordova.exec(successCallback, failureCallback, 'AdMobAds', 'recordResolution', [purchaseId, billingResponseCode]);
};
if (typeof module !== 'undefined') {

@@ -216,0 +172,0 @@ // Export admob

@@ -83,3 +83,2 @@ /*

onAdClosed: "appfeel.cordova.admob.onAdClosed",
onInAppPurchaseRequested: "appfeel.cordova.admob.onInAppPurchaseRequested"
},

@@ -97,8 +96,2 @@ AD_SIZE: {

},
PURCHASE_RESOLUTION: {
RESOLUTION_CANCELED: 2,
RESOLUTION_FAILURE: 0,
RESOLUTION_INVALID_PRODUCT: 3,
RESOLUTION_SUCCESS: 1
},
options: options,

@@ -139,12 +132,2 @@ eventPrefix: eventPrefix,

},
recordResolution: function (purchaseId, resolution) {
return deviceready.promise.then(function () {
return makePromise(window.admob.recordResolution, [purchaseId, resolution]);
});
},
recordPlayBillingResolution: function (purchaseId, billingResponseCode) {
return deviceready.promise.then(function () {
return makePromise(window.admob.recordPlayBillingResolution, [purchaseId, billingResponseCode]);
});
}
};

@@ -173,6 +156,2 @@

function _onInAppPurchaseRequested(e) {
$rootScope.$broadcast(angularAdmob.eventPrefix + window.admob.events.onInAppPurchaseRequested, e);
}
deviceready.promise.then(function () {

@@ -184,7 +163,5 @@ document.addEventListener(window.admob.events.onAdLoaded, _onAdLoaded, true);

document.addEventListener(window.admob.events.onAdClosed, _onAdClosed, true);
document.addEventListener(window.admob.events.onInAppPurchaseRequested, _onInAppPurchaseRequested, true);
angularAdmob.AD_SIZE = window.admob.AD_SIZE;
angularAdmob.AD_TYPE = window.admob.AD_TYPE;
angularAdmob.PURCHASE_RESOLUTION = window.admob.PURCHASE_RESOLUTION;
angularAdmob.options = window.admob.options;

@@ -212,3 +189,2 @@

document.removeEventListener(window.admob.events.onAdClosed, angularAdmob._onAdClosed, true);
document.removeEventListener(window.admob.events.onInAppPurchaseRequested, angularAdmob._onInAppPurchaseRequested, true);
});

@@ -215,0 +191,0 @@

/*
AdMobAdsPurchaseListener.java
Copyright 2015 AppFeel. All rights reserved.
http://www.appfeel.com
AdMobAds Cordova Plugin (cordova-admob)
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.
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.
*/
package com.appfeel.cordova.admob;
import android.annotation.SuppressLint;
import android.util.Log;
import android.util.SparseArray;
import com.google.android.gms.ads.purchase.InAppPurchase;
import com.google.android.gms.ads.purchase.InAppPurchaseListener;
@SuppressLint("DefaultLocale")
public class AdMobAdsAppPurchaseListener implements InAppPurchaseListener {
private AdMobAds admobAds;
private static int purchaseId = 0;
private SparseArray<InAppPurchase> purchases = new SparseArray<InAppPurchase>();
public AdMobAdsAppPurchaseListener(AdMobAds admobAds) {
this.admobAds = admobAds;
}
@Override
synchronized public void onInAppPurchaseRequested(final InAppPurchase inAppPurchase) {
admobAds.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(AdMobAds.ADMOBADS_LOGTAG, "AdMobAdsAppPurchaseListener.onInAppPurchaseRequested: In app purchase. SKU: " + inAppPurchase.getProductId());
purchases.put(purchaseId, inAppPurchase);
String event = String.format("javascript:cordova.fireDocumentEvent(admob.events.onInAppPurchaseRequested, { 'purchaseId': %d, 'productId': '%s' });", purchaseId, inAppPurchase.getProductId());
admobAds.webView.loadUrl(event);
purchaseId++;
}
});
}
public InAppPurchase getPurchase(int purchaseId) {
return purchases.get(purchaseId);
}
public void removePurchase(int purchaseId) {
purchases.remove(purchaseId);
}
}