@purchasely/cordova-plugin-purchasely 5.3.0 → 5.4.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/example/android.sh +1 -1
- package/example/package-lock.json +52 -27
- package/example/package.json +5 -5
- package/example/www/js/index.js +8 -6
- package/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/PLYProductActivity.kt +2 -0
- package/src/android/PurchaselyPlugin.kt +90 -27
- package/src/ios/CDVPurchasely.m +102 -9
- package/www/Purchasely.js +37 -20
package/example/android.sh
CHANGED
|
@@ -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@
|
|
6
|
+
cordova platform add android@14.0.0
|
|
7
7
|
cordova plugin add ../ --link
|
|
8
8
|
cordova plugin add ../../purchasely-google/ --link
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@purchasely/cordova-plugin-puchasely-google": "file:../../purchasely-google",
|
|
13
13
|
"@purchasely/cordova-plugin-purchasely": "file:..",
|
|
14
|
-
"cordova-android": "^
|
|
14
|
+
"cordova-android": "^14.0.0",
|
|
15
15
|
"cordova-ios": "^7.0.1",
|
|
16
16
|
"cordova-plugin-puchasely-google": "file:../../purchasely-google",
|
|
17
17
|
"cordova-plugin-purchasely": "file:.."
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"..": {
|
|
21
21
|
"name": "@purchasely/cordova-plugin-purchasely",
|
|
22
|
-
"version": "5.
|
|
22
|
+
"version": "5.4.0",
|
|
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.
|
|
36
|
+
"version": "5.4.0",
|
|
37
37
|
"dev": true,
|
|
38
38
|
"license": "ISC"
|
|
39
39
|
},
|
|
@@ -235,28 +235,53 @@
|
|
|
235
235
|
"license": "MIT"
|
|
236
236
|
},
|
|
237
237
|
"node_modules/cordova-android": {
|
|
238
|
-
"version": "
|
|
239
|
-
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-
|
|
240
|
-
"integrity": "sha512-
|
|
238
|
+
"version": "14.0.0",
|
|
239
|
+
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-14.0.0.tgz",
|
|
240
|
+
"integrity": "sha512-aPlN2aBfC/OlZOlCR66x9GYBfnHTlmm2Dd1eYcqB+Mwm0wJFlA272psHmfiMqA5VRT5UpFyCQ5x6B1YA9h2uHg==",
|
|
241
241
|
"dev": true,
|
|
242
242
|
"license": "Apache-2.0",
|
|
243
243
|
"dependencies": {
|
|
244
|
-
"android-versions": "^2.
|
|
245
|
-
"cordova-common": "^5.0.
|
|
244
|
+
"android-versions": "^2.1.0",
|
|
245
|
+
"cordova-common": "^5.0.1",
|
|
246
246
|
"dedent": "^1.5.3",
|
|
247
247
|
"execa": "^5.1.1",
|
|
248
|
-
"fast-glob": "^3.3.
|
|
249
|
-
"fs-extra": "^11.2.0",
|
|
248
|
+
"fast-glob": "^3.3.3",
|
|
250
249
|
"is-path-inside": "^3.0.3",
|
|
251
|
-
"nopt": "^
|
|
250
|
+
"nopt": "^8.1.0",
|
|
252
251
|
"properties-parser": "^0.6.0",
|
|
253
|
-
"semver": "^7.
|
|
252
|
+
"semver": "^7.7.1",
|
|
254
253
|
"string-argv": "^0.3.1",
|
|
255
254
|
"untildify": "^4.0.0",
|
|
256
|
-
"which": "^
|
|
255
|
+
"which": "^5.0.0"
|
|
257
256
|
},
|
|
258
257
|
"engines": {
|
|
259
|
-
"node": ">=
|
|
258
|
+
"node": ">=20.5.0"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"node_modules/cordova-android/node_modules/abbrev": {
|
|
262
|
+
"version": "3.0.1",
|
|
263
|
+
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz",
|
|
264
|
+
"integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==",
|
|
265
|
+
"dev": true,
|
|
266
|
+
"license": "ISC",
|
|
267
|
+
"engines": {
|
|
268
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"node_modules/cordova-android/node_modules/nopt": {
|
|
272
|
+
"version": "8.1.0",
|
|
273
|
+
"resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz",
|
|
274
|
+
"integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==",
|
|
275
|
+
"dev": true,
|
|
276
|
+
"license": "ISC",
|
|
277
|
+
"dependencies": {
|
|
278
|
+
"abbrev": "^3.0.0"
|
|
279
|
+
},
|
|
280
|
+
"bin": {
|
|
281
|
+
"nopt": "bin/nopt.js"
|
|
282
|
+
},
|
|
283
|
+
"engines": {
|
|
284
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
260
285
|
}
|
|
261
286
|
},
|
|
262
287
|
"node_modules/cordova-common": {
|
|
@@ -376,9 +401,9 @@
|
|
|
376
401
|
}
|
|
377
402
|
},
|
|
378
403
|
"node_modules/dedent": {
|
|
379
|
-
"version": "1.
|
|
380
|
-
"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.
|
|
381
|
-
"integrity": "sha512-
|
|
404
|
+
"version": "1.7.0",
|
|
405
|
+
"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz",
|
|
406
|
+
"integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==",
|
|
382
407
|
"dev": true,
|
|
383
408
|
"license": "MIT",
|
|
384
409
|
"peerDependencies": {
|
|
@@ -504,9 +529,9 @@
|
|
|
504
529
|
}
|
|
505
530
|
},
|
|
506
531
|
"node_modules/fs-extra": {
|
|
507
|
-
"version": "11.3.
|
|
508
|
-
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.
|
|
509
|
-
"integrity": "sha512-
|
|
532
|
+
"version": "11.3.2",
|
|
533
|
+
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz",
|
|
534
|
+
"integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==",
|
|
510
535
|
"dev": true,
|
|
511
536
|
"license": "MIT",
|
|
512
537
|
"dependencies": {
|
|
@@ -774,9 +799,9 @@
|
|
|
774
799
|
}
|
|
775
800
|
},
|
|
776
801
|
"node_modules/jsonfile": {
|
|
777
|
-
"version": "6.
|
|
778
|
-
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.
|
|
779
|
-
"integrity": "sha512-
|
|
802
|
+
"version": "6.2.0",
|
|
803
|
+
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
|
|
804
|
+
"integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
|
|
780
805
|
"dev": true,
|
|
781
806
|
"license": "MIT",
|
|
782
807
|
"dependencies": {
|
|
@@ -1346,9 +1371,9 @@
|
|
|
1346
1371
|
}
|
|
1347
1372
|
},
|
|
1348
1373
|
"node_modules/which": {
|
|
1349
|
-
"version": "
|
|
1350
|
-
"resolved": "https://registry.npmjs.org/which/-/which-
|
|
1351
|
-
"integrity": "sha512-
|
|
1374
|
+
"version": "5.0.0",
|
|
1375
|
+
"resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz",
|
|
1376
|
+
"integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==",
|
|
1352
1377
|
"dev": true,
|
|
1353
1378
|
"license": "ISC",
|
|
1354
1379
|
"dependencies": {
|
|
@@ -1358,7 +1383,7 @@
|
|
|
1358
1383
|
"node-which": "bin/which.js"
|
|
1359
1384
|
},
|
|
1360
1385
|
"engines": {
|
|
1361
|
-
"node": "^
|
|
1386
|
+
"node": "^18.17.0 || >=20.5.0"
|
|
1362
1387
|
}
|
|
1363
1388
|
},
|
|
1364
1389
|
"node_modules/with-open-file": {
|
package/example/package.json
CHANGED
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@purchasely/cordova-plugin-puchasely-google": "file:../../purchasely-google",
|
|
17
17
|
"@purchasely/cordova-plugin-purchasely": "file:..",
|
|
18
|
-
"cordova-android": "^
|
|
18
|
+
"cordova-android": "^14.0.0",
|
|
19
19
|
"cordova-ios": "^7.0.1",
|
|
20
20
|
"cordova-plugin-puchasely-google": "file:../../purchasely-google",
|
|
21
21
|
"cordova-plugin-purchasely": "file:.."
|
|
22
22
|
},
|
|
23
23
|
"cordova": {
|
|
24
24
|
"plugins": {
|
|
25
|
-
"@purchasely/cordova-plugin-
|
|
26
|
-
"@purchasely/cordova-plugin-
|
|
25
|
+
"@purchasely/cordova-plugin-purchasely": {},
|
|
26
|
+
"@purchasely/cordova-plugin-puchasely-google": {}
|
|
27
27
|
},
|
|
28
28
|
"platforms": [
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"ios",
|
|
30
|
+
"android"
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
}
|
package/example/www/js/index.js
CHANGED
|
@@ -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
|
+
"version": "5.4.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="5.
|
|
2
|
+
<plugin id="@purchasely/cordova-plugin-purchasely" version="5.4.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" />
|
|
@@ -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.
|
|
41
|
+
<pod name="Purchasely" spec="5.4.1"/>
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/src/ios/CDVPurchasely.m
CHANGED
|
@@ -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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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.
|
|
8
|
+
cordovaSdkVersion = "5.4.0";
|
|
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
|