cordova-plugin-ad-admob
Advanced tools
Comparing version 1.0.112 to 1.0.113
{ | ||
"name": "cordova-plugin-ad-admob", | ||
"version": "1.0.112", | ||
"version": "1.0.113", | ||
"description": "Show admob banner and interstitial ad", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -93,2 +93,5 @@ Cordova AdMob plugin | ||
Fixed cocoon.io android canvas+ banner issue. | ||
1.0.113 | ||
Updated AdMob iOS SDK v7.10.0 | ||
Added rewarded video ad | ||
@@ -279,2 +282,3 @@ To-Do: | ||
var interstitialAdUnit = "REPLACE_THIS_WITH_YOUR_INTERSTITIAL_AD_UNIT"; | ||
var rewardedVideoAdUnit = "REPLACE_THIS_WITH_YOUR_REWARDED_VIDEO_AD_UNIT"; | ||
var isOverlap = true; //true: overlap, false: split | ||
@@ -291,2 +295,3 @@ var isTest = true; | ||
interstitialAdUnit = "REPLACE_THIS_WITH_YOUR_INTERSTITIAL_AD_UNIT"; | ||
rewardedVideoAdUnit = "REPLACE_THIS_WITH_YOUR_REWARDED_VIDEO_AD_UNIT"; | ||
} | ||
@@ -297,2 +302,3 @@ //ios | ||
interstitialAdUnit = "REPLACE_THIS_WITH_YOUR_INTERSTITIAL_AD_UNIT"; | ||
rewardedVideoAdUnit = "REPLACE_THIS_WITH_YOUR_REWARDED_VIDEO_AD_UNIT"; | ||
} | ||
@@ -303,2 +309,3 @@ //wp8 | ||
interstitialAdUnit = "REPLACE_THIS_WITH_YOUR_INTERSTITIAL_AD_UNIT"; | ||
rewardedVideoAdUnit = "REPLACE_THIS_WITH_YOUR_REWARDED_VIDEO_AD_UNIT"; | ||
} | ||
@@ -312,3 +319,3 @@ */ | ||
window.admob.setUp(bannerAdUnit, interstitialAdUnit, isOverlap, isTest); | ||
window.admob.setUp(bannerAdUnit, interstitialAdUnit, rewardedVideoAdUnit, isOverlap, isTest); | ||
@@ -341,2 +348,18 @@ // | ||
}; | ||
// | ||
window.admob.onRewardedVideoAdPreloaded = function() { | ||
alert('onRewardedVideoAdPreloaded'); | ||
}; | ||
window.admob.onRewardedVideoAdLoaded = function() { | ||
alert('onRewardedVideoAdLoaded'); | ||
}; | ||
window.admob.onRewardedVideoAdShown = function() { | ||
alert('onRewardedVideoAdShown'); | ||
}; | ||
window.admob.onRewardedVideoAdHidden = function() { | ||
alert('onRewardedVideoAdHidden'); | ||
}; | ||
window.admob.onRewardedVideoAdCompleted = function() { | ||
alert('onRewardedVideoAdCompleted'); | ||
}; | ||
}, false); | ||
@@ -363,7 +386,12 @@ | ||
window.admob.preloadRewardedVideoAd();//option, download ad previously for fast show | ||
window.admob.showRewardedVideoAd(); | ||
alert(window.admob.loadedBannerAd());//boolean: true or false | ||
alert(window.admob.loadedInterstitialAd());//boolean: true or false | ||
alert(window.admob.loadedRewardedVideoAd());//boolean: true or false | ||
alert(window.admob.isShowingBannerAd());//boolean: true or false | ||
alert(window.admob.isShowingInterstitialAd());//boolean: true or false | ||
alert(window.admob.isShowingRewardedVideoAd());//boolean: true or false | ||
``` | ||
@@ -370,0 +398,0 @@ # Examples # |
@@ -5,4 +5,6 @@ | ||
_loadedInterstitialAd: false, | ||
_loadedRewardedVideoAd: false, | ||
_isShowingBannerAd: false, | ||
_isShowingInterstitialAd: false, | ||
_isShowingRewardedVideoAd: false, | ||
_fixCocoonIOCordovaAndroidAdMobIssue: false, | ||
@@ -20,4 +22,9 @@ // | ||
}, | ||
setUp: function(bannerAdUnit, interstitialAdUnit, isOverlap, isTest) { | ||
var self = this; | ||
setUp: function(bannerAdUnit, interstitialAdUnit, rewardedVideoAdUnit, isOverlap, isTest) { | ||
if (typeof isTest == 'undefined') { | ||
isOverlap=rewardedVideoAdUnit; | ||
isTest=isOverlap; | ||
} | ||
var self = this; | ||
cordova.exec( | ||
@@ -97,2 +104,30 @@ function (result) { | ||
} | ||
// | ||
else if (event == "onRewardedVideoAdPreloaded") { | ||
if (self.onRewardedVideoAdPreloaded) | ||
self.onRewardedVideoAdPreloaded(); | ||
} | ||
else if (event == "onRewardedVideoAdLoaded") { | ||
self._loadedRewardedVideoAd = true; | ||
if (self.onRewardedVideoAdLoaded) | ||
self.onRewardedVideoAdLoaded(); | ||
} | ||
else if (event == "onRewardedVideoAdShown") { | ||
self._loadedRewardedVideoAd = false; | ||
self._isShowingRewardedVideoAd = true; | ||
if (self.onRewardedVideoAdShown) | ||
self.onRewardedVideoAdShown(); | ||
} | ||
else if (event == "onRewardedVideoAdHidden") { | ||
self._isShowingRewardedVideoAd = false; | ||
if (self.onRewardedVideoAdHidden) | ||
self.onRewardedVideoAdHidden(); | ||
} | ||
else if (event == "onRewardedVideoAdCompleted") { | ||
if (self.onRewardedVideoAdCompleted) | ||
self.onRewardedVideoAdCompleted(); | ||
} | ||
} | ||
@@ -112,3 +147,3 @@ else { | ||
'setUp', | ||
[bannerAdUnit, interstitialAdUnit, isOverlap, isTest] | ||
[bannerAdUnit, interstitialAdUnit, rewardedVideoAdUnit, isOverlap, isTest] | ||
); | ||
@@ -198,2 +233,21 @@ }, | ||
); | ||
}, | ||
// | ||
preloadRewardedVideoAd: function() { | ||
cordova.exec( | ||
null, | ||
null, | ||
'AdMobPlugin', | ||
'preloadRewardedVideoAd', | ||
[] | ||
); | ||
}, | ||
showRewardedVideoAd: function() { | ||
cordova.exec( | ||
null, | ||
null, | ||
'AdMobPlugin', | ||
'showRewardedVideoAd', | ||
[] | ||
); | ||
}, | ||
@@ -211,2 +265,5 @@ loadedBannerAd: function() { | ||
}, | ||
loadedRewardedVideoAd: function() { | ||
return this._loadedRewardedVideoAd; | ||
}, | ||
isShowingBannerAd: function() { | ||
@@ -223,2 +280,5 @@ return this._isShowingBannerAd; | ||
}, | ||
isShowingRewardedVideoAd: function() { | ||
return this._isShowingRewardedVideoAd; | ||
}, | ||
onBannerAdPreloaded: null, | ||
@@ -239,3 +299,9 @@ onBannerAdLoaded: null, | ||
onInterstitialAdShown: null, | ||
onInterstitialAdHidden: null | ||
onInterstitialAdHidden: null, | ||
// | ||
onRewardedVideoAdPreloaded: null, | ||
onRewardedVideoAdLoaded: null, | ||
onRewardedVideoAdShown: null, | ||
onRewardedVideoAdHidden: null, | ||
onRewardedVideoAdCompleted: null | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6016538
41
575
409