@purchasely/cordova-plugin-purchasely 5.3.1 → 5.4.1

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.
@@ -3,6 +3,6 @@
3
3
  cordova plugin remove @purchasely/cordova-plugin-purchasely
4
4
  cordova plugin remove @purchasely/cordova-plugin-puchasely-google
5
5
  cordova platform remove android
6
- cordova platform add android@13.0.0
6
+ cordova platform add android@14.0.1
7
7
  cordova plugin add ../ --link
8
8
  cordova plugin add ../../purchasely-google/ --link
package/example/ios.sh CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  cordova plugin remove @purchasely/cordova-plugin-purchasely
4
4
  cordova platform remove ios
5
- cordova platform add ios@7.0.1
5
+ cordova platform add ios@7.1.1
6
6
  cordova plugin add ../ --link
7
7
 
8
8
  if [[ $1 = true ]]
@@ -11,15 +11,15 @@
11
11
  "devDependencies": {
12
12
  "@purchasely/cordova-plugin-puchasely-google": "file:../../purchasely-google",
13
13
  "@purchasely/cordova-plugin-purchasely": "file:..",
14
- "cordova-android": "^13.0.0",
15
- "cordova-ios": "^7.0.1",
14
+ "cordova-android": "^14.0.0",
15
+ "cordova-ios": "^7.1.1",
16
16
  "cordova-plugin-puchasely-google": "file:../../purchasely-google",
17
17
  "cordova-plugin-purchasely": "file:.."
18
18
  }
19
19
  },
20
20
  "..": {
21
21
  "name": "@purchasely/cordova-plugin-purchasely",
22
- "version": "5.1.0",
22
+ "version": "5.4.1",
23
23
  "dev": true,
24
24
  "license": "ISC",
25
25
  "engines": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "../../purchasely-google": {
35
35
  "name": "@purchasely/cordova-plugin-puchasely-google",
36
- "version": "5.3.0",
36
+ "version": "5.4.1",
37
37
  "dev": true,
38
38
  "license": "ISC"
39
39
  },
@@ -106,14 +106,11 @@
106
106
  }
107
107
  },
108
108
  "node_modules/abbrev": {
109
- "version": "2.0.0",
110
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz",
111
- "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==",
109
+ "version": "1.1.1",
110
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
111
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
112
112
  "dev": true,
113
- "license": "ISC",
114
- "engines": {
115
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
116
- }
113
+ "license": "ISC"
117
114
  },
118
115
  "node_modules/android-versions": {
119
116
  "version": "2.1.0",
@@ -235,28 +232,53 @@
235
232
  "license": "MIT"
236
233
  },
237
234
  "node_modules/cordova-android": {
238
- "version": "13.0.0",
239
- "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-13.0.0.tgz",
240
- "integrity": "sha512-uQG+cSyrB1NMi2aIzihldIupHB9WGpZVvrMMMAAtnyc6tDlEk7gweSSaFsEONyGAnteRYpIvrzg/YwDW08PcUg==",
235
+ "version": "14.0.0",
236
+ "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-14.0.0.tgz",
237
+ "integrity": "sha512-aPlN2aBfC/OlZOlCR66x9GYBfnHTlmm2Dd1eYcqB+Mwm0wJFlA272psHmfiMqA5VRT5UpFyCQ5x6B1YA9h2uHg==",
241
238
  "dev": true,
242
239
  "license": "Apache-2.0",
243
240
  "dependencies": {
244
- "android-versions": "^2.0.0",
245
- "cordova-common": "^5.0.0",
241
+ "android-versions": "^2.1.0",
242
+ "cordova-common": "^5.0.1",
246
243
  "dedent": "^1.5.3",
247
244
  "execa": "^5.1.1",
248
- "fast-glob": "^3.3.2",
249
- "fs-extra": "^11.2.0",
245
+ "fast-glob": "^3.3.3",
250
246
  "is-path-inside": "^3.0.3",
251
- "nopt": "^7.2.1",
247
+ "nopt": "^8.1.0",
252
248
  "properties-parser": "^0.6.0",
253
- "semver": "^7.6.2",
249
+ "semver": "^7.7.1",
254
250
  "string-argv": "^0.3.1",
255
251
  "untildify": "^4.0.0",
256
- "which": "^4.0.0"
252
+ "which": "^5.0.0"
257
253
  },
258
254
  "engines": {
259
- "node": ">=16.13.0"
255
+ "node": ">=20.5.0"
256
+ }
257
+ },
258
+ "node_modules/cordova-android/node_modules/abbrev": {
259
+ "version": "3.0.1",
260
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz",
261
+ "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==",
262
+ "dev": true,
263
+ "license": "ISC",
264
+ "engines": {
265
+ "node": "^18.17.0 || >=20.5.0"
266
+ }
267
+ },
268
+ "node_modules/cordova-android/node_modules/nopt": {
269
+ "version": "8.1.0",
270
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz",
271
+ "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==",
272
+ "dev": true,
273
+ "license": "ISC",
274
+ "dependencies": {
275
+ "abbrev": "^3.0.0"
276
+ },
277
+ "bin": {
278
+ "nopt": "bin/nopt.js"
279
+ },
280
+ "engines": {
281
+ "node": "^18.17.0 || >=20.5.0"
260
282
  }
261
283
  },
262
284
  "node_modules/cordova-common": {
@@ -284,21 +306,19 @@
284
306
  }
285
307
  },
286
308
  "node_modules/cordova-ios": {
287
- "version": "7.0.1",
288
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.0.1.tgz",
289
- "integrity": "sha512-WaG3bgOlIQukY8rOhTuA0p2PckBxogSCSOGfWamp4BnaWFoiVm65r4kFqr7PsPguVMbe0t4h4nQTpopxB2LTEQ==",
309
+ "version": "7.1.1",
310
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.1.1.tgz",
311
+ "integrity": "sha512-JwTyPxWcAZlbIOR5QO6TaJzkoSzfrp7jrlX01bWZ7Sxp0PYXejAJbA6J0W4u11M+atrQRNimNltZDyAlSBW2tw==",
290
312
  "dev": true,
291
313
  "license": "Apache-2.0",
292
314
  "dependencies": {
293
315
  "cordova-common": "^5.0.0",
316
+ "elementtree": "^0.1.7",
294
317
  "execa": "^5.1.1",
295
- "fs-extra": "^11.1.1",
296
318
  "ios-sim": "^8.0.2",
297
- "nopt": "^7.1.0",
298
319
  "plist": "^3.0.6",
299
320
  "semver": "^7.4.0",
300
- "unorm": "^1.6.0",
301
- "which": "^3.0.0",
321
+ "which": "^4.0.0",
302
322
  "xcode": "^3.0.1",
303
323
  "xml-escape": "^1.1.0"
304
324
  },
@@ -306,27 +326,20 @@
306
326
  "node": ">=16.13.0"
307
327
  }
308
328
  },
309
- "node_modules/cordova-ios/node_modules/isexe": {
310
- "version": "2.0.0",
311
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
312
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
313
- "dev": true,
314
- "license": "ISC"
315
- },
316
329
  "node_modules/cordova-ios/node_modules/which": {
317
- "version": "3.0.1",
318
- "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
319
- "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
330
+ "version": "4.0.0",
331
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
332
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
320
333
  "dev": true,
321
334
  "license": "ISC",
322
335
  "dependencies": {
323
- "isexe": "^2.0.0"
336
+ "isexe": "^3.1.1"
324
337
  },
325
338
  "bin": {
326
339
  "node-which": "bin/which.js"
327
340
  },
328
341
  "engines": {
329
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
342
+ "node": "^16.13.0 || >=18.0.0"
330
343
  }
331
344
  },
332
345
  "node_modules/cordova-plugin-puchasely-google": {
@@ -376,9 +389,9 @@
376
389
  }
377
390
  },
378
391
  "node_modules/dedent": {
379
- "version": "1.6.0",
380
- "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz",
381
- "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==",
392
+ "version": "1.7.0",
393
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz",
394
+ "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==",
382
395
  "dev": true,
383
396
  "license": "MIT",
384
397
  "peerDependencies": {
@@ -503,21 +516,6 @@
503
516
  "node": ">=8"
504
517
  }
505
518
  },
506
- "node_modules/fs-extra": {
507
- "version": "11.3.0",
508
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz",
509
- "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==",
510
- "dev": true,
511
- "license": "MIT",
512
- "dependencies": {
513
- "graceful-fs": "^4.2.0",
514
- "jsonfile": "^6.0.1",
515
- "universalify": "^2.0.0"
516
- },
517
- "engines": {
518
- "node": ">=14.14"
519
- }
520
- },
521
519
  "node_modules/fs.realpath": {
522
520
  "version": "1.0.0",
523
521
  "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -583,13 +581,6 @@
583
581
  "node": ">= 6"
584
582
  }
585
583
  },
586
- "node_modules/graceful-fs": {
587
- "version": "4.2.11",
588
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
589
- "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
590
- "dev": true,
591
- "license": "ISC"
592
- },
593
584
  "node_modules/hasown": {
594
585
  "version": "2.0.2",
595
586
  "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
@@ -661,13 +652,6 @@
661
652
  "node": ">=6"
662
653
  }
663
654
  },
664
- "node_modules/ios-sim/node_modules/abbrev": {
665
- "version": "1.1.1",
666
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
667
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
668
- "dev": true,
669
- "license": "ISC"
670
- },
671
655
  "node_modules/ios-sim/node_modules/bplist-parser": {
672
656
  "version": "0.0.6",
673
657
  "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz",
@@ -675,22 +659,6 @@
675
659
  "dev": true,
676
660
  "license": "MIT"
677
661
  },
678
- "node_modules/ios-sim/node_modules/nopt": {
679
- "version": "1.0.9",
680
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
681
- "integrity": "sha512-CmUZ3rzN0/4kRHum5pGRiGkhmBMzgtEDxrZVHqRJDSv8qK6s+wzaig/xeyB22Due5aZQeTiEZg/nrmMH2tapDQ==",
682
- "dev": true,
683
- "license": "MIT",
684
- "dependencies": {
685
- "abbrev": "1"
686
- },
687
- "bin": {
688
- "nopt": "bin/nopt.js"
689
- },
690
- "engines": {
691
- "node": "*"
692
- }
693
- },
694
662
  "node_modules/is-core-module": {
695
663
  "version": "2.16.1",
696
664
  "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
@@ -773,19 +741,6 @@
773
741
  "node": ">=16"
774
742
  }
775
743
  },
776
- "node_modules/jsonfile": {
777
- "version": "6.1.0",
778
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
779
- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
780
- "dev": true,
781
- "license": "MIT",
782
- "dependencies": {
783
- "universalify": "^2.0.0"
784
- },
785
- "optionalDependencies": {
786
- "graceful-fs": "^4.1.6"
787
- }
788
- },
789
744
  "node_modules/lodash": {
790
745
  "version": "4.17.21",
791
746
  "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@@ -855,19 +810,19 @@
855
810
  }
856
811
  },
857
812
  "node_modules/nopt": {
858
- "version": "7.2.1",
859
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
860
- "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==",
813
+ "version": "1.0.9",
814
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
815
+ "integrity": "sha512-CmUZ3rzN0/4kRHum5pGRiGkhmBMzgtEDxrZVHqRJDSv8qK6s+wzaig/xeyB22Due5aZQeTiEZg/nrmMH2tapDQ==",
861
816
  "dev": true,
862
- "license": "ISC",
817
+ "license": "MIT",
863
818
  "dependencies": {
864
- "abbrev": "^2.0.0"
819
+ "abbrev": "1"
865
820
  },
866
821
  "bin": {
867
822
  "nopt": "bin/nopt.js"
868
823
  },
869
824
  "engines": {
870
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
825
+ "node": "*"
871
826
  }
872
827
  },
873
828
  "node_modules/npm-run-path": {
@@ -1305,26 +1260,6 @@
1305
1260
  "node": ">=8.0"
1306
1261
  }
1307
1262
  },
1308
- "node_modules/universalify": {
1309
- "version": "2.0.1",
1310
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
1311
- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
1312
- "dev": true,
1313
- "license": "MIT",
1314
- "engines": {
1315
- "node": ">= 10.0.0"
1316
- }
1317
- },
1318
- "node_modules/unorm": {
1319
- "version": "1.6.0",
1320
- "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
1321
- "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
1322
- "dev": true,
1323
- "license": "MIT or GPL-2.0",
1324
- "engines": {
1325
- "node": ">= 0.4.0"
1326
- }
1327
- },
1328
1263
  "node_modules/untildify": {
1329
1264
  "version": "4.0.0",
1330
1265
  "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",
@@ -1346,9 +1281,9 @@
1346
1281
  }
1347
1282
  },
1348
1283
  "node_modules/which": {
1349
- "version": "4.0.0",
1350
- "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
1351
- "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
1284
+ "version": "5.0.0",
1285
+ "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",
1286
+ "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",
1352
1287
  "dev": true,
1353
1288
  "license": "ISC",
1354
1289
  "dependencies": {
@@ -1358,7 +1293,7 @@
1358
1293
  "node-which": "bin/which.js"
1359
1294
  },
1360
1295
  "engines": {
1361
- "node": "^16.13.0 || >=18.0.0"
1296
+ "node": "^18.17.0 || >=20.5.0"
1362
1297
  }
1363
1298
  },
1364
1299
  "node_modules/with-open-file": {
@@ -15,8 +15,8 @@
15
15
  "devDependencies": {
16
16
  "@purchasely/cordova-plugin-puchasely-google": "file:../../purchasely-google",
17
17
  "@purchasely/cordova-plugin-purchasely": "file:..",
18
- "cordova-android": "^13.0.0",
19
- "cordova-ios": "^7.0.1",
18
+ "cordova-android": "^14.0.0",
19
+ "cordova-ios": "^7.1.1",
20
20
  "cordova-plugin-puchasely-google": "file:../../purchasely-google",
21
21
  "cordova-plugin-purchasely": "file:.."
22
22
  },
@@ -167,11 +167,11 @@ function onPuchaselySdkReady() {
167
167
  console.log("Error with purchase : " + error);
168
168
  });
169
169
 
170
- Purchasely.setUserAttributeWithString("key_string", "value_string");
171
- Purchasely.setUserAttributeWithBoolean("key_boolean", true);
172
- Purchasely.setUserAttributeWithInt("key_int", 7);
173
- Purchasely.setUserAttributeWithDouble("key_double", 4.5);
174
- Purchasely.setUserAttributeWithDate("key_date", new Date().toISOString());
170
+ Purchasely.setUserAttributeWithString("key_string", "value_string", Purchasely.DataProcessingLegalBasis.essential);
171
+ Purchasely.setUserAttributeWithBoolean("key_boolean", true, Purchasely.DataProcessingLegalBasis.essential);
172
+ Purchasely.setUserAttributeWithInt("key_int", 7, Purchasely.DataProcessingLegalBasis.essential);
173
+ Purchasely.setUserAttributeWithDouble("key_double", 4.5, Purchasely.DataProcessingLegalBasis.essential);
174
+ Purchasely.setUserAttributeWithDate("key_date", new Date().toISOString(), Purchasely.DataProcessingLegalBasis.essential);
175
175
 
176
176
  Purchasely.clearUserAttributes();
177
177
 
@@ -186,6 +186,8 @@ function onPuchaselySdkReady() {
186
186
  Purchasely.setUserAttributeWithDoubleArray("key_double_array", [1.1, 2.2, 3.3]);
187
187
  Purchasely.setUserAttributeWithBooleanArray("key_boolean_array", [true, false, true]);
188
188
 
189
+ Purchasely.revokeDataProcessingConsent(["CAMPAIGNS"])
190
+
189
191
  Purchasely.userAttribute("key_string", value => {
190
192
  console.log("User attribute string: " + value);
191
193
  });
@@ -248,7 +250,7 @@ function onPuchaselySdkReady() {
248
250
  console.log('prevent Purchasely SDK to navigate to website');
249
251
  Purchasely.onProcessAction(true);
250
252
  } else if (result.action === Purchasely.PaywallAction.close) {
251
- console.log('User wants to close paywall');
253
+ console.log('User wants to close paywall - close reason ' + result.parameters.closeReason);
252
254
  Purchasely.onProcessAction(true);
253
255
  } else if (result.action === Purchasely.PaywallAction.login) {
254
256
  console.log('User wants to login');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purchasely/cordova-plugin-purchasely",
3
- "version": "5.3.1",
3
+ "version": "5.4.1",
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="5.3.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="5.4.1" 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" />
@@ -38,7 +38,7 @@
38
38
  <source url="https://github.com/CocoaPods/Specs.git"/>
39
39
  </config>
40
40
  <pods use-frameworks="true">
41
- <pod name="Purchasely" spec="5.3.7"/>
41
+ <pod name="Purchasely" spec="5.4.2"/>
42
42
  </pods>
43
43
  </podspec>
44
44
  </platform>
@@ -63,7 +63,7 @@
63
63
  android:theme="@style/Theme.AppCompat.Light.NoActionBar">
64
64
  </activity>
65
65
  </config-file>
66
- <framework src="io.purchasely:core:5.3.4" />
66
+ <framework src="io.purchasely:core:5.4.0" />
67
67
  <source-file src="src/android/PurchaselyPlugin.kt" target-dir="java/cordova/plugin/purchasely" />
68
68
  <source-file src="src/android/PLYProductActivity.kt" target-dir="java/cordova/plugin/purchasely" />
69
69
  <source-file src="src/android/PLYSubscriptionsActivity.java" target-dir="src/cordova/plugin/purchasely" />
@@ -16,6 +16,7 @@ import io.purchasely.ext.Purchasely
16
16
  import io.purchasely.models.PLYPlan
17
17
  import io.purchasely.views.parseColor
18
18
  import java.lang.ref.WeakReference
19
+ import android.view.WindowManager
19
20
 
20
21
  class PLYProductActivity : AppCompatActivity() {
21
22
 
@@ -40,6 +41,7 @@ class PLYProductActivity : AppCompatActivity() {
40
41
 
41
42
  if(isFullScreen) {
42
43
  WindowCompat.setDecorFitsSystemWindows(window, false)
44
+ window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
43
45
  }
44
46
 
45
47
  val package_name = application.packageName
@@ -12,6 +12,8 @@ import io.purchasely.ext.EventListener
12
12
  import io.purchasely.ext.LogLevel
13
13
  import io.purchasely.ext.PLYAppTechnology
14
14
  import io.purchasely.ext.PLYCompletionHandler
15
+ import io.purchasely.ext.PLYDataProcessingLegalBasis
16
+ import io.purchasely.ext.PLYDataProcessingPurpose
15
17
  import io.purchasely.ext.PLYEvent
16
18
  import io.purchasely.ext.PLYPresentation
17
19
  import io.purchasely.ext.PLYPresentationAction
@@ -170,21 +172,22 @@ class PurchaselyPlugin : CordovaPlugin() {
170
172
  "hidePresentation" -> hidePresentation()
171
173
  "showPresentation" -> showPresentation()
172
174
  "userDidConsumeSubscriptionContent" -> userDidConsumeSubscriptionContent()
173
- "setUserAttributeWithString" -> setUserAttributeWithString(getStringFromJson(args.getString(0)), getStringFromJson(args.getString(1)))
174
- "setUserAttributeWithBoolean" -> setUserAttributeWithBoolean(getStringFromJson(args.getString(0)), args.getBoolean(1))
175
- "setUserAttributeWithInt" -> setUserAttributeWithInt(getStringFromJson(args.getString(0)), args.getInt(1))
176
- "setUserAttributeWithDouble" -> setUserAttributeWithDouble(getStringFromJson(args.getString(0)), args.getDouble(1))
177
- "setUserAttributeWithDate" -> setUserAttributeWithDate(getStringFromJson(args.getString(0)), getStringFromJson(args.getString(1)))
178
- "setUserAttributeWithStringArray" -> setUserAttributeWithStringArray(getStringFromJson(args.getString(0)), args.getJSONArray(1))
179
- "setUserAttributeWithIntArray" -> setUserAttributeWithIntArray(getStringFromJson(args.getString(0)), args.getJSONArray(1))
180
- "setUserAttributeWithDoubleArray" -> setUserAttributeWithDoubleArray(getStringFromJson(args.getString(0)), args.getJSONArray(1))
181
- "setUserAttributeWithBooleanArray" -> setUserAttributeWithBooleanArray(getStringFromJson(args.getString(0)), args.getJSONArray(1))
175
+ "setUserAttributeWithString" -> setUserAttributeWithString(getStringFromJson(args.getString(0)), getStringFromJson(args.getString(1)), getStringFromJson(args.optString(2)))
176
+ "setUserAttributeWithBoolean" -> setUserAttributeWithBoolean(getStringFromJson(args.getString(0)), args.getBoolean(1), getStringFromJson(args.optString(2)))
177
+ "setUserAttributeWithInt" -> setUserAttributeWithInt(getStringFromJson(args.getString(0)), args.getInt(1), getStringFromJson(args.optString(2)))
178
+ "setUserAttributeWithDouble" -> setUserAttributeWithDouble(getStringFromJson(args.getString(0)), args.getDouble(1), getStringFromJson(args.optString(2)))
179
+ "setUserAttributeWithDate" -> setUserAttributeWithDate(getStringFromJson(args.getString(0)), getStringFromJson(args.getString(1)), getStringFromJson(args.optString(2)))
180
+ "setUserAttributeWithStringArray" -> setUserAttributeWithStringArray(getStringFromJson(args.getString(0)), args.getJSONArray(1), getStringFromJson(args.optString(2)))
181
+ "setUserAttributeWithIntArray" -> setUserAttributeWithIntArray(getStringFromJson(args.getString(0)), args.getJSONArray(1), getStringFromJson(args.optString(2)))
182
+ "setUserAttributeWithDoubleArray" -> setUserAttributeWithDoubleArray(getStringFromJson(args.getString(0)), args.getJSONArray(1), getStringFromJson(args.optString(2)))
183
+ "setUserAttributeWithBooleanArray" -> setUserAttributeWithBooleanArray(getStringFromJson(args.getString(0)), args.getJSONArray(1), getStringFromJson(args.optString(2)))
182
184
  "userAttribute" -> userAttribute(getStringFromJson(args.getString(0)), callbackContext)
183
185
  "clearUserAttribute" -> clearUserAttribute(getStringFromJson(args.getString(0)))
184
186
  "clearUserAttributes" -> clearUserAttributes()
185
187
  "clearBuiltInAttributes" -> clearBuiltInAttributes()
186
188
  "isEligibleForIntroOffer" -> isEligibleForIntroOffer(getStringFromJson(args.getString(0)), callbackContext)
187
189
  "signPromotionalOffer" -> signPromotionalOffer(getStringFromJson(args.getString(0)), getStringFromJson(args.getString(1)), callbackContext)
190
+ "revokeDataProcessingConsent" -> revokeDataProcessingConsent(args.getJSONArray(0))
188
191
  else -> return false
189
192
  }
190
193
  } catch (e: JSONException) {
@@ -775,6 +778,7 @@ class PurchaselyPlugin : CordovaPlugin() {
775
778
  parametersForCordova["subscriptionOffer"] = parameters.subscriptionOffer?.toMap()
776
779
  parametersForCordova["presentation"] = parameters.presentation
777
780
  parametersForCordova["placement"] = parameters.placement
781
+ parametersForCordova["closeReason"] = parameters.closeReason?.name
778
782
 
779
783
  val result = PluginResult(
780
784
  PluginResult.Status.OK,
@@ -841,7 +845,7 @@ class PurchaselyPlugin : CordovaPlugin() {
841
845
  )
842
846
  }
843
847
 
844
- fun setUserAttributeWithStringArray(key: String?, value: JSONArray?) {
848
+ fun setUserAttributeWithStringArray(key: String?, value: JSONArray?, legalBasisString: String?) {
845
849
  if(key == null || value == null) return
846
850
  val list = mutableListOf<String>()
847
851
  for (i in 0 until value.length()) {
@@ -851,10 +855,14 @@ class PurchaselyPlugin : CordovaPlugin() {
851
855
  Log.e("Purchasely", "Error in string array" + e.message, e)
852
856
  }
853
857
  }
854
- Purchasely.setUserAttribute(key, list.toTypedArray())
858
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
859
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
860
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
861
+ }
862
+ Purchasely.setUserAttribute(key, list.toTypedArray(), processingLegalBasis)
855
863
  }
856
864
 
857
- fun setUserAttributeWithIntArray(key: String?, value: JSONArray?) {
865
+ fun setUserAttributeWithIntArray(key: String?, value: JSONArray?, legalBasisString: String?) {
858
866
  if(key == null || value == null) return
859
867
  val list = mutableListOf<Int>()
860
868
  for (i in 0 until value.length()) {
@@ -864,10 +872,14 @@ class PurchaselyPlugin : CordovaPlugin() {
864
872
  Log.e("Purchasely", "Error in int array" + e.message, e)
865
873
  }
866
874
  }
867
- Purchasely.setUserAttribute(key, list.toTypedArray())
875
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
876
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
877
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
878
+ }
879
+ Purchasely.setUserAttribute(key, list.toTypedArray(), processingLegalBasis)
868
880
  }
869
881
 
870
- fun setUserAttributeWithDoubleArray(key: String?, value: JSONArray?) {
882
+ fun setUserAttributeWithDoubleArray(key: String?, value: JSONArray?, legalBasisString: String?) {
871
883
  if (key == null || value == null) return
872
884
  val list = mutableListOf<Float>()
873
885
  for (i in 0 until value.length()) {
@@ -877,10 +889,14 @@ class PurchaselyPlugin : CordovaPlugin() {
877
889
  Log.e("Purchasely", "Error in double array: ${e.message}", e)
878
890
  }
879
891
  }
880
- Purchasely.setUserAttribute(key, list.toTypedArray())
892
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
893
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
894
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
895
+ }
896
+ Purchasely.setUserAttribute(key, list.toTypedArray(), processingLegalBasis)
881
897
  }
882
898
 
883
- fun setUserAttributeWithBooleanArray(key: String?, value: JSONArray?) {
899
+ fun setUserAttributeWithBooleanArray(key: String?, value: JSONArray?, legalBasisString: String?) {
884
900
  if(key == null || value == null) return
885
901
  val list = mutableListOf<Boolean>()
886
902
  for (i in 0 until value.length()) {
@@ -890,31 +906,55 @@ class PurchaselyPlugin : CordovaPlugin() {
890
906
  Log.e("Purchasely", "Error in boolean array" + e.message, e)
891
907
  }
892
908
  }
893
- Purchasely.setUserAttribute(key, list.toTypedArray())
909
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
910
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
911
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
912
+ }
913
+ Purchasely.setUserAttribute(key, list.toTypedArray(), processingLegalBasis)
894
914
  }
895
915
 
896
- fun setUserAttributeWithString(key: String?, value: String?) {
916
+ fun setUserAttributeWithString(key: String?, value: String?, legalBasisString: String?) {
897
917
  if(key == null || value == null) return
898
- Purchasely.setUserAttribute(key, value)
918
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
919
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
920
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
921
+ }
922
+ Purchasely.setUserAttribute(key, value, processingLegalBasis)
899
923
  }
900
924
 
901
- fun setUserAttributeWithInt(key: String?, value: Int?) {
925
+ fun setUserAttributeWithInt(key: String?, value: Int?, legalBasisString: String?) {
902
926
  if(key == null || value == null) return
903
- Purchasely.setUserAttribute(key, value)
927
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
928
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
929
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
930
+ }
931
+ Purchasely.setUserAttribute(key, value, processingLegalBasis)
904
932
  }
905
933
 
906
- fun setUserAttributeWithDouble(key: String?, value: Double?) {
934
+ fun setUserAttributeWithDouble(key: String?, value: Double?, legalBasisString: String?) {
907
935
  if(key == null || value == null) return
908
- Purchasely.setUserAttribute(key, value.toFloat())
936
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
937
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
938
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
939
+ }
940
+ Purchasely.setUserAttribute(key, value.toFloat(), processingLegalBasis)
909
941
  }
910
942
 
911
- fun setUserAttributeWithBoolean(key: String?, value: Boolean?) {
943
+ fun setUserAttributeWithBoolean(key: String?, value: Boolean?, legalBasisString: String?) {
912
944
  if(key == null || value == null) return
913
- Purchasely.setUserAttribute(key, value)
945
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
946
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
947
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
948
+ }
949
+ Purchasely.setUserAttribute(key, value, processingLegalBasis)
914
950
  }
915
951
 
916
- fun setUserAttributeWithDate(key: String?, value: String?) {
952
+ fun setUserAttributeWithDate(key: String?, value: String?, legalBasisString: String?) {
917
953
  if(key == null || value == null) return
954
+ val processingLegalBasis = when (legalBasisString?.uppercase()) {
955
+ "ESSENTIAL" -> PLYDataProcessingLegalBasis.ESSENTIAL
956
+ else -> PLYDataProcessingLegalBasis.OPTIONAL
957
+ }
918
958
  val format = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
919
959
  SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX", Locale.getDefault())
920
960
  } else {
@@ -926,7 +966,7 @@ class PurchaselyPlugin : CordovaPlugin() {
926
966
  format.parse(value)?.let {
927
967
  calendar.time = it
928
968
  }
929
- Purchasely.setUserAttribute(key, calendar.time)
969
+ Purchasely.setUserAttribute(key, calendar.time, processingLegalBasis)
930
970
  } catch (e: Exception) {
931
971
  Log.e("Purchasely", "Cannot save date attribute $key", e)
932
972
  }
@@ -1003,6 +1043,29 @@ class PurchaselyPlugin : CordovaPlugin() {
1003
1043
  callbackContext.error("No signing required on Android")
1004
1044
  }
1005
1045
 
1046
+ private fun revokeDataProcessingConsent(purposes: JSONArray?) {
1047
+ if(purposes == null) return
1048
+ var mappedPurposes = mutableSetOf<PLYDataProcessingPurpose>()
1049
+ for (i in 0 until purposes.length()) {
1050
+ try {
1051
+ when (purposes.getString(i)) {
1052
+ "ALL_NON_ESSENTIALS" -> {
1053
+ mappedPurposes = mutableSetOf(PLYDataProcessingPurpose.AllNonEssentials)
1054
+ break
1055
+ }
1056
+ "ANALYTICS" -> mappedPurposes.add(PLYDataProcessingPurpose.Analytics)
1057
+ "IDENTIFIED_ANALYTICS" -> mappedPurposes.add(PLYDataProcessingPurpose.IdentifiedAnalytics)
1058
+ "CAMPAIGNS" -> mappedPurposes.add(PLYDataProcessingPurpose.Campaigns)
1059
+ "PERSONALIZATION" -> mappedPurposes.add(PLYDataProcessingPurpose.Personalization)
1060
+ "THIRD_PARTY_INTEGRATIONS" -> mappedPurposes.add(PLYDataProcessingPurpose.ThirdPartyIntegrations)
1061
+ }
1062
+ } catch (e: JSONException) {
1063
+ Log.e("Purchasely", "Error in string array" + e.message, e)
1064
+ }
1065
+ }
1066
+ Purchasely.revokeDataProcessingConsent(mappedPurposes)
1067
+ }
1068
+
1006
1069
 
1007
1070
  class ProductActivity {
1008
1071
  var presentationId: String? = null
@@ -698,79 +698,148 @@ static NSString * PLYWebCheckoutProviderToString(PLYWebCheckoutProvider provider
698
698
  - (void)setUserAttributeWithStringArray:(CDVInvokedUrlCommand*)command {
699
699
  NSString *key = [command argumentAtIndex:0];
700
700
  NSArray<NSString *> *array = [command argumentAtIndex:1];
701
- [Purchasely setUserAttributeWithStringArray:array forKey:key];
701
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
702
+
703
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
704
+
705
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
706
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
707
+ }
708
+
709
+ [Purchasely setUserAttributeWithStringArray:array forKey:key processingLegalBasis:processingLegalBasis];
702
710
  }
703
711
 
704
712
  - (void)setUserAttributeWithBooleanArray:(CDVInvokedUrlCommand*)command {
705
713
  NSString *key = [command argumentAtIndex:0];
706
714
  NSArray *values = [command argumentAtIndex:1];
715
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
707
716
 
708
717
  NSMutableArray<NSNumber *> *boolArray = [NSMutableArray array];
709
718
  for (id value in values) {
710
719
  [boolArray addObject:@([value boolValue])];
711
720
  }
721
+
722
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
723
+
724
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
725
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
726
+ }
712
727
 
713
- [Purchasely setUserAttributeWithBoolArray:boolArray forKey:key];
728
+ [Purchasely setUserAttributeWithBoolArray:boolArray forKey:key processingLegalBasis:processingLegalBasis];
714
729
  }
715
730
 
716
731
  - (void)setUserAttributeWithIntArray:(CDVInvokedUrlCommand*)command {
717
732
  NSString *key = [command argumentAtIndex:0];
718
733
  NSArray *values = [command argumentAtIndex:1];
734
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
719
735
 
720
736
  NSMutableArray<NSNumber *> *intArray = [NSMutableArray array];
721
737
  for (id val in values) {
722
738
  [intArray addObject:@([val intValue])];
723
739
  }
740
+
741
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
742
+
743
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
744
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
745
+ }
724
746
 
725
- [Purchasely setUserAttributeWithIntArray:intArray forKey:key];
747
+ [Purchasely setUserAttributeWithIntArray:intArray forKey:key processingLegalBasis:processingLegalBasis];
726
748
  }
727
749
 
728
750
  - (void)setUserAttributeWithDoubleArray:(CDVInvokedUrlCommand*)command {
729
751
  NSString *key = [command argumentAtIndex:0];
730
752
  NSArray *values = [command argumentAtIndex:1];
753
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
731
754
 
732
755
  NSMutableArray<NSNumber *> *doubleArray = [NSMutableArray array];
733
756
  for (id val in values) {
734
757
  [doubleArray addObject:@([val doubleValue])];
735
758
  }
759
+
760
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
761
+
762
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
763
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
764
+ }
736
765
 
737
- [Purchasely setUserAttributeWithDoubleArray:doubleArray forKey:key];
766
+ [Purchasely setUserAttributeWithDoubleArray:doubleArray forKey:key processingLegalBasis:processingLegalBasis];
738
767
  }
739
768
 
740
769
  - (void)setUserAttributeWithString:(CDVInvokedUrlCommand*)command {
741
770
  NSString *key = [command argumentAtIndex:0];
742
771
  NSString *value = [command argumentAtIndex:1];
743
- [Purchasely setUserAttributeWithStringValue:value forKey:key];
772
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
773
+
774
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
775
+
776
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
777
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
778
+ }
779
+
780
+ [Purchasely setUserAttributeWithStringValue:value forKey:key processingLegalBasis:processingLegalBasis];
744
781
  }
745
782
 
746
783
  - (void)setUserAttributeWithBoolean:(CDVInvokedUrlCommand*)command {
747
784
  NSString *key = [command argumentAtIndex:0];
748
785
  BOOL value = [[command argumentAtIndex:1] boolValue];
749
- [Purchasely setUserAttributeWithBoolValue:value forKey:key];
786
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
787
+
788
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
789
+
790
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
791
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
792
+ }
793
+
794
+ [Purchasely setUserAttributeWithBoolValue:value forKey:key processingLegalBasis:processingLegalBasis];
750
795
  }
751
796
 
752
797
  - (void)setUserAttributeWithInt:(CDVInvokedUrlCommand*)command {
753
798
  NSString *key = [command argumentAtIndex:0];
754
799
  NSInteger value = [[command argumentAtIndex:1] intValue];
755
- [Purchasely setUserAttributeWithIntValue:value forKey:key];
800
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
801
+
802
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
803
+
804
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
805
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
806
+ }
807
+
808
+ [Purchasely setUserAttributeWithIntValue:value forKey:key processingLegalBasis:processingLegalBasis];
756
809
  }
757
810
 
758
811
  - (void)setUserAttributeWithDouble:(CDVInvokedUrlCommand*)command {
759
812
  NSString *key = [command argumentAtIndex:0];
760
813
  double value = [[command argumentAtIndex:1] doubleValue];
761
- [Purchasely setUserAttributeWithDoubleValue:value forKey:key];
814
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
815
+
816
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
817
+
818
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
819
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
820
+ }
821
+
822
+ [Purchasely setUserAttributeWithDoubleValue:value forKey:key processingLegalBasis:processingLegalBasis];
762
823
  }
763
824
 
764
825
  - (void)setUserAttributeWithDate:(CDVInvokedUrlCommand*)command {
765
826
  NSString *key = [command argumentAtIndex:0];
766
827
  NSString *value = [command argumentAtIndex:1];
828
+ NSString *processingLegalBasisBasisArg = [command argumentAtIndex:2];
767
829
 
768
830
  NSDateFormatter * dateFormatter = [NSDateFormatter new];
769
831
  dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"GMT"];
770
832
  [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
771
833
  NSDate *date = [dateFormatter dateFromString:value];
834
+
835
+ NSInteger processingLegalBasis = PLYDataProcessingLegalBasisOptional;
836
+
837
+ if ([processingLegalBasisBasisArg isEqualToString:@"ESSENTIAL"]) {
838
+ processingLegalBasis = PLYDataProcessingLegalBasisEssential;
839
+ }
840
+
772
841
  if (date != nil) {
773
- [Purchasely setUserAttributeWithDateValue:date forKey:key];
842
+ [Purchasely setUserAttributeWithDateValue:date forKey:key processingLegalBasis:processingLegalBasis];
774
843
  } else {
775
844
  NSLog(@"[Purchasely] Cannot save date attribute %@", key);
776
845
  }
@@ -898,6 +967,30 @@ static NSString * PLYWebCheckoutProviderToString(PLYWebCheckoutProvider provider
898
967
  });
899
968
  }
900
969
 
970
+ - (void) revokeDataProcessingConsent:(CDVInvokedUrlCommand *)command {
971
+ NSArray *values = [command argumentAtIndex:0];
972
+ NSMutableSet<PLYDataProcessingPurpose *> *purposesSet = [NSMutableSet set];
973
+
974
+ for (id val in values) {
975
+ NSString *string = val;
976
+ if ([string isEqualToString:@"ALL_NON_ESSENTIALS"]) {
977
+ purposesSet = [NSMutableSet setWithObject:[PLYDataProcessingPurpose allNonEssentials]];
978
+ break;
979
+ } else if ([string isEqualToString:@"ANALYTICS"]) {
980
+ [purposesSet addObject:[PLYDataProcessingPurpose analytics]];
981
+ } else if ([string isEqualToString:@"IDENTIFIED_ANALYTICS"]) {
982
+ [purposesSet addObject:[PLYDataProcessingPurpose identifiedAnalytics]];
983
+ } else if ([string isEqualToString:@"CAMPAIGNS"]) {
984
+ [purposesSet addObject:[PLYDataProcessingPurpose campaigns]];
985
+ } else if ([string isEqualToString:@"PERSONALIZATION"]) {
986
+ [purposesSet addObject:[PLYDataProcessingPurpose personalization]];
987
+ } else if ([string isEqualToString:@"THIRD_PARTY_INTEGRATIONS"]) {
988
+ [purposesSet addObject:[PLYDataProcessingPurpose thirdPartyIntegrations]];
989
+ }
990
+ }
991
+ [Purchasely revokeDataProcessingConsentFor: purposesSet];
992
+ }
993
+
901
994
  - (PLYPresentation *) findPresentationLoadedFor:(NSString * _Nullable) presentationId {
902
995
  for (PLYPresentation *presentationLoaded in self.presentationsLoaded) {
903
996
  if ([presentationLoaded.id isEqualToString: presentationId]) {
package/www/Purchasely.js CHANGED
@@ -5,7 +5,7 @@ var defaultError = (e) => { console.log(e); }
5
5
  exports.start = function (apiKey, stores, storekit1, userId, logLevel, runningMode, success, error) {
6
6
  var cordovaSdkVersion = cordova.define.moduleMap['cordova/plugin_list'].exports['metadata']['cordova-plugin-purchasely']
7
7
  if(!cordovaSdkVersion) {
8
- cordovaSdkVersion = "5.3.1";
8
+ cordovaSdkVersion = "5.4.1";
9
9
  }
10
10
  exec(success, error, 'Purchasely', 'start', [apiKey, stores, storekit1, userId, logLevel, runningMode, cordovaSdkVersion]);
11
11
  };
@@ -158,40 +158,40 @@ exports.closePresentation = function () {
158
158
  exec(() => {}, defaultError, 'Purchasely', 'closePresentation', []);
159
159
  };
160
160
 
161
- exports.setUserAttributeWithString = function (key, value) {
162
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithString', [key, value]);
161
+ exports.setUserAttributeWithString = function (key, value, processLegalBasis) {
162
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithString', [key, value, processLegalBasis]);
163
163
  };
164
164
 
165
- exports.setUserAttributeWithBoolean = function (key, value) {
166
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithBoolean', [key, value]);
165
+ exports.setUserAttributeWithBoolean = function (key, value, processLegalBasis) {
166
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithBoolean', [key, value, processLegalBasis]);
167
167
  };
168
168
 
169
- exports.setUserAttributeWithInt = function (key, value) {
170
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithInt', [key, value]);
169
+ exports.setUserAttributeWithInt = function (key, value, processLegalBasis) {
170
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithInt', [key, value, processLegalBasis]);
171
171
  };
172
172
 
173
- exports.setUserAttributeWithDouble = function (key, value) {
174
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDouble', [key, value]);
173
+ exports.setUserAttributeWithDouble = function (key, value, processLegalBasis) {
174
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDouble', [key, value, processLegalBasis]);
175
175
  };
176
176
 
177
- exports.setUserAttributeWithDate = function (key, value) {
178
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDate', [key, value]);
177
+ exports.setUserAttributeWithDate = function (key, value, processLegalBasis) {
178
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDate', [key, value, processLegalBasis]);
179
179
  };
180
180
 
181
- exports.setUserAttributeWithStringArray = function (key, value) {
182
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithStringArray', [key, value]);
181
+ exports.setUserAttributeWithStringArray = function (key, value, processLegalBasis) {
182
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithStringArray', [key, value, processLegalBasis]);
183
183
  }
184
184
 
185
- exports.setUserAttributeWithIntArray = function (key, value) {
186
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithIntArray', [key, value]);
185
+ exports.setUserAttributeWithIntArray = function (key, value, processLegalBasis) {
186
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithIntArray', [key, value, processLegalBasis]);
187
187
  }
188
188
 
189
- exports.setUserAttributeWithDoubleArray = function (key, value) {
190
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDoubleArray', [key, value]);
189
+ exports.setUserAttributeWithDoubleArray = function (key, value, processLegalBasis) {
190
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithDoubleArray', [key, value, processLegalBasis]);
191
191
  }
192
192
 
193
- exports.setUserAttributeWithBooleanArray = function (key, value) {
194
- exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithBooleanArray', [key, value]);
193
+ exports.setUserAttributeWithBooleanArray = function (key, value, processLegalBasis) {
194
+ exec(() => {}, defaultError, 'Purchasely', 'setUserAttributeWithBooleanArray', [key, value, processLegalBasis]);
195
195
  }
196
196
 
197
197
  exports.userAttribute = function (key, success, error) {
@@ -222,6 +222,10 @@ exports.setThemeMode = function (mode) {
222
222
  exec(() => {}, defaultError, 'Purchasely', 'setThemeMode', [mode]);
223
223
  };
224
224
 
225
+ exports.revokeDataProcessingConsent = function (purposes) {
226
+ exec(() => {}, defaultError, 'Purchasely', 'revokeDataProcessingConsent', [purposes]);
227
+ }
228
+
225
229
  exports.LogLevel = {
226
230
  DEBUG: 0,
227
231
  INFO: 1,
@@ -253,6 +257,20 @@ exports.Attribute = {
253
257
  BATCH_CUSTOM_USER_ID: 20,
254
258
  }
255
259
 
260
+ exports.DataProcessingLegalBasis = {
261
+ essential: 'ESSENTIAL',
262
+ optional: 'OPTIONAL'
263
+ }
264
+
265
+ exports.DataProcessingPurpose = {
266
+ allNonEssentials: 'ALL_NON_ESSENTIALS',
267
+ analytics: 'ANALYTICS',
268
+ identifiedAnalytics: 'IDENTIFIED_ANALYTICS',
269
+ campaigns: 'CAMPAIGNS',
270
+ personalization: 'PERSONALIZATION',
271
+ thirdPartyIntegrations: 'THIRD_PARTY_INTEGRATIONS'
272
+ }
273
+
256
274
  exports.PurchaseResult = {
257
275
  PURCHASED: 0,
258
276
  CANCELLED: 1,
@@ -275,7 +293,6 @@ exports.PlanType = {
275
293
  unknown: 4
276
294
  }
277
295
 
278
-
279
296
  exports.RunningMode = {
280
297
  paywallObserver: 2,
281
298
  full: 3