chocolateplatform-plugin-cordova
Advanced tools
+1
-1
| { | ||
| "name": "chocolateplatform-plugin-cordova", | ||
| "version": "1.0.7", | ||
| "version": "1.0.8", | ||
| "description": "A plugin to enable chocolateplatform ads to be displayed in cordova apps.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
+1
-1
| <?xml version='1.0' encoding='utf-8'?> | ||
| <plugin id="com.chocolateplatform.plugin.cordova" version="1.0.7" | ||
| <plugin id="com.chocolateplatform.plugin.cordova" version="1.0.8" | ||
| xmlns="http://apache.org/cordova/ns/plugins/1.0" | ||
@@ -4,0 +4,0 @@ xmlns:android="http://schemas.android.com/apk/res/android"> |
+58
-335
@@ -6,17 +6,11 @@ | ||
| // FOR INVIEW AD | ||
| _inviewAdContainer : null, | ||
| _inviewDivId : "target_div_id", | ||
| initWithAPIKey: function(apikey) { | ||
| cordova.exec(function(result) {},function(result) {}, | ||
| "vdopiaPlugin", | ||
| 'initWithAPIKey', | ||
| [{"apikey":apikey}] | ||
| ); | ||
| }, | ||
| // FOR PREROLL AD | ||
| _prerollAdWidth : null, | ||
| _prerollAdHeight : null, | ||
| _prerollAdContainer : null, | ||
| _prerollAdVideoElement : null, | ||
| _partnerCount : 0, | ||
| _totalFailedPartner : 0, | ||
| //////////////SET TARGETING PARAMETERS////////////// | ||
| setDemographics: function(age, birthDate, gender, maritalStatus, | ||
@@ -36,3 +30,3 @@ ethnicity){ | ||
| }, | ||
| setLocation: function(dmaCode, postal, curPostal, latitude, longitude) { | ||
@@ -51,34 +45,6 @@ cordova.exec(function(result) {},function(result) {}, | ||
| }, | ||
| // setAdRequestUserParams : function(age, birthDate, gender, maritalStatus, | ||
| // ethnicity, dmaCode, postal, curPostal, latitude, longitude) { | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'setUserParameters', | ||
| // [{ | ||
| // "AGE":age, | ||
| // "BIRTHDATE":birthDate, | ||
| // "GENDER":gender, | ||
| // "MARITALSTATUS":maritalStatus, | ||
| // "ETHNICITY":ethnicity, | ||
| // "DMACODE":dmaCode, | ||
| // "POSTAL":postal, | ||
| // "CURPOSTAL":curPostal, | ||
| // "LATITUDE":latitude, | ||
| // "LONGITUDE":longitude | ||
| // }] | ||
| // ); | ||
| // }, | ||
| setAppInfo : function(appName, pubName, appDomain, pubDomain, storeUrl, iabCategory) { | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| cordova.exec(function(result) {},function(result) {}, | ||
| "vdopiaPlugin", | ||
@@ -96,7 +62,5 @@ 'setAppInfo', | ||
| }, | ||
| setCoppaStatus : function(status) { | ||
| cordova.exec( | ||
| function(result){}, | ||
| function(result){}, | ||
| cordova.exec(function(result){},function(result){}, | ||
| "vdopiaPlugin", | ||
@@ -107,7 +71,5 @@ 'setCoppaStatus', | ||
| }, | ||
| setPrivacySettings: function(gdprApplies,gdprConsentString) { | ||
| cordova.exec( | ||
| function(result){}, | ||
| function(result){}, | ||
| cordova.exec(function(result){},function(result){}, | ||
| "vdopiaPlugin", | ||
@@ -120,122 +82,28 @@ 'setPrivacySettings', | ||
| ); | ||
| } | ||
| }, | ||
| showAlert : function(message,title,cancleButtonText,confirmButtonText) | ||
| { | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| "vdopiaPlugin", | ||
| 'showRewardAdAlertView', | ||
| [{ | ||
| "MESSAGE":message, | ||
| "TITLE":title, | ||
| "CANCLEBUTTONTITLE":cancleButtonText, | ||
| "CONFIRMBUTTONTITLE":confirmButtonText | ||
| }] | ||
| ); | ||
| }, | ||
| // showAlert : function(message,title,cancleButtonText,confirmButtonText) | ||
| // { | ||
| // cordova.exec(function(result) {},function(result) {}, | ||
| // "vdopiaPlugin", | ||
| // 'showRewardAdAlertView', | ||
| // [{ | ||
| // "MESSAGE":message, | ||
| // "TITLE":title, | ||
| // "CANCLEBUTTONTITLE":cancleButtonText, | ||
| // "CONFIRMBUTTONTITLE":confirmButtonText | ||
| // }] | ||
| // ); | ||
| // }, | ||
| registerAlertEvents : function() { | ||
| document.addEventListener('showRewardAdConfirmationCallback', function() { | ||
| showRewardAd(); | ||
| }); | ||
| }, | ||
| // registerAlertEvents : function() { | ||
| // document.addEventListener('showRewardAdConfirmationCallback', function() { | ||
| // showRewardAd(); | ||
| // }); | ||
| // }, | ||
| // //////////////SHOW NATIVE AD////////////// | ||
| // showInviewAdFromSDK : function(apikey, inviewDiv) { | ||
| // | ||
| // _inviewAdContainer = inviewDiv; | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'loadNativeAd', | ||
| // [{"apikey":apikey}] | ||
| // ); | ||
| // }, | ||
| // | ||
| // registerInviewAdEvents : function() { | ||
| // | ||
| // document.addEventListener('onBannerAdClicked', function() { | ||
| // inViewAdEvent('onBannerAdClicked') | ||
| // }); | ||
| // | ||
| // document.addEventListener('onBannerAdFailed', function() { | ||
| // inViewAdEvent('onBannerAdFailed') | ||
| // }); | ||
| // | ||
| // document.addEventListener('onBannerAdLoaded', function() { | ||
| // inViewAdEvent('onBannerAdLoaded') | ||
| // }); | ||
| // | ||
| // document.addEventListener('VdoAdEvent', function(e) { | ||
| // if (e.eventStatus === "click") { | ||
| // | ||
| // var e = new CustomEvent('onBannerAdClicked', { detail: "Ad Clicked" }); | ||
| // document.dispatchEvent(e); | ||
| // | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'fireTracker', | ||
| // [{"tracker":"click"}] | ||
| // ); | ||
| // } else if (e.eventStatus === "ad_unavailable") { | ||
| // var e = new CustomEvent('onBannerAdFailed', { detail: "Ad Unavailable" }); | ||
| // document.dispatchEvent(e); | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'fireTracker', | ||
| // [{"tracker":"ui"}] | ||
| // ); | ||
| // } else if (e.eventStatus === "impression") { | ||
| // | ||
| // var e = new CustomEvent('onBannerAdLoaded', { detail: "Ad Available" }); | ||
| // document.dispatchEvent(e); | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'fireTracker', | ||
| // [{"tracker":"impression"}] | ||
| // ); | ||
| // } | ||
| // }, false); | ||
| // }, | ||
| // | ||
| // loadInviewAdInDiv : function(url) { | ||
| // | ||
| // url = url + "&" + _inviewDivId + "=" + _inviewAdContainer; | ||
| // | ||
| // $.getScript(url) | ||
| // .done(function(script, textStatus) { | ||
| // }) | ||
| // .fail(function(jqxhr, settings, exception) { | ||
| // }); | ||
| // }, | ||
| //////////////SHOW INTERSTITIAL AD////////////// | ||
| loadInterstitialAd : function(apikey) { | ||
| _interstitialAdLoaded = false; | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| cordova.exec(function(result) {},function(result) {}, | ||
| "vdopiaPlugin", | ||
@@ -248,8 +116,3 @@ 'loadInterstitialAd', | ||
| showInterstitialAd : function() { | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| cordova.exec(function(result) {},function(result) {}, | ||
| "vdopiaPlugin", | ||
@@ -261,5 +124,5 @@ 'showInterstitialAd', | ||
| registerInterstitialAdEvents : function() { | ||
| registerInterstitialAdEvents : function(listener) { | ||
| document.addEventListener('onInterstitialLoaded', function() { | ||
| interstitialAdEvent('onInterstitialLoaded') | ||
| listener.interstitialAdEvent('onInterstitialLoaded') | ||
| _interstitialAdLoaded = true; | ||
@@ -269,15 +132,15 @@ }); | ||
| document.addEventListener('onInterstitialFailed', function(data) { | ||
| interstitialAdEvent('onInterstitialFailed') | ||
| listener.interstitialAdEvent('onInterstitialFailed') | ||
| }); | ||
| document.addEventListener('onInterstitialShown', function() { | ||
| interstitialAdEvent('onInterstitialShown') | ||
| listener.interstitialAdEvent('onInterstitialShown') | ||
| }); | ||
| document.addEventListener('onInterstitialDismissed', function() { | ||
| interstitialAdEvent('onInterstitialDismissed') | ||
| listener.interstitialAdEvent('onInterstitialDismissed') | ||
| }); | ||
| document.addEventListener('onInterstitialClicked', function() { | ||
| interstitialAdEvent('onInterstitialClicked') | ||
| listener.interstitialAdEvent('onInterstitialClicked') | ||
| }); | ||
@@ -289,10 +152,4 @@ }, | ||
| loadRewardAd : function(apikey, showAuto) { | ||
| _rewardAdLoaded = false; | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| cordova.exec(function(result) {},function(result) {}, | ||
| "vdopiaPlugin", | ||
@@ -304,174 +161,40 @@ 'loadRewardAd', | ||
| showRewardAd : function(rewardAmount,RewardName,rewardUserID,rewardSecretKey) { | ||
| cordova.exec( | ||
| function(result) { | ||
| }, | ||
| function(result) { | ||
| }, | ||
| showRewardAd : function(rewardAmount,RewardName, | ||
| rewardUserID,rewardSecretKey) { | ||
| cordova.exec(function(result) {}, | ||
| function(result) {}, | ||
| "vdopiaPlugin", | ||
| 'showRewardAd',[{"REWARD_AMOUNT":rewardAmount,"REWARD_NAME":RewardName,"REWARD_USER_ID":rewardUserID,"REWARD_SECRET_KEY":rewardSecretKey}] | ||
| 'showRewardAd',[ | ||
| {"REWARD_AMOUNT":rewardAmount, | ||
| "REWARD_NAME":RewardName, | ||
| "REWARD_USER_ID":rewardUserID, | ||
| "REWARD_SECRET_KEY":rewardSecretKey}] | ||
| ); | ||
| }, | ||
| registerRewardAdEvents : function() { | ||
| registerRewardAdEvents : function(listener) { | ||
| document.addEventListener('rewardedVideoDidLoadAd', function() { | ||
| rewardedAdEvent('rewardedVideoDidLoadAd'); | ||
| _rewardAdLoaded = true; | ||
| listener.rewardedAdEvent('rewardedVideoDidLoadAd'); | ||
| _rewardAdLoaded = true; | ||
| }); | ||
| document.addEventListener('rewardAdFailedWithError', function(data) { | ||
| rewardedAdEvent('rewardAdFailedWithError'); | ||
| listener.rewardedAdEvent('rewardAdFailedWithError'); | ||
| }); | ||
| document.addEventListener('rewardedVideoDidFinish', function() { | ||
| rewardedAdEvent('rewardedVideoDidFinish'); | ||
| listener.rewardedAdEvent('rewardedVideoDidFinish'); | ||
| }); | ||
| document.addEventListener('rewardedVideoDidStartVideo', function() { | ||
| rewardedAdEvent('rewardedVideoDidStartVideo'); | ||
| listener.rewardedAdEvent('rewardedVideoDidStartVideo'); | ||
| }); | ||
| document.addEventListener('rewardedVideoDidFailToStartVideoWithError', function() { | ||
| rewardedAdEvent('rewardedVideoDidFailToStartVideoWithError'); | ||
| listener.rewardedAdEvent('rewardedVideoDidFailToStartVideoWithError'); | ||
| }); | ||
| document.addEventListener('rewardedVideoWillDismiss', function() { | ||
| rewardedAdEvent('rewardedVideoWillDismiss'); | ||
| listener.rewardedAdEvent('rewardedVideoWillDismiss'); | ||
| }); | ||
| }//, | ||
| // //////////////SHOW PREROLL AD////////////// | ||
| // showPrerollAdFromSDK : function(apikey, width, height, adDiv, videoElement) { | ||
| // _prerollAdWidth = width; | ||
| // _prerollAdHeight = height; | ||
| // _prerollAdContainer = adDiv; | ||
| // _prerollAdVideoElement = videoElement; | ||
| // | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'loadPrerollad', | ||
| // [{"apikey":apikey, "width":_prerollAdWidth, "height":_prerollAdHeight}] | ||
| // ); | ||
| // }, | ||
| // | ||
| // prerollAdFailedFromSDK : function(error) { | ||
| // _prerollAdVideoElement.play(); | ||
| // }, | ||
| // | ||
| // loadPrerollAdInDiv : function(urls) { | ||
| // urls = JSON.parse(urls); | ||
| // _partnerCount = urls.length; | ||
| // _totalFailedPartner = 0; | ||
| // | ||
| // for(var url in urls) { | ||
| // | ||
| // if (urls[url].indexOf("caller=vdosdk") != -1) { | ||
| // | ||
| // new sdk_chocolate( | ||
| // "chocolate", | ||
| // urls[url], | ||
| // _prerollAdContainer, _prerollAdVideoElement, | ||
| // _prerollAdWidth, _prerollAdHeight, | ||
| // onAdEventVdopia); | ||
| // } else { | ||
| // setupIMA( | ||
| // "google", | ||
| // urls[url], | ||
| // _prerollAdContainer, _prerollAdVideoElement, | ||
| // _prerollAdWidth, _prerollAdWidth); | ||
| // } | ||
| // } | ||
| // }, | ||
| // vdopiaEvent : null, //This variable is required to save the function which start the Ad after mediation | ||
| // onAdEventVdopia : function(event) { | ||
| // console.log("Preroll Event Fired : " + event.type); | ||
| // if (event.type == "AdLoaded") { | ||
| // vdopiaEvent = event.startAd;//Save function to start the AD in above created variable | ||
| // prerollAdEventFromJSPlayer("chocolate","AdLoaded") | ||
| // } else if (event.type == "AdError") { | ||
| // prerollAdEventFromJSPlayer("chocolate","AdError") | ||
| // } else if (event.type == "AdEnded") { | ||
| // prerollAdEventFromJSPlayer("chocolate","AdEnded") | ||
| // } else if (event.type == "AdClicked") { | ||
| // prerollAdEventFromJSPlayer("chocolate","AdClicked") | ||
| // } | ||
| // }, | ||
| // | ||
| // prerollAdEventFromJSPlayer : function(partner, event) { | ||
| // | ||
| // if (event === "AdLoaded") | ||
| // { | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'prerolAdLoad', | ||
| // [{"partner":partner}] | ||
| // ); | ||
| // } | ||
| // else if (event === "AdError") | ||
| // { | ||
| // _totalFailedPartner++; | ||
| // | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'prerolAdFail', | ||
| // [{"partner":partner}] | ||
| // ); | ||
| // | ||
| // if (_totalFailedPartner == _partnerCount) { | ||
| // prerollAdEvent("onPrerollAdFailed"); | ||
| // playMainContent(); | ||
| // } | ||
| // | ||
| // } else if (event === "AdClicked") { | ||
| // | ||
| // prerollAdEvent("onPrerollAdClicked"); | ||
| // | ||
| // cordova.exec( | ||
| // function(result) { | ||
| // }, | ||
| // function(result) { | ||
| // }, | ||
| // "vdopiaPlugin", | ||
| // 'prerollAdClickedEvent', | ||
| // [{"partner":partner}] | ||
| // ); | ||
| // | ||
| // } else if (event === "AdEnded") { | ||
| // prerollAdEvent("onPrerollAdEnded"); | ||
| // playMainContent(); | ||
| // } | ||
| // }, | ||
| // | ||
| // | ||
| // showPrerollAdInDiv : function(partner) { | ||
| // | ||
| // prerollAdEvent("onPrerollAdLoaded"); | ||
| // | ||
| // if (partner.toLowerCase() === "google") { | ||
| // playAds(); | ||
| // } else { | ||
| // if (vdopiaEvent) { | ||
| // vdopiaEvent(); | ||
| // } | ||
| // } | ||
| // }, | ||
| // | ||
| // playMainContent : function() { | ||
| // _prerollAdContainer.style.display = "none"; | ||
| // _prerollAdVideoElement.load(); | ||
| // _prerollAdVideoElement.play(); | ||
| // } | ||
| }; |
@@ -14,2 +14,4 @@ // | ||
| // This will accept a String and call setFileContents to persist the String on to disk | ||
| - (void) initWithAPIKey:(CDVInvokedUrlCommand *)command; | ||
| - (void) loadInterstitialAd:(CDVInvokedUrlCommand *)command; | ||
@@ -16,0 +18,0 @@ - (void) showInterstitialAd:(CDVInvokedUrlCommand *)command; |
@@ -69,2 +69,10 @@ // | ||
| - (void) initWithAPIKey:(CDVInvokedUrlCommand *)command { | ||
| NSString * apiKey = [[command.arguments objectAtIndex:0] valueForKey:API_KEY]; | ||
| if (apiKey && [apiKey length] > 0) { | ||
| [ChocolatePlatform initWithAdUnitID:apiKey]; | ||
| } | ||
| } | ||
| - (void) setDemographics:(CDVInvokedUrlCommand*)command { | ||
@@ -206,3 +214,3 @@ NSDictionary* dict = [command.arguments objectAtIndex:0]; | ||
| NSNumber *cpVal = [command.arguments objectAtIndex:0]; | ||
| [ChocolatePlatform setCoppaStatus:[cpVal boolValue]]; | ||
| [[ChocolatePlatform privacySettings] setCoppaEnabled:[cpVal boolValue]]; | ||
| } | ||
@@ -209,0 +217,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
158956
-4.85%836
-24%