@purchasely/cordova-plugin-purchasely 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/VERSIONS.md CHANGED
@@ -17,4 +17,5 @@ This file provides the underlying native SDK versions that the Cordova SDK relie
17
17
  | 2.0.0 | 3.0.0 | 3.0.1 |
18
18
  | 2.0.1 | 3.0.0 | 3.0.1 |
19
19
  | 2.1.0 | 3.1.0 | 3.1.0 |
20
- | 2.1.1 | 3.1.0 | 3.1.0 |
20
+ | 2.1.1 | 3.1.0 | 3.1.0 |
21
+ | 2.2.0 | 3.2.0 | 3.2.0 |
@@ -9,16 +9,14 @@
9
9
  "version": "1.0.0",
10
10
  "license": "Apache-2.0",
11
11
  "devDependencies": {
12
- "@purchasely/cordova-plugin-purchasely": "file:..",
13
12
  "cordova-android": "^10.1.0",
14
13
  "cordova-ios": "^6.2.0",
15
- "cordova-plugin-purchasely": "file:..",
16
- "cordova-plugin-whitelist": "^1.3.5"
14
+ "cordova-plugin-purchasely": "file:.."
17
15
  }
18
16
  },
19
17
  "..": {
20
18
  "name": "cordova-plugin-purchasely",
21
- "version": "2.0.1",
19
+ "version": "2.2.0",
22
20
  "dev": true,
23
21
  "license": "ISC"
24
22
  },
@@ -68,10 +66,6 @@
68
66
  "node": ">= 8"
69
67
  }
70
68
  },
71
- "node_modules/@purchasely/cordova-plugin-purchasely": {
72
- "resolved": "..",
73
- "link": true
74
- },
75
69
  "node_modules/abbrev": {
76
70
  "version": "1.1.1",
77
71
  "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@@ -227,9 +221,9 @@
227
221
  }
228
222
  },
229
223
  "node_modules/cordova-android/node_modules/fs-extra": {
230
- "version": "10.0.0",
231
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
232
- "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
224
+ "version": "10.0.1",
225
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz",
226
+ "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==",
233
227
  "dev": true,
234
228
  "dependencies": {
235
229
  "graceful-fs": "^4.2.0",
@@ -290,22 +284,6 @@
290
284
  "resolved": "..",
291
285
  "link": true
292
286
  },
293
- "node_modules/cordova-plugin-whitelist": {
294
- "version": "1.3.5",
295
- "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz",
296
- "integrity": "sha512-+v/VzCYBdGsIxJTP2m+RWaq7l/NLu7b976w6XGJUFiN2TVOeaGrytaR4jRy0w9akRai8uKFeBmuGHmlS/sOeCA==",
297
- "dev": true,
298
- "engines": {
299
- "cordovaDependencies": {
300
- "0.0.0": {
301
- "cordova-android": ">=4.0.0"
302
- },
303
- "1.3.5": {
304
- "cordova-android": ">=4.0.0 <10.0.0"
305
- }
306
- }
307
- }
308
- },
309
287
  "node_modules/cross-spawn": {
310
288
  "version": "7.0.3",
311
289
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -855,9 +833,9 @@
855
833
  }
856
834
  },
857
835
  "node_modules/plist": {
858
- "version": "3.0.4",
859
- "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.4.tgz",
860
- "integrity": "sha512-ksrr8y9+nXOxQB2osVNqrgvX/XQPOXaU4BQMKjYq8PvaY1U18mo+fKgBSwzK+luSyinOuPae956lSVcBwxlAMg==",
836
+ "version": "3.0.5",
837
+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz",
838
+ "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==",
861
839
  "dev": true,
862
840
  "dependencies": {
863
841
  "base64-js": "^1.5.1",
@@ -1044,15 +1022,15 @@
1044
1022
  }
1045
1023
  },
1046
1024
  "node_modules/signal-exit": {
1047
- "version": "3.0.6",
1048
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
1049
- "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==",
1025
+ "version": "3.0.7",
1026
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
1027
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
1050
1028
  "dev": true
1051
1029
  },
1052
1030
  "node_modules/simctl": {
1053
- "version": "2.0.1",
1054
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.1.tgz",
1055
- "integrity": "sha512-RVZ/iLCI/rRmo8JKwtKjtWDzZFp+wOxI8L6+ux8UMPCC4LuujwrT4S7U3Y7eQKa8mHup3HSZoPzLrr1CR9Dttg==",
1031
+ "version": "2.0.3",
1032
+ "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.3.tgz",
1033
+ "integrity": "sha512-kKCak0yszxHae5eVWcmrjV3ouUGac3sjlhjdLWpyPu4eiQcWoHsCrqS34kkgzHN8Ystqkh/LFjzrldk/g3BYJg==",
1056
1034
  "dev": true,
1057
1035
  "dependencies": {
1058
1036
  "shelljs": "^0.8.5",
@@ -1060,20 +1038,20 @@
1060
1038
  }
1061
1039
  },
1062
1040
  "node_modules/simple-plist": {
1063
- "version": "1.3.0",
1064
- "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.0.tgz",
1065
- "integrity": "sha512-uYWpeGFtZtVt2NhG4AHgpwx323zxD85x42heMJBan1qAiqqozIlaGrwrEt6kRjXWRWIXsuV1VLCvVmZan2B5dg==",
1041
+ "version": "1.3.1",
1042
+ "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
1043
+ "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
1066
1044
  "dev": true,
1067
1045
  "dependencies": {
1068
1046
  "bplist-creator": "0.1.0",
1069
- "bplist-parser": "0.3.0",
1070
- "plist": "^3.0.4"
1047
+ "bplist-parser": "0.3.1",
1048
+ "plist": "^3.0.5"
1071
1049
  }
1072
1050
  },
1073
1051
  "node_modules/simple-plist/node_modules/bplist-parser": {
1074
- "version": "0.3.0",
1075
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz",
1076
- "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==",
1052
+ "version": "0.3.1",
1053
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
1054
+ "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
1077
1055
  "dev": true,
1078
1056
  "dependencies": {
1079
1057
  "big-integer": "1.6.x"
@@ -1298,9 +1276,6 @@
1298
1276
  "fastq": "^1.6.0"
1299
1277
  }
1300
1278
  },
1301
- "@purchasely/cordova-plugin-purchasely": {
1302
- "version": "file:.."
1303
- },
1304
1279
  "abbrev": {
1305
1280
  "version": "1.1.1",
1306
1281
  "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@@ -1423,9 +1398,9 @@
1423
1398
  },
1424
1399
  "dependencies": {
1425
1400
  "fs-extra": {
1426
- "version": "10.0.0",
1427
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
1428
- "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
1401
+ "version": "10.0.1",
1402
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz",
1403
+ "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==",
1429
1404
  "dev": true,
1430
1405
  "requires": {
1431
1406
  "graceful-fs": "^4.2.0",
@@ -1478,12 +1453,6 @@
1478
1453
  "cordova-plugin-purchasely": {
1479
1454
  "version": "file:.."
1480
1455
  },
1481
- "cordova-plugin-whitelist": {
1482
- "version": "1.3.5",
1483
- "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz",
1484
- "integrity": "sha512-+v/VzCYBdGsIxJTP2m+RWaq7l/NLu7b976w6XGJUFiN2TVOeaGrytaR4jRy0w9akRai8uKFeBmuGHmlS/sOeCA==",
1485
- "dev": true
1486
- },
1487
1456
  "cross-spawn": {
1488
1457
  "version": "7.0.3",
1489
1458
  "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -1901,9 +1870,9 @@
1901
1870
  "dev": true
1902
1871
  },
1903
1872
  "plist": {
1904
- "version": "3.0.4",
1905
- "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.4.tgz",
1906
- "integrity": "sha512-ksrr8y9+nXOxQB2osVNqrgvX/XQPOXaU4BQMKjYq8PvaY1U18mo+fKgBSwzK+luSyinOuPae956lSVcBwxlAMg==",
1873
+ "version": "3.0.5",
1874
+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz",
1875
+ "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==",
1907
1876
  "dev": true,
1908
1877
  "requires": {
1909
1878
  "base64-js": "^1.5.1",
@@ -2018,15 +1987,15 @@
2018
1987
  }
2019
1988
  },
2020
1989
  "signal-exit": {
2021
- "version": "3.0.6",
2022
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz",
2023
- "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==",
1990
+ "version": "3.0.7",
1991
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
1992
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
2024
1993
  "dev": true
2025
1994
  },
2026
1995
  "simctl": {
2027
- "version": "2.0.1",
2028
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.1.tgz",
2029
- "integrity": "sha512-RVZ/iLCI/rRmo8JKwtKjtWDzZFp+wOxI8L6+ux8UMPCC4LuujwrT4S7U3Y7eQKa8mHup3HSZoPzLrr1CR9Dttg==",
1996
+ "version": "2.0.3",
1997
+ "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.3.tgz",
1998
+ "integrity": "sha512-kKCak0yszxHae5eVWcmrjV3ouUGac3sjlhjdLWpyPu4eiQcWoHsCrqS34kkgzHN8Ystqkh/LFjzrldk/g3BYJg==",
2030
1999
  "dev": true,
2031
2000
  "requires": {
2032
2001
  "shelljs": "^0.8.5",
@@ -2034,20 +2003,20 @@
2034
2003
  }
2035
2004
  },
2036
2005
  "simple-plist": {
2037
- "version": "1.3.0",
2038
- "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.0.tgz",
2039
- "integrity": "sha512-uYWpeGFtZtVt2NhG4AHgpwx323zxD85x42heMJBan1qAiqqozIlaGrwrEt6kRjXWRWIXsuV1VLCvVmZan2B5dg==",
2006
+ "version": "1.3.1",
2007
+ "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
2008
+ "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
2040
2009
  "dev": true,
2041
2010
  "requires": {
2042
2011
  "bplist-creator": "0.1.0",
2043
- "bplist-parser": "0.3.0",
2044
- "plist": "^3.0.4"
2012
+ "bplist-parser": "0.3.1",
2013
+ "plist": "^3.0.5"
2045
2014
  },
2046
2015
  "dependencies": {
2047
2016
  "bplist-parser": {
2048
- "version": "0.3.0",
2049
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz",
2050
- "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==",
2017
+ "version": "0.3.1",
2018
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
2019
+ "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
2051
2020
  "dev": true,
2052
2021
  "requires": {
2053
2022
  "big-integer": "1.6.x"
@@ -13,15 +13,12 @@
13
13
  "author": "Apache Cordova Team",
14
14
  "license": "Apache-2.0",
15
15
  "devDependencies": {
16
- "@purchasely/cordova-plugin-purchasely": "file:..",
17
16
  "cordova-android": "^10.1.0",
18
17
  "cordova-ios": "^6.2.0",
19
- "cordova-plugin-purchasely": "file:..",
20
- "cordova-plugin-whitelist": "^1.3.5"
18
+ "cordova-plugin-purchasely": "file:.."
21
19
  },
22
20
  "cordova": {
23
21
  "plugins": {
24
- "cordova-plugin-whitelist": {},
25
22
  "cordova-plugin-purchasely": {}
26
23
  },
27
24
  "platforms": [
@@ -156,10 +156,10 @@ function onPuchaselySdkReady() {
156
156
  }
157
157
 
158
158
  function openPresentation() {
159
- Purchasely.presentPresentationWithIdentifier(
160
- null,
161
- null,
162
- true,
159
+ Purchasely.presentPresentationForPlacement(
160
+ 'onboarding', //placementId
161
+ null, //contentId
162
+ true, //fullscreen
163
163
  (callback) => {
164
164
  console.log(callback);
165
165
  if(callback.result == Purchasely.PurchaseResult.CANCELLED) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purchasely/cordova-plugin-purchasely",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Purchasely is a solution to ease the integration and boost your In-App Purchases & Subscriptions on the App Store, Google Play Store, Amazon Appstore and Huawei App Gallery.",
5
5
  "cordova": {
6
6
  "id": "@purchasely/cordova-plugin-purchasely",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@purchasely/cordova-plugin-purchasely" version="2.1.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <plugin id="@purchasely/cordova-plugin-purchasely" version="2.2.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
3
3
  <name>Purchasely</name>
4
4
  <js-module name="Purchasely" src="www/Purchasely.js">
5
5
  <clobbers target="Purchasely" />
@@ -28,7 +28,7 @@
28
28
  <source url="https://github.com/CocoaPods/Specs.git"/>
29
29
  </config>
30
30
  <pods use-frameworks="true">
31
- <pod name="Purchasely" spec="3.1.0"/>
31
+ <pod name="Purchasely" spec="3.2.0"/>
32
32
  </pods>
33
33
  </podspec>
34
34
  </platform>
@@ -51,7 +51,7 @@
51
51
  android:theme="@style/Theme.AppCompat.Light.NoActionBar">
52
52
  </activity>
53
53
  </config-file>
54
- <framework src="io.purchasely:core:3.1.0" />
54
+ <framework src="io.purchasely:core:3.2.0" />
55
55
  <source-file src="src/android/PurchaselyPlugin.java" target-dir="src/cordova/plugin/purchasely" />
56
56
  <source-file src="src/android/PLYProductActivity.java" target-dir="src/cordova/plugin/purchasely" />
57
57
  <source-file src="src/android/PLYSubscriptionsActivity.java" target-dir="src/cordova/plugin/purchasely" />
@@ -78,6 +78,7 @@ public class PurchaselyPlugin extends CordovaPlugin {
78
78
  getStringFromJson(args.getString(2)),
79
79
  args.getInt(3),
80
80
  args.getInt(4),
81
+ getStringFromJson(args.getString(5)),
81
82
  callbackContext);
82
83
  break;
83
84
  case "close":
@@ -240,6 +241,7 @@ public class PurchaselyPlugin extends CordovaPlugin {
240
241
  String userId,
241
242
  int logLevel,
242
243
  int runningMode,
244
+ String cordovaSdkVersion,
243
245
  CallbackContext callbackContext) {
244
246
  ArrayList<String> list = new ArrayList<>();
245
247
  for (int i=0; i< stores.length(); i++) {
@@ -265,6 +267,7 @@ public class PurchaselyPlugin extends CordovaPlugin {
265
267
  .logLevel(LogLevel.values()[logLevel])
266
268
  .build();
267
269
 
270
+ Purchasely.setSdkBridgeVersion(cordovaSdkVersion);
268
271
  Purchasely.setAppTechnology(PLYAppTechnology.CORDOVA);
269
272
 
270
273
  Purchasely.start((isConfigured, error) -> {
@@ -599,6 +602,8 @@ public class PurchaselyPlugin extends CordovaPlugin {
599
602
  if(info.getContentId() != null) infoMap.put("contentId", info.getContentId());
600
603
  if(info.getPresentationId() != null) infoMap.put("presentationId", info.getPresentationId());
601
604
  if(info.getPlacementId() != null) infoMap.put("placementId", info.getPlacementId());
605
+ if(info.getAbTestId() != null) infoMap.put("abTestId", info.getAbTestId());
606
+ if(info.getAbTestVariantId() != null) infoMap.put("abTestVariantId", info.getAbTestVariantId());
602
607
 
603
608
  HashMap<String, Object> resultForCordova = new HashMap<>();
604
609
  resultForCordova.put("info", infoMap);
@@ -12,12 +12,13 @@
12
12
  @implementation CDVPurchasely
13
13
 
14
14
  - (void)startWithAPIKey:(CDVInvokedUrlCommand*)command {
15
- NSString *apiKey = [command argumentAtIndex:0];
16
- NSString *userId = [command argumentAtIndex:2];
17
- NSInteger logLevel = [[command argumentAtIndex:3] intValue];
18
- NSInteger runningMode = [[command argumentAtIndex:4] intValue];
15
+ NSString *apiKey = [command argumentAtIndex:0];
16
+ NSString *userId = [command argumentAtIndex:2];
17
+ NSInteger logLevel = [[command argumentAtIndex:3] intValue];
18
+ NSInteger runningMode = [[command argumentAtIndex:4] intValue];
19
+ NSString *sdkBridgeVersion = [command argumentAtIndex:5];
19
20
 
20
- [Purchasely setAppTechnology:PLYAppTechnologyCordova];
21
+ [Purchasely setAppTechnology:PLYAppTechnologyCordova];
21
22
  [Purchasely startWithAPIKey:apiKey appUserId:userId runningMode:runningMode eventDelegate:nil uiDelegate:nil paywallActionsInterceptor:nil logLevel:logLevel initialized:^(BOOL initialized, NSError * _Nullable error) {
22
23
  if (error != nil) {
23
24
  [self failureFor:command resultString: error.localizedDescription];
@@ -28,50 +29,50 @@
28
29
  }
29
30
 
30
31
  - (void)setLogLevel:(CDVInvokedUrlCommand*)command {
31
- NSInteger logLevel = [[command argumentAtIndex:0] intValue];
32
- [Purchasely setLogLevel:logLevel];
32
+ NSInteger logLevel = [[command argumentAtIndex:0] intValue];
33
+ [Purchasely setLogLevel:logLevel];
33
34
  }
34
35
 
35
36
  - (void)userLogin:(CDVInvokedUrlCommand*)command {
36
- NSString *userId = [command argumentAtIndex:0];
37
- [Purchasely userLoginWith:userId shouldRefresh:^(BOOL refresh) {
38
- [self successFor:command resultBool:refresh];
39
- }];
37
+ NSString *userId = [command argumentAtIndex:0];
38
+ [Purchasely userLoginWith:userId shouldRefresh:^(BOOL refresh) {
39
+ [self successFor:command resultBool:refresh];
40
+ }];
40
41
  }
41
42
 
42
43
  - (void)userLogout:(CDVInvokedUrlCommand*)command {
43
- [Purchasely userLogout];
44
+ [Purchasely userLogout];
44
45
  }
45
46
 
46
47
  - (void)setAttribute:(CDVInvokedUrlCommand*)command {
47
- NSInteger attribute = [[command argumentAtIndex:0] intValue];
48
- NSString *value = [command argumentAtIndex:1];
48
+ NSInteger attribute = [[command argumentAtIndex:0] intValue];
49
+ NSString *value = [command argumentAtIndex:1];
49
50
 
50
- [Purchasely setAttribute:attribute value:value];
51
+ [Purchasely setAttribute:attribute value:value];
51
52
  }
52
53
 
53
54
  - (void)getAnonymousUserId:(CDVInvokedUrlCommand*)command {
54
- NSString *anonymousId = [Purchasely anonymousUserId];
55
- [self successFor:command resultString:anonymousId];
55
+ NSString *anonymousId = [Purchasely anonymousUserId];
56
+ [self successFor:command resultString:anonymousId];
56
57
  }
57
58
 
58
59
  - (void)isReadyToPurchase:(CDVInvokedUrlCommand*)command {
59
- BOOL isReadyToPurchase = [[command argumentAtIndex:0] boolValue];
60
- [Purchasely isReadyToPurchase: isReadyToPurchase];
60
+ BOOL isReadyToPurchase = [[command argumentAtIndex:0] boolValue];
61
+ [Purchasely isReadyToPurchase: isReadyToPurchase];
61
62
  }
62
63
 
63
64
  - (void)setDefaultPresentationResultHandler:(CDVInvokedUrlCommand*)command {
64
- [Purchasely setDefaultPresentationResultHandler:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
65
- NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
65
+ [Purchasely setDefaultPresentationResultHandler:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
66
+ NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
66
67
 
67
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:resultDict];
68
- [pluginResult setKeepCallbackAsBool:YES];
69
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
70
- }];
68
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:resultDict];
69
+ [pluginResult setKeepCallbackAsBool:YES];
70
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
71
+ }];
71
72
  }
72
73
 
73
74
  - (void)presentPresentationWithIdentifier:(CDVInvokedUrlCommand*)command {
74
- NSString *presentationVendorId = [command argumentAtIndex:0];
75
+ NSString *presentationVendorId = [command argumentAtIndex:0];
75
76
  NSString *contentId = [command argumentAtIndex:1];
76
77
  BOOL isFullscreen = [[command argumentAtIndex:2] boolValue];
77
78
 
@@ -123,15 +124,15 @@
123
124
  }
124
125
 
125
126
  - (void)presentPlanWithIdentifier:(CDVInvokedUrlCommand*)command {
126
- NSString *planVendorId = [command argumentAtIndex:0];
127
- NSString *presentationVendorId = [command argumentAtIndex:1];
127
+ NSString *planVendorId = [command argumentAtIndex:0];
128
+ NSString *presentationVendorId = [command argumentAtIndex:1];
128
129
  NSString *contentId = [command argumentAtIndex:2];
129
130
  BOOL isFullscreen = [[command argumentAtIndex:3] boolValue];
130
131
 
131
132
  UIViewController *ctrl = [Purchasely planControllerFor:planVendorId with:presentationVendorId contentId:contentId loaded:nil completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
132
- NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
133
- [self successFor:command resultDict:resultDict];
134
- }];
133
+ NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
134
+ [self successFor:command resultDict:resultDict];
135
+ }];
135
136
 
136
137
  if (ctrl != nil) {
137
138
  UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:ctrl];
@@ -150,15 +151,15 @@
150
151
  }
151
152
 
152
153
  - (void)presentProductWithIdentifier:(CDVInvokedUrlCommand*)command {
153
- NSString *productVendorId = [command argumentAtIndex:0];
154
- NSString *presentationVendorId = [command argumentAtIndex:1];
154
+ NSString *productVendorId = [command argumentAtIndex:0];
155
+ NSString *presentationVendorId = [command argumentAtIndex:1];
155
156
  NSString *contentId = [command argumentAtIndex:2];
156
157
  BOOL isFullscreen = [[command argumentAtIndex:3] boolValue];
157
158
 
158
159
  UIViewController *ctrl = [Purchasely productControllerFor:productVendorId with:presentationVendorId contentId:contentId loaded:nil completion:^(enum PLYProductViewControllerResult result, PLYPlan * _Nullable plan) {
159
- NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
160
- [self successFor:command resultDict:resultDict];
161
- }];
160
+ NSDictionary *resultDict = [self resultDictionaryForPresentationController:result plan:plan];
161
+ [self successFor:command resultDict:resultDict];
162
+ }];
162
163
 
163
164
  if (ctrl != nil) {
164
165
  UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:ctrl];
@@ -177,163 +178,163 @@
177
178
  }
178
179
 
179
180
  - (void)presentSubscriptions:(CDVInvokedUrlCommand*)command {
180
- UIViewController *ctrl = [Purchasely subscriptionsController];
181
- UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:ctrl];
182
- ctrl.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone target:navCtrl action:@selector(close)];
181
+ UIViewController *ctrl = [Purchasely subscriptionsController];
182
+ UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:ctrl];
183
+ ctrl.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone target:navCtrl action:@selector(close)];
183
184
 
184
- [Purchasely showController:navCtrl type: PLYUIControllerTypeSubscriptionList];
185
+ [Purchasely showController:navCtrl type: PLYUIControllerTypeSubscriptionList];
185
186
  }
186
187
 
187
188
  - (void)purchaseWithPlanVendorId:(CDVInvokedUrlCommand*)command {
188
- NSString *planVendorId = [command argumentAtIndex:0];
189
-
190
- [Purchasely planWith:planVendorId
191
- success:^(PLYPlan * _Nonnull plan) {
192
- [Purchasely purchaseWithPlan:plan
193
- success:^{
194
- [self successFor:command resultDict: plan.asDictionary];
195
- }
196
- failure:^(NSError * _Nonnull error) {
197
- [self failureFor:command resultString: error.localizedDescription];
198
- }];
199
- }
200
- failure:^(NSError * _Nullable error) {
201
- [self failureFor:command resultString: error.localizedDescription];
202
- }];
189
+ NSString *planVendorId = [command argumentAtIndex:0];
190
+
191
+ [Purchasely planWith:planVendorId
192
+ success:^(PLYPlan * _Nonnull plan) {
193
+ [Purchasely purchaseWithPlan:plan
194
+ success:^{
195
+ [self successFor:command resultDict: plan.asDictionary];
196
+ }
197
+ failure:^(NSError * _Nonnull error) {
198
+ [self failureFor:command resultString: error.localizedDescription];
199
+ }];
200
+ }
201
+ failure:^(NSError * _Nullable error) {
202
+ [self failureFor:command resultString: error.localizedDescription];
203
+ }];
203
204
  }
204
205
 
205
206
  - (void)restoreAllProducts:(CDVInvokedUrlCommand*)command {
206
- [Purchasely restoreAllProductsWithSuccess:^{
207
- [self successFor:command];
208
- } failure:^(NSError * _Nonnull error) {
209
- [self failureFor:command resultString:error.localizedDescription];
210
- }];
207
+ [Purchasely restoreAllProductsWithSuccess:^{
208
+ [self successFor:command];
209
+ } failure:^(NSError * _Nonnull error) {
210
+ [self failureFor:command resultString:error.localizedDescription];
211
+ }];
211
212
  }
212
213
 
213
214
  - (void)silentRestoreAllProducts:(CDVInvokedUrlCommand*)command {
214
- [Purchasely silentRestoreAllProductsWithSuccess:^{
215
- [self successFor:command];
216
- } failure:^(NSError * _Nonnull error) {
217
- [self failureFor:command resultString:error.localizedDescription];
218
- }];
215
+ [Purchasely silentRestoreAllProductsWithSuccess:^{
216
+ [self successFor:command];
217
+ } failure:^(NSError * _Nonnull error) {
218
+ [self failureFor:command resultString:error.localizedDescription];
219
+ }];
219
220
  }
220
221
 
221
222
  - (void)purchasedSubscription:(CDVInvokedUrlCommand*)command {
222
- self.purchasedCommand = command;
223
- [[NSNotificationCenter defaultCenter] addObserver:self
224
- selector:@selector(reloadContent:)
225
- name: @"ply_purchasedSubscription"
226
- object:nil];
223
+ self.purchasedCommand = command;
224
+ [[NSNotificationCenter defaultCenter] addObserver:self
225
+ selector:@selector(reloadContent:)
226
+ name: @"ply_purchasedSubscription"
227
+ object:nil];
227
228
  }
228
229
 
229
230
  - (void)allProducts:(CDVInvokedUrlCommand*)command {
230
- [Purchasely allProductsWithSuccess:^(NSArray<PLYProduct *> * _Nonnull products) {
231
- NSMutableArray *productsArray = [NSMutableArray array];
231
+ [Purchasely allProductsWithSuccess:^(NSArray<PLYProduct *> * _Nonnull products) {
232
+ NSMutableArray *productsArray = [NSMutableArray array];
232
233
 
233
- for (PLYProduct *product in products) {
234
- if (product != nil) {
235
- [productsArray addObject: product.asDictionary];
236
- }
237
- }
234
+ for (PLYProduct *product in products) {
235
+ if (product != nil) {
236
+ [productsArray addObject: product.asDictionary];
237
+ }
238
+ }
238
239
 
239
- [self successFor:command resultArray:productsArray];
240
- } failure:^(NSError * _Nullable error) {
241
- [self failureFor:command resultString:error.localizedDescription];
242
- }];
240
+ [self successFor:command resultArray:productsArray];
241
+ } failure:^(NSError * _Nullable error) {
242
+ [self failureFor:command resultString:error.localizedDescription];
243
+ }];
243
244
  }
244
245
 
245
246
  - (void)productWithIdentifier:(CDVInvokedUrlCommand*)command {
246
- NSString *productVendorId = [command argumentAtIndex:0];
247
+ NSString *productVendorId = [command argumentAtIndex:0];
247
248
 
248
- [Purchasely productWith:productVendorId
249
- success:^(PLYProduct * _Nonnull product) {
250
- [self successFor:command resultDict:product.asDictionary];
251
- }
252
- failure:^(NSError * _Nullable error) {
253
- [self failureFor:command resultString:error.localizedDescription];
254
- }];
249
+ [Purchasely productWith:productVendorId
250
+ success:^(PLYProduct * _Nonnull product) {
251
+ [self successFor:command resultDict:product.asDictionary];
252
+ }
253
+ failure:^(NSError * _Nullable error) {
254
+ [self failureFor:command resultString:error.localizedDescription];
255
+ }];
255
256
  }
256
257
 
257
258
  - (void)planWithIdentifier:(CDVInvokedUrlCommand*)command {
258
- NSString *planVendorId = [command argumentAtIndex:0];
259
+ NSString *planVendorId = [command argumentAtIndex:0];
259
260
 
260
- [Purchasely planWith:planVendorId
261
- success:^(PLYPlan * _Nonnull plan) {
262
- [self successFor:command resultDict:plan.asDictionary];
263
- }
264
- failure:^(NSError * _Nullable error) {
265
- [self failureFor:command resultString:error.localizedDescription];
266
- }];
261
+ [Purchasely planWith:planVendorId
262
+ success:^(PLYPlan * _Nonnull plan) {
263
+ [self successFor:command resultDict:plan.asDictionary];
264
+ }
265
+ failure:^(NSError * _Nullable error) {
266
+ [self failureFor:command resultString:error.localizedDescription];
267
+ }];
267
268
  }
268
269
 
269
270
  - (void)userSubscriptions:(CDVInvokedUrlCommand*)command {
270
- [Purchasely userSubscriptionsWithSuccess:^(NSArray<PLYSubscription *> * _Nullable subscriptions) {
271
- NSMutableArray *result = [NSMutableArray new];
272
- for (PLYSubscription *subscription in subscriptions) {
273
- [result addObject:subscription.asDictionary];
274
- }
275
- [self successFor:command resultArray:result];
276
- }
277
- failure:^(NSError * _Nonnull error) {
278
- [self failureFor:command resultString:error.localizedDescription];
279
- }];
271
+ [Purchasely userSubscriptionsWithSuccess:^(NSArray<PLYSubscription *> * _Nullable subscriptions) {
272
+ NSMutableArray *result = [NSMutableArray new];
273
+ for (PLYSubscription *subscription in subscriptions) {
274
+ [result addObject:subscription.asDictionary];
275
+ }
276
+ [self successFor:command resultArray:result];
277
+ }
278
+ failure:^(NSError * _Nonnull error) {
279
+ [self failureFor:command resultString:error.localizedDescription];
280
+ }];
280
281
  }
281
282
 
282
283
  - (void)addEventsListener:(CDVInvokedUrlCommand*)command {
283
- [Purchasely setEventDelegate:self];
284
- self.eventCommand = command;
284
+ [Purchasely setEventDelegate:self];
285
+ self.eventCommand = command;
285
286
  }
286
287
 
287
288
  - (void)removeEventsListener:(CDVInvokedUrlCommand*)command {
288
- [Purchasely setEventDelegate:nil];
289
- self.eventCommand = nil;
289
+ [Purchasely setEventDelegate:nil];
290
+ self.eventCommand = nil;
290
291
  }
291
292
 
292
293
  - (void)handle:(CDVInvokedUrlCommand*)command {
293
- NSString *deeplinkString = [command argumentAtIndex:0];
294
- NSURL *deeplink = [NSURL URLWithString:deeplinkString];
295
-
296
- if (deeplink != nil) {
297
- BOOL result = [Purchasely handleWithDeeplink:deeplink];
298
- [self successFor:command resultBool:result];
299
- } else {
300
- [self successFor:command resultBool:NO];
301
- }
294
+ NSString *deeplinkString = [command argumentAtIndex:0];
295
+ NSURL *deeplink = [NSURL URLWithString:deeplinkString];
296
+
297
+ if (deeplink != nil) {
298
+ BOOL result = [Purchasely handleWithDeeplink:deeplink];
299
+ [self successFor:command resultBool:result];
300
+ } else {
301
+ [self successFor:command resultBool:NO];
302
+ }
302
303
  }
303
304
 
304
305
  - (void)close:(CDVInvokedUrlCommand*)command {
305
306
  }
306
307
 
307
308
  - (void)setLanguage:(CDVInvokedUrlCommand*)command {
308
- NSString *language = [command argumentAtIndex:0];
309
- NSLocale *locale = [NSLocale localeWithLocaleIdentifier:language];
310
- [Purchasely setLanguageFrom:locale];
309
+ NSString *language = [command argumentAtIndex:0];
310
+ NSLocale *locale = [NSLocale localeWithLocaleIdentifier:language];
311
+ [Purchasely setLanguageFrom:locale];
311
312
  }
312
313
 
313
314
  // Helpers
314
315
 
315
316
  - (NSDictionary<NSString *, NSObject *> *) resultDictionaryForPresentationController:(PLYProductViewControllerResult)result plan:(PLYPlan * _Nullable)plan {
316
- NSMutableDictionary<NSString *, NSObject *> *productViewResult = [NSMutableDictionary new];
317
- int resultString;
317
+ NSMutableDictionary<NSString *, NSObject *> *productViewResult = [NSMutableDictionary new];
318
+ int resultString;
318
319
 
319
- switch (result) {
320
- case PLYProductViewControllerResultPurchased:
321
- resultString = PLYProductViewControllerResultPurchased;
322
- break;
323
- case PLYProductViewControllerResultRestored:
324
- resultString = PLYProductViewControllerResultRestored;
325
- break;
326
- case PLYProductViewControllerResultCancelled:
327
- resultString = PLYProductViewControllerResultCancelled;
328
- break;
329
- }
320
+ switch (result) {
321
+ case PLYProductViewControllerResultPurchased:
322
+ resultString = PLYProductViewControllerResultPurchased;
323
+ break;
324
+ case PLYProductViewControllerResultRestored:
325
+ resultString = PLYProductViewControllerResultRestored;
326
+ break;
327
+ case PLYProductViewControllerResultCancelled:
328
+ resultString = PLYProductViewControllerResultCancelled;
329
+ break;
330
+ }
330
331
 
331
- [productViewResult setObject:[NSNumber numberWithInt:resultString] forKey:@"result"];
332
+ [productViewResult setObject:[NSNumber numberWithInt:resultString] forKey:@"result"];
332
333
 
333
- if (plan != nil) {
334
- [productViewResult setObject:[plan asDictionary] forKey:@"plan"];
335
- }
336
- return productViewResult;
334
+ if (plan != nil) {
335
+ [productViewResult setObject:[plan asDictionary] forKey:@"plan"];
336
+ }
337
+ return productViewResult;
337
338
  }
338
339
 
339
340
  - (NSDictionary<NSString *, NSObject *> *) resultDictionaryForActionInterceptor:(PLYPresentationAction) action
@@ -380,6 +381,13 @@
380
381
  if (infos.placementId != nil) {
381
382
  [infosResult setObject:infos.placementId forKey:@"placementId"];
382
383
  }
384
+ if (infos.abTestId != nil) {
385
+ [infosResult setObject:infos.abTestId forKey:@"abTestId"];
386
+ }
387
+ if (infos.abTestVariantId != nil) {
388
+ [infosResult setObject:infos.abTestVariantId forKey:@"abTestVariantId"];
389
+ }
390
+
383
391
  [actionInterceptorResult setObject:infosResult forKey:@"info"];
384
392
  }
385
393
  if (params != nil) {
@@ -433,43 +441,43 @@
433
441
  }
434
442
 
435
443
  - (void)successFor:(CDVInvokedUrlCommand *)command {
436
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
437
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
444
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
445
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
438
446
  }
439
447
 
440
448
  - (void)successFor:(CDVInvokedUrlCommand *)command resultBool:(BOOL)resultBool {
441
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:resultBool];
442
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
449
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:resultBool];
450
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
443
451
  }
444
452
 
445
453
  - (void)successFor:(CDVInvokedUrlCommand *)command resultString:(NSString *)resultString {
446
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resultString];
447
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
454
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resultString];
455
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
448
456
  }
449
457
 
450
458
  - (void)failureFor:(CDVInvokedUrlCommand *)command resultString:(NSString *)resultString {
451
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:resultString];
452
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
459
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:resultString];
460
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
453
461
  }
454
462
 
455
463
  - (void)successFor:(CDVInvokedUrlCommand *)command resultArray:(NSArray *)resultArray {
456
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:resultArray];
457
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
464
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:resultArray];
465
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
458
466
  }
459
467
 
460
468
  - (void)failureFor:(CDVInvokedUrlCommand *)command resultArray:(NSArray *)resultArray {
461
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsArray:resultArray];
462
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
469
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsArray:resultArray];
470
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
463
471
  }
464
472
 
465
473
  - (void)successFor:(CDVInvokedUrlCommand *)command resultDict:(NSDictionary *)resultDict {
466
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:resultDict];
467
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
474
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:resultDict];
475
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
468
476
  }
469
477
 
470
478
  - (void)failureFor:(CDVInvokedUrlCommand *)command resultDict:(NSDictionary *)resultDict {
471
- CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:resultDict];
472
- [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
479
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:resultDict];
480
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
473
481
  }
474
482
 
475
483
 
package/www/Purchasely.js CHANGED
@@ -3,7 +3,11 @@ var exec = require('cordova/exec');
3
3
  var defaultError = (e) => { console.log(e); }
4
4
 
5
5
  exports.startWithAPIKey = function (apiKey, stores, userId, logLevel, runningMode, success, error) {
6
- exec(success, error, 'Purchasely', 'startWithAPIKey', [apiKey, stores, userId, logLevel, runningMode]);
6
+ var cordovaSdkVersion = cordova.define.moduleMap['cordova/plugin_list'].exports['metadata']['cordova-plugin-purchasely']
7
+ if(!cordovaSdkVersion) {
8
+ cordovaSdkVersion = "2.2.0" //fallback if we cannot find version from metadata
9
+ }
10
+ exec(success, error, 'Purchasely', 'startWithAPIKey', [apiKey, stores, userId, logLevel, runningMode, cordovaSdkVersion]);
7
11
  };
8
12
 
9
13
  exports.addEventsListener = function (success, error) {
@@ -133,7 +137,10 @@ exports.Attribute = {
133
137
  AMPLITUDE_SESSION_ID: 0,
134
138
  FIREBASE_APP_INSTANCE_ID: 1,
135
139
  AIRSHIP_CHANNEL_ID: 2,
136
- BATCH_INSTALLATION_ID: 3
140
+ BATCH_INSTALLATION_ID: 3,
141
+ ADJUST_ID: 4,
142
+ APPSFLYER_ID: 5,
143
+ ONESIGNAL_PLAYER_ID: 6
137
144
  }
138
145
 
139
146
  exports.PurchaseResult = {