cordova-plugin-appsflyer-sdk
Advanced tools
Comparing version 6.15.0-rc1 to 6.15.0-rc3
{ | ||
"name": "cordova-plugin-appsflyer-sdk", | ||
"version": "6.15.0-rc1", | ||
"version": "6.15.0-rc3", | ||
"description": "Cordova AppsFlyer SDK Plugin", | ||
@@ -53,1 +54,2 @@ "cordova": { | ||
} | ||
@@ -6,4 +6,2 @@ var exec = require('cordova/exec'), | ||
let AFAdRevenueData; | ||
if (!window.CustomEvent) { | ||
@@ -17,3 +15,25 @@ window.CustomEvent = function (type, config) { | ||
(function (global) { | ||
// Enum definition for MediationNetwork | ||
global.MediationNetwork = Object.freeze({ | ||
IRONSOURCE: "ironsource", | ||
APPLOVIN_MAX: "applovinmax", | ||
GOOGLE_ADMOB: "googleadmob", | ||
FYBER: "fyber", | ||
APPODEAL: "appodeal", | ||
ADMOST: "Admost", | ||
TOPON: "Topon", | ||
TRADPLUS: "Tradplus", | ||
YANDEX: "Yandex", | ||
CHARTBOOST: "chartboost", | ||
UNITY: "Unity", | ||
TOPON_PTE: "toponpte", | ||
CUSTOM_MEDIATION: "customMediation", | ||
DIRECT_MONETIZATION_NETWORK: "directMonetizationNetwork" | ||
}); | ||
var AppsFlyer = function () { | ||
@@ -44,41 +64,3 @@ }; | ||
// AFAdRevenueData object with MediationNetwork enum | ||
global.AFAdRevenueData = (function() { | ||
const MediationNetwork = { | ||
IRONSOURCE:"ironsource", | ||
APPLOVIN_MAX:"applovinmax", | ||
GOOGLE_ADMOB:"googleadmob", | ||
FYBER:"fyber", | ||
APPODEAL:"appodeal", | ||
ADMOST:"Admost", | ||
TOPON:"Topon", | ||
TRADPLUS:"Tradplus", | ||
YANDEX:"Yandex", | ||
CHARTBOOST:"chartboost", | ||
UNITY:"Unity", | ||
TOPON_PTE:"toponpte", | ||
CUSTOM_MEDIATION:"customMediation", | ||
DIRECT_MONETIZATION_NETWORK:"directMonetizationNetwork" | ||
}; | ||
function AFAdRevenueData(monetizationNetwork, mediationNetwork, currencyIso4217Code, revenue) { | ||
if (!Object.values(MediationNetwork).includes(mediationNetwork)) { | ||
throw new Error("Invalid enum value for 'mediationNetwork'."); | ||
} | ||
this.monetizationNetwork = monetizationNetwork; | ||
this.mediationNetwork = mediationNetwork; | ||
this.currencyIso4217Code = currencyIso4217Code; | ||
this.revenue = revenue; | ||
} | ||
return AFAdRevenueData; // Expose the constructor directly | ||
})(); | ||
function validateAFAdRevenueData(afAdRevenueData) { | ||
if (!(afAdRevenueData instanceof AFAdRevenueData)) { | ||
throw new Error("Invalid AFAdRevenueData object."); | ||
} | ||
return afAdRevenueData; | ||
} | ||
/** | ||
@@ -160,9 +142,4 @@ * initialize the SDK. | ||
AppsFlyer.prototype.logAdRevenue = function(afAdRevenueData, additionalParameters) { | ||
argscheck.checkArgs('S', 'AppsFlyer.logAdRevenue', arguments); | ||
// Validate AFAdRevenueData before logging | ||
const validatedAfAdRevenueData = validateAFAdRevenueData(afAdRevenueData); | ||
// Call the 'logAdRevenue' API method with the validated data | ||
exec(null, null, 'AppsFlyerPlugin', 'logAdRevenue', [validatedAfAdRevenueData, additionalParameters]); | ||
argscheck.checkArgs('OO', 'AppsFlyer.logAdRevenue', arguments); | ||
exec(null, null, 'AppsFlyerPlugin', 'logAdRevenue', [afAdRevenueData, additionalParameters]); | ||
}; | ||
@@ -169,0 +146,0 @@ |
@@ -1,3 +0,1 @@ | ||
module.exports = Object.freeze({ | ||
@@ -4,0 +2,0 @@ INVALID_ARGUMENT_ERROR: "INVALID ARGUMENT ERROR", |
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
398867
49
910