@didomi/react-native 1.11.1 → 1.13.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/android/build.gradle +14 -22
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +6 -4
- package/android/gradlew +154 -103
- package/android/gradlew.bat +7 -18
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +186 -111
- package/ios/Didomi.m +4 -13
- package/ios/Didomi.xcodeproj/project.pbxproj +4 -4
- package/ios/RNDidomi.swift +23 -38
- package/lib/commonjs/Constants.js +3 -3
- package/lib/commonjs/Constants.js.map +1 -1
- package/lib/commonjs/Didomi.js +18 -65
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiListener.js +16 -18
- package/lib/commonjs/DidomiListener.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js +0 -1
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/commonjs/index.js +0 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Constants.js +3 -3
- package/lib/module/Constants.js.map +1 -1
- package/lib/module/Didomi.js +18 -60
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiListener.js +16 -15
- package/lib/module/DidomiListener.js.map +1 -1
- package/lib/module/DidomiTypes.js +0 -1
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/Constants.d.ts +1 -1
- package/lib/typescript/Didomi.d.ts +9 -9
- package/lib/typescript/DidomiListener.d.ts +2 -2
- package/package.json +6 -7
- package/react-native-didomi.podspec +2 -2
- package/src/Constants.ts +1 -1
- package/src/Didomi.ts +10 -2
- package/src/DidomiListener.ts +24 -14
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@file:Suppress("unused")
|
|
2
|
+
|
|
1
3
|
package com.reactnativedidomi
|
|
2
4
|
|
|
3
5
|
import android.util.Log
|
|
@@ -213,8 +215,9 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
213
215
|
private fun ReadableArray.toSet(): Set<String> {
|
|
214
216
|
val set = mutableSetOf<String>()
|
|
215
217
|
|
|
216
|
-
for (i in 0 until size())
|
|
217
|
-
set.add(getString(i)
|
|
218
|
+
for (i in 0 until size()) {
|
|
219
|
+
set.add(getString(i).orEmpty())
|
|
220
|
+
}
|
|
218
221
|
|
|
219
222
|
return set
|
|
220
223
|
}
|
|
@@ -245,7 +248,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
245
248
|
val map = WritableNativeMap()
|
|
246
249
|
obj?.serializeToMap()?.entries?.forEach { entry ->
|
|
247
250
|
when (val value = entry.value) {
|
|
248
|
-
is Map
|
|
251
|
+
is Map<*, *> -> map.putMap(entry.key, objectToWritableMap(value))
|
|
249
252
|
is List<*> -> map.putArray(entry.key, Arguments.fromList(value))
|
|
250
253
|
else -> map.putString(entry.key, value.toString())
|
|
251
254
|
}
|
|
@@ -266,7 +269,8 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
266
269
|
noticeId: String?,
|
|
267
270
|
androidTvNoticeId: String?,
|
|
268
271
|
androidTvEnabled: Boolean,
|
|
269
|
-
promise: Promise
|
|
272
|
+
promise: Promise
|
|
273
|
+
) {
|
|
270
274
|
try {
|
|
271
275
|
Didomi.getInstance().addEventListener(eventListener)
|
|
272
276
|
|
|
@@ -287,9 +291,6 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
287
291
|
val application = currentActivity?.application ?: throw IllegalStateException("No activity present")
|
|
288
292
|
Didomi.getInstance().initialize(application, parameters)
|
|
289
293
|
|
|
290
|
-
Didomi.getInstance().onReady { prepareEvent(EventTypes.READY_CALLBACK.event, null) }
|
|
291
|
-
Didomi.getInstance().onError { prepareEvent(EventTypes.ERROR_CALLBACK.event, null) }
|
|
292
|
-
|
|
293
294
|
promise.resolve(0)
|
|
294
295
|
|
|
295
296
|
} catch (e: Exception) {
|
|
@@ -298,6 +299,18 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
|
|
302
|
+
@ReactMethod
|
|
303
|
+
fun onReady(promise: Promise) {
|
|
304
|
+
Didomi.getInstance().onReady { prepareEvent(EventTypes.READY_CALLBACK.event, null) }
|
|
305
|
+
promise.resolve(0)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@ReactMethod
|
|
309
|
+
fun onError(promise: Promise) {
|
|
310
|
+
Didomi.getInstance().onError { prepareEvent(EventTypes.ERROR_CALLBACK.event, null) }
|
|
311
|
+
promise.resolve(0)
|
|
312
|
+
}
|
|
313
|
+
|
|
301
314
|
@ReactMethod
|
|
302
315
|
fun setupUI(promise: Promise) {
|
|
303
316
|
try {
|
|
@@ -313,20 +326,23 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
313
326
|
|
|
314
327
|
@ReactMethod
|
|
315
328
|
fun setLogLevel(level: Int, promise: Promise) {
|
|
316
|
-
Didomi.getInstance().setLogLevel(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
Didomi.getInstance().setLogLevel(
|
|
330
|
+
when (level) {
|
|
331
|
+
0 -> Log.INFO
|
|
332
|
+
1 -> Log.DEBUG
|
|
333
|
+
2 -> Log.WARN
|
|
334
|
+
3 -> Log.ERROR
|
|
335
|
+
4 -> Log.VERBOSE
|
|
336
|
+
else -> Log.WARN
|
|
337
|
+
}
|
|
338
|
+
)
|
|
324
339
|
promise.resolve(0)
|
|
325
340
|
}
|
|
326
341
|
|
|
327
342
|
@ReactMethod
|
|
328
343
|
fun getDisabledPurposes(promise: Promise) {
|
|
329
344
|
try {
|
|
345
|
+
@Suppress("DEPRECATION")
|
|
330
346
|
promise.resolve(setToWritableArray(Didomi.getInstance().disabledPurposes))
|
|
331
347
|
} catch (e: DidomiNotReadyException) {
|
|
332
348
|
promise.reject(e)
|
|
@@ -336,6 +352,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
336
352
|
@ReactMethod
|
|
337
353
|
fun getDisabledPurposeIds(promise: Promise) {
|
|
338
354
|
try {
|
|
355
|
+
@Suppress("DEPRECATION")
|
|
339
356
|
promise.resolve(setOfStringToWritableArray(Didomi.getInstance().disabledPurposeIds))
|
|
340
357
|
} catch (e: DidomiNotReadyException) {
|
|
341
358
|
promise.reject(e)
|
|
@@ -345,6 +362,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
345
362
|
@ReactMethod
|
|
346
363
|
fun getDisabledVendors(promise: Promise) {
|
|
347
364
|
try {
|
|
365
|
+
@Suppress("DEPRECATION")
|
|
348
366
|
promise.resolve(setToWritableArray(Didomi.getInstance().disabledVendors))
|
|
349
367
|
} catch (e: DidomiNotReadyException) {
|
|
350
368
|
promise.reject(e)
|
|
@@ -354,6 +372,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
354
372
|
@ReactMethod
|
|
355
373
|
fun getDisabledVendorIds(promise: Promise) {
|
|
356
374
|
try {
|
|
375
|
+
@Suppress("DEPRECATION")
|
|
357
376
|
promise.resolve(setOfStringToWritableArray(Didomi.getInstance().disabledVendorIds))
|
|
358
377
|
} catch (e: DidomiNotReadyException) {
|
|
359
378
|
promise.reject(e)
|
|
@@ -363,6 +382,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
363
382
|
@ReactMethod
|
|
364
383
|
fun getEnabledPurposes(promise: Promise) {
|
|
365
384
|
try {
|
|
385
|
+
@Suppress("DEPRECATION")
|
|
366
386
|
promise.resolve(setToWritableArray(Didomi.getInstance().enabledPurposes))
|
|
367
387
|
} catch (e: DidomiNotReadyException) {
|
|
368
388
|
promise.reject(e)
|
|
@@ -372,6 +392,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
372
392
|
@ReactMethod
|
|
373
393
|
fun getEnabledPurposeIds(promise: Promise) {
|
|
374
394
|
try {
|
|
395
|
+
@Suppress("DEPRECATION")
|
|
375
396
|
promise.resolve(setOfStringToWritableArray(Didomi.getInstance().enabledPurposeIds))
|
|
376
397
|
} catch (e: DidomiNotReadyException) {
|
|
377
398
|
promise.reject(e)
|
|
@@ -381,6 +402,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
381
402
|
@ReactMethod
|
|
382
403
|
fun getEnabledVendors(promise: Promise) {
|
|
383
404
|
try {
|
|
405
|
+
@Suppress("DEPRECATION")
|
|
384
406
|
promise.resolve(setToWritableArray(Didomi.getInstance().enabledVendors))
|
|
385
407
|
} catch (e: DidomiNotReadyException) {
|
|
386
408
|
promise.reject(e)
|
|
@@ -390,6 +412,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
390
412
|
@ReactMethod
|
|
391
413
|
fun getEnabledVendorIds(promise: Promise) {
|
|
392
414
|
try {
|
|
415
|
+
@Suppress("DEPRECATION")
|
|
393
416
|
promise.resolve(setOfStringToWritableArray(Didomi.getInstance().enabledVendorIds))
|
|
394
417
|
} catch (e: DidomiNotReadyException) {
|
|
395
418
|
promise.reject(e)
|
|
@@ -399,12 +422,11 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
399
422
|
@ReactMethod
|
|
400
423
|
fun getJavaScriptForWebView(extra: String?, promise: Promise) {
|
|
401
424
|
try {
|
|
402
|
-
extra?.
|
|
425
|
+
extra?.also {
|
|
403
426
|
promise.resolve(Didomi.getInstance().getJavaScriptForWebView(extra))
|
|
404
427
|
} ?: run {
|
|
405
428
|
promise.resolve(Didomi.getInstance().getJavaScriptForWebView())
|
|
406
429
|
}
|
|
407
|
-
|
|
408
430
|
} catch (e: DidomiNotReadyException) {
|
|
409
431
|
promise.reject(e)
|
|
410
432
|
}
|
|
@@ -492,6 +514,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
492
514
|
@ReactMethod
|
|
493
515
|
fun getUserConsentStatusForPurpose(purposeId: String, promise: Promise) {
|
|
494
516
|
try {
|
|
517
|
+
@Suppress("DEPRECATION")
|
|
495
518
|
promise.resolve(Didomi.getInstance().getUserConsentStatusForPurpose(purposeId))
|
|
496
519
|
} catch (e: DidomiNotReadyException) {
|
|
497
520
|
promise.reject(e)
|
|
@@ -501,6 +524,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
501
524
|
@ReactMethod
|
|
502
525
|
fun getUserConsentStatusForVendor(vendorId: String, promise: Promise) {
|
|
503
526
|
try {
|
|
527
|
+
@Suppress("DEPRECATION")
|
|
504
528
|
promise.resolve(Didomi.getInstance().getUserConsentStatusForVendor(vendorId))
|
|
505
529
|
} catch (e: DidomiNotReadyException) {
|
|
506
530
|
promise.reject(e)
|
|
@@ -510,6 +534,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
510
534
|
@ReactMethod
|
|
511
535
|
fun getUserConsentStatusForVendorAndRequiredPurposes(vendorId: String, promise: Promise) {
|
|
512
536
|
try {
|
|
537
|
+
@Suppress("DEPRECATION")
|
|
513
538
|
promise.resolve(Didomi.getInstance().getUserConsentStatusForVendorAndRequiredPurposes(vendorId))
|
|
514
539
|
} catch (e: DidomiNotReadyException) {
|
|
515
540
|
promise.reject(e)
|
|
@@ -519,6 +544,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
519
544
|
@ReactMethod
|
|
520
545
|
fun getUserLegitimateInterestStatusForPurpose(purposeId: String, promise: Promise) {
|
|
521
546
|
try {
|
|
547
|
+
@Suppress("DEPRECATION")
|
|
522
548
|
promise.resolve(Didomi.getInstance().getUserLegitimateInterestStatusForPurpose(purposeId))
|
|
523
549
|
} catch (e: DidomiNotReadyException) {
|
|
524
550
|
promise.reject(e)
|
|
@@ -528,6 +554,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
528
554
|
@ReactMethod
|
|
529
555
|
fun getUserLegitimateInterestForVendor(vendorId: String, promise: Promise) {
|
|
530
556
|
try {
|
|
557
|
+
@Suppress("DEPRECATION")
|
|
531
558
|
promise.resolve(Didomi.getInstance().getUserLegitimateInterestStatusForVendor(vendorId))
|
|
532
559
|
} catch (e: DidomiNotReadyException) {
|
|
533
560
|
promise.reject(e)
|
|
@@ -537,6 +564,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
537
564
|
@ReactMethod
|
|
538
565
|
fun getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId: String, promise: Promise) {
|
|
539
566
|
try {
|
|
567
|
+
@Suppress("DEPRECATION")
|
|
540
568
|
promise.resolve(Didomi.getInstance().getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId))
|
|
541
569
|
} catch (e: DidomiNotReadyException) {
|
|
542
570
|
promise.reject(e)
|
|
@@ -555,6 +583,7 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
555
583
|
@ReactMethod
|
|
556
584
|
fun getUserStatusForVendor(vendorId: String, promise: Promise) {
|
|
557
585
|
try {
|
|
586
|
+
@Suppress("DEPRECATION")
|
|
558
587
|
promise.resolve(Didomi.getInstance().getUserStatusForVendor(vendorId))
|
|
559
588
|
} catch (e: DidomiNotReadyException) {
|
|
560
589
|
promise.reject(e)
|
|
@@ -643,22 +672,26 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
643
672
|
}
|
|
644
673
|
|
|
645
674
|
@ReactMethod
|
|
646
|
-
fun setUser(
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
675
|
+
fun setUser(
|
|
676
|
+
organizationUserId: String,
|
|
677
|
+
organizationUserIdAuthAlgorithm: String?,
|
|
678
|
+
organizationUserIdAuthSid: String?,
|
|
679
|
+
organizationUserIdAuthSalt: String?,
|
|
680
|
+
organizationUserIdAuthDigest: String?,
|
|
681
|
+
promise: Promise
|
|
682
|
+
) {
|
|
652
683
|
if (organizationUserIdAuthAlgorithm != null
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
684
|
+
&& organizationUserIdAuthSid != null
|
|
685
|
+
&& organizationUserIdAuthSalt != null
|
|
686
|
+
&& organizationUserIdAuthDigest != null
|
|
687
|
+
) {
|
|
688
|
+
@Suppress("DEPRECATION")
|
|
656
689
|
Didomi.getInstance().setUser(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
690
|
+
organizationUserId,
|
|
691
|
+
organizationUserIdAuthAlgorithm,
|
|
692
|
+
organizationUserIdAuthSid,
|
|
693
|
+
organizationUserIdAuthSalt,
|
|
694
|
+
organizationUserIdAuthDigest
|
|
662
695
|
)
|
|
663
696
|
} else {
|
|
664
697
|
Didomi.getInstance().setUser(organizationUserId)
|
|
@@ -674,12 +707,14 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
674
707
|
}
|
|
675
708
|
|
|
676
709
|
@ReactMethod
|
|
677
|
-
fun setUserWithHashAuth(
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
710
|
+
fun setUserWithHashAuth(
|
|
711
|
+
organizationUserId: String,
|
|
712
|
+
algorithm: String,
|
|
713
|
+
secretId: String,
|
|
714
|
+
digest: String,
|
|
715
|
+
salt: String?,
|
|
716
|
+
promise: Promise
|
|
717
|
+
) {
|
|
683
718
|
Didomi.getInstance().setUser(
|
|
684
719
|
UserAuthWithHashParams(
|
|
685
720
|
organizationUserId,
|
|
@@ -693,12 +728,14 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
693
728
|
}
|
|
694
729
|
|
|
695
730
|
@ReactMethod
|
|
696
|
-
fun setUserWithHashAuthAndSetupUI(
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
731
|
+
fun setUserWithHashAuthAndSetupUI(
|
|
732
|
+
organizationUserId: String,
|
|
733
|
+
algorithm: String,
|
|
734
|
+
secretId: String,
|
|
735
|
+
digest: String,
|
|
736
|
+
salt: String?,
|
|
737
|
+
promise: Promise
|
|
738
|
+
) {
|
|
702
739
|
Didomi.getInstance().setUser(
|
|
703
740
|
UserAuthWithHashParams(
|
|
704
741
|
organizationUserId,
|
|
@@ -713,13 +750,15 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
713
750
|
}
|
|
714
751
|
|
|
715
752
|
@ReactMethod
|
|
716
|
-
fun setUserWithHashAuthWithExpiration(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
753
|
+
fun setUserWithHashAuthWithExpiration(
|
|
754
|
+
organizationUserId: String,
|
|
755
|
+
algorithm: String,
|
|
756
|
+
secretId: String,
|
|
757
|
+
digest: String,
|
|
758
|
+
salt: String?,
|
|
759
|
+
expiration: Int,
|
|
760
|
+
promise: Promise
|
|
761
|
+
) {
|
|
723
762
|
Didomi.getInstance().setUser(
|
|
724
763
|
UserAuthWithHashParams(
|
|
725
764
|
organizationUserId,
|
|
@@ -734,13 +773,15 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
734
773
|
}
|
|
735
774
|
|
|
736
775
|
@ReactMethod
|
|
737
|
-
fun setUserWithHashAuthWithExpirationAndSetupUI(
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
776
|
+
fun setUserWithHashAuthWithExpirationAndSetupUI(
|
|
777
|
+
organizationUserId: String,
|
|
778
|
+
algorithm: String,
|
|
779
|
+
secretId: String,
|
|
780
|
+
digest: String,
|
|
781
|
+
salt: String?,
|
|
782
|
+
expiration: Int,
|
|
783
|
+
promise: Promise
|
|
784
|
+
) {
|
|
744
785
|
Didomi.getInstance().setUser(
|
|
745
786
|
UserAuthWithHashParams(
|
|
746
787
|
organizationUserId,
|
|
@@ -756,11 +797,13 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
756
797
|
}
|
|
757
798
|
|
|
758
799
|
@ReactMethod
|
|
759
|
-
fun setUserWithEncryptionAuth(
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
800
|
+
fun setUserWithEncryptionAuth(
|
|
801
|
+
organizationUserId: String,
|
|
802
|
+
algorithm: String,
|
|
803
|
+
secretId: String,
|
|
804
|
+
initializationVector: String,
|
|
805
|
+
promise: Promise
|
|
806
|
+
) {
|
|
764
807
|
Didomi.getInstance().setUser(
|
|
765
808
|
UserAuthWithEncryptionParams(
|
|
766
809
|
organizationUserId,
|
|
@@ -773,11 +816,13 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
773
816
|
}
|
|
774
817
|
|
|
775
818
|
@ReactMethod
|
|
776
|
-
fun setUserWithEncryptionAuthAndSetupUI(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
819
|
+
fun setUserWithEncryptionAuthAndSetupUI(
|
|
820
|
+
organizationUserId: String,
|
|
821
|
+
algorithm: String,
|
|
822
|
+
secretId: String,
|
|
823
|
+
initializationVector: String,
|
|
824
|
+
promise: Promise
|
|
825
|
+
) {
|
|
781
826
|
Didomi.getInstance().setUser(
|
|
782
827
|
UserAuthWithEncryptionParams(
|
|
783
828
|
organizationUserId,
|
|
@@ -791,12 +836,14 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
791
836
|
}
|
|
792
837
|
|
|
793
838
|
@ReactMethod
|
|
794
|
-
fun setUserWithEncryptionAuthWithExpiration(
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
839
|
+
fun setUserWithEncryptionAuthWithExpiration(
|
|
840
|
+
organizationUserId: String,
|
|
841
|
+
algorithm: String,
|
|
842
|
+
secretId: String,
|
|
843
|
+
initializationVector: String,
|
|
844
|
+
expiration: Int,
|
|
845
|
+
promise: Promise
|
|
846
|
+
) {
|
|
800
847
|
Didomi.getInstance().setUser(
|
|
801
848
|
UserAuthWithEncryptionParams(
|
|
802
849
|
organizationUserId,
|
|
@@ -810,12 +857,14 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
810
857
|
}
|
|
811
858
|
|
|
812
859
|
@ReactMethod
|
|
813
|
-
fun setUserWithEncryptionAuthWithExpirationAndSetupUI(
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
860
|
+
fun setUserWithEncryptionAuthWithExpirationAndSetupUI(
|
|
861
|
+
organizationUserId: String,
|
|
862
|
+
algorithm: String,
|
|
863
|
+
secretId: String,
|
|
864
|
+
initializationVector: String,
|
|
865
|
+
expiration: Int,
|
|
866
|
+
promise: Promise
|
|
867
|
+
) {
|
|
819
868
|
Didomi.getInstance().setUser(
|
|
820
869
|
UserAuthWithEncryptionParams(
|
|
821
870
|
organizationUserId,
|
|
@@ -878,17 +927,20 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
878
927
|
|
|
879
928
|
@ReactMethod
|
|
880
929
|
@Deprecated("Deprecated in the Didomi API")
|
|
881
|
-
fun setUserConsentStatus(
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
930
|
+
fun setUserConsentStatus(
|
|
931
|
+
enabledPurposeIds: ReadableArray,
|
|
932
|
+
disabledPurposeIds: ReadableArray,
|
|
933
|
+
enabledLegitimatePurposeIds: ReadableArray,
|
|
934
|
+
disabledLegitimatePurposeIds: ReadableArray,
|
|
935
|
+
enabledVendorIds: ReadableArray,
|
|
936
|
+
disabledVendorIds: ReadableArray,
|
|
937
|
+
enabledLegIntVendorIds: ReadableArray,
|
|
938
|
+
disabledLegIntVendorIds: ReadableArray,
|
|
939
|
+
promise: Promise
|
|
940
|
+
) {
|
|
941
|
+
try {
|
|
942
|
+
promise.resolve(
|
|
943
|
+
Didomi.getInstance().setUserStatus(
|
|
892
944
|
enabledPurposeIds.toSet(),
|
|
893
945
|
disabledPurposeIds.toSet(),
|
|
894
946
|
enabledLegitimatePurposeIds.toSet(),
|
|
@@ -896,7 +948,9 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
896
948
|
enabledVendorIds.toSet(),
|
|
897
949
|
disabledVendorIds.toSet(),
|
|
898
950
|
enabledLegIntVendorIds.toSet(),
|
|
899
|
-
disabledLegIntVendorIds.toSet()
|
|
951
|
+
disabledLegIntVendorIds.toSet()
|
|
952
|
+
)
|
|
953
|
+
)
|
|
900
954
|
} catch (e: DidomiNotReadyException) {
|
|
901
955
|
promise.reject(e)
|
|
902
956
|
}
|
|
@@ -912,34 +966,42 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
912
966
|
}
|
|
913
967
|
|
|
914
968
|
@ReactMethod
|
|
915
|
-
fun setUserStatus(
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
969
|
+
fun setUserStatus(
|
|
970
|
+
purposesConsentStatus: Boolean,
|
|
971
|
+
purposesLIStatus: Boolean,
|
|
972
|
+
vendorsConsentStatus: Boolean,
|
|
973
|
+
vendorsLIStatus: Boolean,
|
|
974
|
+
promise: Promise
|
|
975
|
+
) {
|
|
920
976
|
try {
|
|
921
|
-
promise.resolve(
|
|
977
|
+
promise.resolve(
|
|
978
|
+
Didomi.getInstance().setUserStatus(
|
|
922
979
|
purposesConsentStatus,
|
|
923
980
|
purposesLIStatus,
|
|
924
981
|
vendorsConsentStatus,
|
|
925
|
-
vendorsLIStatus
|
|
982
|
+
vendorsLIStatus
|
|
983
|
+
)
|
|
984
|
+
)
|
|
926
985
|
} catch (e: DidomiNotReadyException) {
|
|
927
986
|
promise.reject(e)
|
|
928
987
|
}
|
|
929
988
|
}
|
|
930
989
|
|
|
931
990
|
@ReactMethod
|
|
932
|
-
fun setUserStatusSets(
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
991
|
+
fun setUserStatusSets(
|
|
992
|
+
enabledConsentPurposeIds: ReadableArray,
|
|
993
|
+
disabledConsentPurposeIds: ReadableArray,
|
|
994
|
+
enabledLIPurposeIds: ReadableArray,
|
|
995
|
+
disabledLIPurposeIds: ReadableArray,
|
|
996
|
+
enabledConsentVendorIds: ReadableArray,
|
|
997
|
+
disabledConsentVendorIds: ReadableArray,
|
|
998
|
+
enabledLIVendorIds: ReadableArray,
|
|
999
|
+
disabledLIVendorIds: ReadableArray,
|
|
1000
|
+
promise: Promise
|
|
1001
|
+
) {
|
|
941
1002
|
try {
|
|
942
|
-
promise.resolve(
|
|
1003
|
+
promise.resolve(
|
|
1004
|
+
Didomi.getInstance().setUserStatus(
|
|
943
1005
|
enabledConsentPurposeIds.toSet(),
|
|
944
1006
|
disabledConsentPurposeIds.toSet(),
|
|
945
1007
|
enabledLIPurposeIds.toSet(),
|
|
@@ -948,7 +1010,8 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
948
1010
|
disabledConsentVendorIds.toSet(),
|
|
949
1011
|
enabledLIVendorIds.toSet(),
|
|
950
1012
|
disabledLIVendorIds.toSet()
|
|
951
|
-
|
|
1013
|
+
)
|
|
1014
|
+
)
|
|
952
1015
|
} catch (e: DidomiNotReadyException) {
|
|
953
1016
|
promise.reject(e)
|
|
954
1017
|
}
|
|
@@ -973,10 +1036,22 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
973
1036
|
}
|
|
974
1037
|
}
|
|
975
1038
|
|
|
1039
|
+
@Suppress("UNUSED_PARAMETER")
|
|
1040
|
+
@ReactMethod
|
|
1041
|
+
fun addListener(eventName: String) {
|
|
1042
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
@Suppress("UNUSED_PARAMETER")
|
|
1046
|
+
@ReactMethod
|
|
1047
|
+
fun removeListeners(count: Int) {
|
|
1048
|
+
// Keep: Required for RN built in Event Emitter Calls.
|
|
1049
|
+
}
|
|
1050
|
+
|
|
976
1051
|
private fun prepareEvent(eventName: String, params: String?) {
|
|
977
1052
|
Log.d("prepareEvent", "Sending $eventName")
|
|
978
1053
|
reactContext
|
|
979
|
-
|
|
980
|
-
|
|
1054
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
1055
|
+
.emit(eventName, params)
|
|
981
1056
|
}
|
|
982
1057
|
}
|
package/ios/Didomi.m
CHANGED
|
@@ -17,9 +17,11 @@ RCT_EXTERN_METHOD(initialize:(NSString *)userAgentName
|
|
|
17
17
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
18
18
|
reject:(RCTPromiseRejectBlock)reject)
|
|
19
19
|
|
|
20
|
-
RCT_EXTERN_METHOD(onReady)
|
|
20
|
+
RCT_EXTERN_METHOD(onReady:(RCTPromiseResolveBlock)resolve
|
|
21
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
21
22
|
|
|
22
|
-
RCT_EXTERN_METHOD(onError)
|
|
23
|
+
RCT_EXTERN_METHOD(onError:(RCTPromiseResolveBlock)resolve
|
|
24
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
23
25
|
|
|
24
26
|
RCT_EXTERN_METHOD(getQueryStringForWebView:(RCTPromiseResolveBlock)resolve
|
|
25
27
|
reject:(RCTPromiseRejectBlock)reject)
|
|
@@ -162,17 +164,6 @@ RCT_EXTERN_METHOD(updateSelectedLanguage:(NSString *)languageCode
|
|
|
162
164
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
163
165
|
reject:(RCTPromiseRejectBlock)reject)
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
// MARK: ViewProviderDelegate
|
|
167
|
-
|
|
168
|
-
RCT_EXTERN_METHOD(getNoticeViewController:(NSString *)position
|
|
169
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
170
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
171
|
-
|
|
172
|
-
RCT_EXTERN_METHOD(getPreferencesViewController:(RCTPromiseResolveBlock)resolve
|
|
173
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
174
|
-
|
|
175
|
-
|
|
176
167
|
// MARK: Didomi extension
|
|
177
168
|
|
|
178
169
|
RCT_EXTERN_METHOD(setupUI:(RCTPromiseResolveBlock)resolve
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
isa = XCBuildConfiguration;
|
|
137
137
|
buildSettings = {
|
|
138
138
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
139
|
-
CLANG_CXX_LANGUAGE_STANDARD = "
|
|
139
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
|
140
140
|
CLANG_CXX_LIBRARY = "libc++";
|
|
141
141
|
CLANG_ENABLE_MODULES = YES;
|
|
142
142
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
176
176
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
177
177
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
178
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
178
|
+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
|
179
179
|
MTL_ENABLE_DEBUG_INFO = YES;
|
|
180
180
|
ONLY_ACTIVE_ARCH = YES;
|
|
181
181
|
SDKROOT = iphoneos;
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
isa = XCBuildConfiguration;
|
|
187
187
|
buildSettings = {
|
|
188
188
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
189
|
-
CLANG_CXX_LANGUAGE_STANDARD = "
|
|
189
|
+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
|
190
190
|
CLANG_CXX_LIBRARY = "libc++";
|
|
191
191
|
CLANG_ENABLE_MODULES = YES;
|
|
192
192
|
CLANG_ENABLE_OBJC_ARC = YES;
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
219
219
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
220
220
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
221
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
221
|
+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
|
222
222
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
223
223
|
SDKROOT = iphoneos;
|
|
224
224
|
VALIDATE_PRODUCT = YES;
|