@usercentrics/react-native-sdk 2.9.0 → 2.11.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +15 -40
  3. package/android/build.gradle +1 -1
  4. package/android/src/androidTest/java/com/usercentrics/reactnativemodule/RNUsercentricsModuleTest.kt +82 -61
  5. package/android/src/androidTest/java/com/usercentrics/reactnativemodule/mock/GetCMPDataMock.kt +647 -499
  6. package/android/src/androidTest/java/com/usercentrics/reactnativemodule/mock/GetTCFDataMock.kt +14 -4
  7. package/android/src/androidTest/java/com/usercentrics/reactnativemodule/mock/SaveDecisionsForTCFMock.kt +7 -1
  8. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/RNUsercentricsModule.kt +10 -1
  9. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/extensions/BannerSettingsExtensions.kt +1 -1
  10. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/extensions/ConsentDisclosureSerializer.kt +24 -0
  11. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/extensions/TCFDataExtensions.kt +12 -4
  12. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/extensions/UserDecisionExtensions.kt +18 -1
  13. package/android/src/main/java/com/usercentrics/reactnativeusercentrics/extensions/UsercentricsCMPDataExtensions.kt +85 -7
  14. package/ios/Extensions/TCFData+Dict.swift +14 -1
  15. package/ios/Extensions/TCFUserDecisions+Dict.swift +12 -1
  16. package/ios/Extensions/UsercentricsCMPData+Dict.swift +96 -7
  17. package/ios/Manager/UsercentricsManager.swift +6 -1
  18. package/ios/RNUsercentricsModule.m +3 -0
  19. package/ios/RNUsercentricsModule.swift +7 -3
  20. package/lib/Usercentrics.d.ts +5 -3
  21. package/lib/Usercentrics.js +4 -0
  22. package/lib/Usercentrics.js.map +1 -1
  23. package/lib/models/AdditionalConsentModeData.d.ts +12 -0
  24. package/lib/models/AdditionalConsentModeData.js +15 -0
  25. package/lib/models/AdditionalConsentModeData.js.map +1 -0
  26. package/lib/models/BannerSettings.js.map +1 -1
  27. package/lib/models/CCPAData.js.map +1 -1
  28. package/lib/models/CCPASettings.js.map +1 -1
  29. package/lib/models/ConsentDisclosureObject.d.ts +20 -0
  30. package/lib/models/ConsentDisclosureObject.js +24 -0
  31. package/lib/models/ConsentDisclosureObject.js.map +1 -0
  32. package/lib/models/FirstLayerSettings.js.map +1 -1
  33. package/lib/models/NetworkMode.js.map +1 -1
  34. package/lib/models/SecondLayerSettings.js.map +1 -1
  35. package/lib/models/TCF2Settings.d.ts +24 -1
  36. package/lib/models/TCF2Settings.js +27 -1
  37. package/lib/models/TCF2Settings.js.map +1 -1
  38. package/lib/models/TCFData.d.ts +16 -2
  39. package/lib/models/TCFData.js +17 -2
  40. package/lib/models/TCFData.js.map +1 -1
  41. package/lib/models/TCFDecisionUILayer.js.map +1 -1
  42. package/lib/models/TCFUserDecisions.d.ts +10 -4
  43. package/lib/models/TCFUserDecisions.js +8 -1
  44. package/lib/models/TCFUserDecisions.js.map +1 -1
  45. package/lib/models/UsercentricsAnalyticsEventType.js.map +1 -1
  46. package/lib/models/UsercentricsCMPData.js.map +1 -1
  47. package/lib/models/UsercentricsCategory.js.map +1 -1
  48. package/lib/models/UsercentricsConsentType.js.map +1 -1
  49. package/lib/models/UsercentricsConsentUserResponse.js.map +1 -1
  50. package/lib/models/UsercentricsLabels.d.ts +8 -1
  51. package/lib/models/UsercentricsLabels.js +8 -1
  52. package/lib/models/UsercentricsLabels.js.map +1 -1
  53. package/lib/models/UsercentricsLoggerLevel.js.map +1 -1
  54. package/lib/models/UsercentricsOptions.js.map +1 -1
  55. package/lib/models/UsercentricsReadyStatus.js.map +1 -1
  56. package/lib/models/UsercentricsService.d.ts +4 -1
  57. package/lib/models/UsercentricsService.js +3 -1
  58. package/lib/models/UsercentricsService.js.map +1 -1
  59. package/lib/models/UsercentricsServiceConsent.js.map +1 -1
  60. package/lib/models/UsercentricsSettings.d.ts +33 -4
  61. package/lib/models/UsercentricsSettings.js +38 -3
  62. package/lib/models/UsercentricsSettings.js.map +1 -1
  63. package/lib/models/UsercentricsUserInteraction.js.map +1 -1
  64. package/lib/models/UsercentricsVariant.js.map +1 -1
  65. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  [Release Notes](https://docs.usercentrics.com/cmp_in_app_sdk/latest/about/history/)
2
2
 
3
+ ### 2.11.0 - December 22, 2023
4
+
5
+ ## Features
6
+
7
+ * Google Consent Mode V2 Support - Seamlessly integrate with the latest Google Consent Mode, ensuring enhanced privacy compliance and meeting Google requirements.
8
+ * Google Additional Consent Mode V2 - Integrate with the latest Google Additional Consent, allowing you to collect and signal additional consent for ad tech providers not covered by the IAB TCF V2.2.
9
+ * Display Number of Vendors for Each Purpose on TCF - Easily view the number of vendors associated with each purpose in the Transparency and Consent Framework.
10
+ * Chartboost SDK in Consent Mediation - Optimize revenue by effortlessly managing the Chartboost SDK within Usercentrics Consent Mediation.
11
+
12
+ ## Improvements
13
+
14
+ * TCFUserDecisions API update - All properties have been changed from variables to constants. The adTechProviders field has been added which represent consents for Google Additional Consent Mode. On iOS this is a required argument, so if this is irrelevant for your configuration, just set an empty list, when needed.
15
+ * Location is only cached by the SDK for offline mode.
16
+
17
+ ## Android Resolved Issues
18
+
19
+ * Avoid fetching any image resource after the banner has been closed.
20
+
21
+ ## iOS Resolved Issues
22
+
23
+ * Prevent Long Privacy Legal Links from Being Truncated.
24
+ * Enable Scaled Fonts resources when using Custom UI.
25
+
26
+ ## Other Resolved Issues
27
+
28
+ * Third-Party Vendors Count misalignment in some configurations.
29
+ * Fix the bug causing the banner to reappear for users outside the European Union, despite configurations being specifically set to enforce GDPR compliance exclusively for EU users.
30
+ * Update Link to Report Issues on Zendesk.
31
+
32
+ ### 2.10.0 - November 16, 2023
33
+
34
+ ## Improvements
35
+
36
+ * Accessibility: Various issues have been addressed to enhance accessibility.
37
+ * Resolved banner compatibility issues with iOS VoiceOver.
38
+ * Resolved banner compatibility issues with Android TalkBack.
39
+ * Adjusted font sizes to comply with Accessibility requirements on both iOS and Android.
40
+
41
+ * Added Ukrainian support language for TCF.
42
+
43
+ ## Resolved Issues
44
+
45
+ * Fixed the issue of not disclosing the setting "showCloseButton" has been addressed, preventing errors on Android.
46
+ * Fixed the crash on Android when passing an invalid controller id to restore the user session.
47
+ * Fixed The issue of the remote variant configuration not being used in first layer on Unity.
48
+
3
49
  ### 2.9.0 - October 6, 2023
4
50
 
5
51
  ## Features
package/README.md CHANGED
@@ -6,50 +6,36 @@
6
6
  alt="follow on Twitter">
7
7
  </a>
8
8
 
9
- ## Overview
9
+ # Welcome!
10
10
 
11
- The Usercentrics Apps SDK is a Consent Management Platform framework for mobile, TV, Web, and Unity applications, that enables the collection, documentation, and management of your user's privacy settings, in order to ensure legal compliance for different legal frameworks around the world.
11
+ You are now one step closer from making **privacy** a core feature in your application. We are very happy that you decided to make this a priority. We are here to help you **build trust** with your users.
12
+
13
+ ## The Usercentrics Apps SDK
14
+
15
+ The Usercentrics Apps SDK is a native Consent Management Platform solution for mobile apps, mobile games & TV applications, that enables the collection, documentation, and management of your user's privacy choices, in order to ensure legal compliance for legal regulations around the world.
12
16
 
13
17
  <p align="center">
14
18
  <img src="https://docs.usercentrics.com/cmp_in_app_sdk/latest/assets/media/predefinedUI.png" alt="Usercentrics UI" />
15
19
  </p>
16
20
 
17
- ### Supported Legal Frameworks
18
-
19
- * 🇪🇺 GDPR - European Union's General Data Protection Regulation
20
- * 🇺🇸 CCPA - California's Consumer Privacy Act
21
- * 🇧🇷 LGPD - Brazil’s Lei Geral de Proteção de Dados
22
- * 🌎 TCF 2.0 - Transparency & Consent Framework 2.0
23
-
24
- ### Supported Platforms
25
-
26
- | Android | iOS | Web | tvOS | MacOS |
27
- |:-------:|:---:|:-----:|:----:|:-----:|
28
- | ✅ | ✅ | ❌ | ❌ | ❌ |
29
-
30
21
  ### Requirements
31
22
  * Android 5.0 (API 21) or higher with Kotlin 1.5 or higher
32
23
  * iOS 11 or higher
33
24
  * React 17.0 or higher
34
25
  * React Native 0.65 or higher
35
- * Node 14
26
+ * Node 14
36
27
 
37
- ## Installation
28
+ ## Get started!
38
29
 
39
- Install the library from npm:
30
+ In order to use and test the SDK, you will need a Usercentrics Account. Get [started with a free trial](https://usercentrics.com/in-app-sdk/).
40
31
 
41
- ```sh
42
- npm install @usercentrics/react-native-sdk
43
- ```
32
+ ## Integration
44
33
 
45
- For iOS, after installing the package, you will need to install the Usercentrics dependency by running from your project folder, in this repository go to example/ and run:
46
- ```sh
47
- npx pod-install
48
- ```
49
- Or running from example/ios/ folder:
50
- ```sh
51
- pod install
52
- ```
34
+ Continue to our [documentation](https://usercentrics.com/docs/apps/intro/) for a step by step integration guide.
35
+
36
+ ## Example
37
+
38
+ See the [example](https://github.com/Usercentrics/react-native/tree/master/example) directory for a complete sample app using Usercentrics.
53
39
 
54
40
  ## Sample Project
55
41
 
@@ -79,16 +65,5 @@ To run the sample project, you will need to run npm install from both root and e
79
65
  npx react-native run-android
80
66
  ```
81
67
 
82
- ## Integration
83
-
84
- Continue to our [documentation](https://docs.usercentrics.com/cmp_in_app_sdk/) for a step by step integration guide.
85
-
86
- ## Example
87
-
88
- See the [example](https://github.com/Usercentrics/react-native/tree/master/example) directory for a complete sample app using Usercentrics.
89
-
90
- ## Get an Account
91
- First step to get started with our SDK, is to create a Usercentrics Account, [get started with a free account](https://usercentrics.com/pricing/#mobile) or [request a quote](https://usercentrics.com/in-app-sdk/#in-app-demo) for your organization.
92
-
93
68
  ## Maintainers
94
69
  - [Usercentrics](https://github.com/Usercentrics)
@@ -1,4 +1,4 @@
1
- def usercentrics_version = "2.9.0"
1
+ def usercentrics_version = "2.11.0"
2
2
  version usercentrics_version
3
3
 
4
4
  buildscript {
@@ -64,8 +64,8 @@ class RNUsercentricsModuleTest {
64
64
  private val usercentricsConsentHistoryEntries = listOf(
65
65
  UsercentricsConsentHistoryEntry(
66
66
  status = false,
67
- UsercentricsConsentType.EXPLICIT,
68
- 123
67
+ type = UsercentricsConsentType.EXPLICIT,
68
+ timestampInMillis = 123
69
69
  )
70
70
  )
71
71
 
@@ -88,16 +88,14 @@ class RNUsercentricsModuleTest {
88
88
  @Before
89
89
  fun before() {
90
90
  SoLoader.init(
91
- InstrumentationRegistry.getInstrumentation().context,
92
- SoLoader.SOLOADER_ALLOW_ASYNC_INIT
91
+ InstrumentationRegistry.getInstrumentation().context, SoLoader.SOLOADER_ALLOW_ASYNC_INIT
93
92
  )
94
93
  }
95
94
 
96
95
  @Test
97
96
  fun testModuleName() {
98
97
  assertEquals(
99
- "RNUsercentricsModule",
100
- RNUsercentricsModule(mockk(relaxed = true), mockk(), ReactContextProviderMock()).name
98
+ "RNUsercentricsModule", RNUsercentricsModule(mockk(relaxed = true), mockk(), ReactContextProviderMock()).name
101
99
  )
102
100
  }
103
101
 
@@ -112,7 +110,9 @@ class RNUsercentricsModuleTest {
112
110
  assertEquals(1, usercentricsProxy.initializeCount)
113
111
  assertEquals("AAAAA", usercentricsProxy.initializeOptionsArgument?.settingsId)
114
112
  assertEquals("BBBBB", usercentricsProxy.initializeOptionsArgument?.ruleSetId)
115
- assertEquals(UsercentricsLoggerLevel.NONE, usercentricsProxy.initializeOptionsArgument?.loggerLevel)
113
+ assertEquals(
114
+ UsercentricsLoggerLevel.NONE, usercentricsProxy.initializeOptionsArgument?.loggerLevel
115
+ )
116
116
  assertEquals(1000L, usercentricsProxy.initializeOptionsArgument?.timeoutMillis)
117
117
  assertEquals("1.2.3", usercentricsProxy.initializeOptionsArgument?.version)
118
118
  assertEquals(NetworkMode.EU, usercentricsProxy.initializeOptionsArgument?.networkMode)
@@ -167,10 +167,9 @@ class RNUsercentricsModuleTest {
167
167
  @Test
168
168
  fun testRestoreUserSession() {
169
169
  val usercentricsSDK = mockk<UsercentricsSDK>()
170
- every { usercentricsSDK.restoreUserSession(any(), any(), any()) }
171
- .answers {
172
- (arg(1) as (UsercentricsReadyStatus) -> Unit)(usercentricsReadyStatus)
173
- }
170
+ every { usercentricsSDK.restoreUserSession(any(), any(), any()) }.answers {
171
+ (arg(1) as (UsercentricsReadyStatus) -> Unit)(usercentricsReadyStatus)
172
+ }
174
173
 
175
174
  val usercentricsProxy = FakeUsercentricsProxy(instanceAnswer = usercentricsSDK)
176
175
  val contextMock = mockk<ReactApplicationContext>(relaxed = true)
@@ -196,10 +195,9 @@ class RNUsercentricsModuleTest {
196
195
  fun testRestoreUserSessionWithError() {
197
196
  val error = mockk<UsercentricsError>(relaxed = true)
198
197
  val usercentricsSDK = mockk<UsercentricsSDK>()
199
- every { usercentricsSDK.restoreUserSession(any(), any(), any()) }
200
- .answers {
201
- (arg(2) as (UsercentricsError) -> Unit)(error)
202
- }
198
+ every { usercentricsSDK.restoreUserSession(any(), any(), any()) }.answers {
199
+ (arg(2) as (UsercentricsError) -> Unit)(error)
200
+ }
203
201
  val usercentricsProxy = FakeUsercentricsProxy(usercentricsSDK)
204
202
  val contextMock = mockk<ReactApplicationContext>(relaxed = true)
205
203
  val module = RNUsercentricsModule(contextMock, usercentricsProxy, ReactContextProviderMock())
@@ -294,18 +292,15 @@ class RNUsercentricsModuleTest {
294
292
  assertEquals(2, resultMap.getInt("activeVariant"))
295
293
 
296
294
  assertEquals(
297
- GetCMPDataMock.expectedSettings.toWritableMap(),
298
- resultMap.getMap("settings")
295
+ GetCMPDataMock.expectedSettings.toWritableMap(), resultMap.getMap("settings")
299
296
  )
300
297
 
301
298
  assertEquals(
302
- GetCMPDataMock.expectedCategories.serialize(),
303
- resultMap.getArray("categories")
299
+ GetCMPDataMock.expectedCategories.serialize(), resultMap.getArray("categories")
304
300
  )
305
301
 
306
302
  assertEquals(
307
- GetCMPDataMock.expectedUserLocation.toWritableMap(),
308
- resultMap.getMap("userLocation")
303
+ GetCMPDataMock.expectedUserLocation.toWritableMap(), resultMap.getMap("userLocation")
309
304
  )
310
305
 
311
306
  assertEquals(GetCMPDataMock.expectedServices.serialize(), resultMap.getArray("services")!!)
@@ -393,10 +388,9 @@ class RNUsercentricsModuleTest {
393
388
  @Test
394
389
  fun testChangeLanguage() {
395
390
  val usercentricsSDK = mockk<UsercentricsSDK>()
396
- every { usercentricsSDK.changeLanguage(any(), any(), any()) }
397
- .answers {
398
- (arg(1) as () -> Unit)()
399
- }
391
+ every { usercentricsSDK.changeLanguage(any(), any(), any()) }.answers {
392
+ (arg(1) as () -> Unit)()
393
+ }
400
394
  val usercentricsProxy = FakeUsercentricsProxy(usercentricsSDK)
401
395
  val contextMock = mockk<ReactApplicationContext>(relaxed = true)
402
396
  val module = RNUsercentricsModule(contextMock, usercentricsProxy, ReactContextProviderMock())
@@ -406,9 +400,7 @@ class RNUsercentricsModuleTest {
406
400
 
407
401
  verify(exactly = 1) {
408
402
  usercentricsSDK.changeLanguage(
409
- "abc",
410
- any(),
411
- any()
403
+ "abc", any(), any()
412
404
  )
413
405
  }
414
406
 
@@ -419,10 +411,9 @@ class RNUsercentricsModuleTest {
419
411
  fun testChangeLanguageWithError() {
420
412
  val error = mockk<UsercentricsError>(relaxed = true)
421
413
  val usercentricsSDK = mockk<UsercentricsSDK>()
422
- every { usercentricsSDK.changeLanguage(any(), any(), any()) }
423
- .answers {
424
- (arg(2) as (UsercentricsError) -> Unit)(error)
425
- }
414
+ every { usercentricsSDK.changeLanguage(any(), any(), any()) }.answers {
415
+ (arg(2) as (UsercentricsError) -> Unit)(error)
416
+ }
426
417
 
427
418
  val usercentricsProxy = FakeUsercentricsProxy(usercentricsSDK)
428
419
  val contextMock = mockk<ReactApplicationContext>(relaxed = true)
@@ -434,9 +425,7 @@ class RNUsercentricsModuleTest {
434
425
 
435
426
  verify(exactly = 1) {
436
427
  usercentricsSDK.changeLanguage(
437
- "abc",
438
- any(),
439
- any()
428
+ "abc", any(), any()
440
429
  )
441
430
  }
442
431
  assertEquals(error, promise.rejectThrowable)
@@ -447,8 +436,7 @@ class RNUsercentricsModuleTest {
447
436
  val usercentricsSDK = mockk<UsercentricsSDK>()
448
437
  every {
449
438
  usercentricsSDK.acceptAllForTCF(
450
- any(),
451
- any()
439
+ any(), any()
452
440
  )
453
441
  }.returns(GetConsentsMock.fakeWithData)
454
442
 
@@ -475,8 +463,7 @@ class RNUsercentricsModuleTest {
475
463
  val usercentricsSDK = mockk<UsercentricsSDK>()
476
464
  every {
477
465
  usercentricsSDK.denyAllForTCF(
478
- any(),
479
- any()
466
+ any(), any()
480
467
  )
481
468
  }.returns(GetConsentsMock.fakeWithData)
482
469
 
@@ -545,8 +532,7 @@ class RNUsercentricsModuleTest {
545
532
  val usercentricsSDK = mockk<UsercentricsSDK>()
546
533
  every {
547
534
  usercentricsSDK.saveDecisions(
548
- any(),
549
- any()
535
+ any(), any()
550
536
  )
551
537
  }.returns(GetConsentsMock.fakeWithData)
552
538
 
@@ -566,12 +552,7 @@ class RNUsercentricsModuleTest {
566
552
  fun testSaveDecisionsForTCF() {
567
553
  val usercentricsSDK = mockk<UsercentricsSDK>()
568
554
  every {
569
- usercentricsSDK.saveDecisionsForTCF(
570
- any(),
571
- any(),
572
- any(),
573
- any()
574
- )
555
+ usercentricsSDK.saveDecisionsForTCF(any(), any(), any(), any())
575
556
  }.returns(SaveDecisionsForTCFMock.fake)
576
557
 
577
558
  val usercentricsProxy = FakeUsercentricsProxy(usercentricsSDK)
@@ -580,15 +561,14 @@ class RNUsercentricsModuleTest {
580
561
 
581
562
  val promise = FakePromise()
582
563
  module.saveDecisionsForTCF(
583
- SaveDecisionsForTCFMock.call,
584
- 0,
585
- SaveDecisionsMock.callDecisions.serialize(),
586
- 0,
587
- promise
564
+ tcfDecisions = SaveDecisionsForTCFMock.call,
565
+ fromLayer = 0,
566
+ saveDecisions = SaveDecisionsMock.callDecisions.serialize(),
567
+ consentType = 0,
568
+ promise = promise
588
569
  )
589
570
 
590
571
  val result = promise.resolveValue as WritableArray
591
-
592
572
  assertEquals(SaveDecisionsForTCFMock.expected.serialize(), result)
593
573
  }
594
574
 
@@ -607,9 +587,7 @@ class RNUsercentricsModuleTest {
607
587
 
608
588
  val promise = FakePromise()
609
589
  module.saveOptOutForCCPA(
610
- false,
611
- 0,
612
- promise
590
+ false, 0, promise
613
591
  )
614
592
 
615
593
  val result = promise.resolveValue as WritableArray
@@ -672,7 +650,7 @@ class RNUsercentricsModuleTest {
672
650
  @Test
673
651
  fun testShowFirstLayerWithCustomLocalLogo() {
674
652
  val context = InstrumentationRegistry.getInstrumentation().context
675
- val reactContextProviderMock = object: ReactContextProviderMock() {
653
+ val reactContextProviderMock = object : ReactContextProviderMock() {
676
654
 
677
655
  override fun context(): Context {
678
656
  return context
@@ -681,7 +659,9 @@ class RNUsercentricsModuleTest {
681
659
 
682
660
  val usercentricsProxy = FakeUsercentricsProxy()
683
661
  val reactApplicationContext = mockk<ReactApplicationContext>(relaxed = true)
684
- val module = RNUsercentricsModule(reactApplicationContext, usercentricsProxy, reactContextProviderMock)
662
+ val module = RNUsercentricsModule(
663
+ reactApplicationContext, usercentricsProxy, reactContextProviderMock
664
+ )
685
665
 
686
666
  val bannerSettingsMap = mapOf(
687
667
  "variant" to null,
@@ -708,12 +688,53 @@ class RNUsercentricsModuleTest {
708
688
  layout = UsercentricsLayout.Popup(
709
689
  PopupPosition.CENTER
710
690
  )
711
- ),
712
- secondLayerStyleSettings = SecondLayerStyleSettings(showCloseButton = true),
713
- generalStyleSettings = GeneralStyleSettings(
691
+ ), secondLayerStyleSettings = SecondLayerStyleSettings(showCloseButton = true), generalStyleSettings = GeneralStyleSettings(
714
692
  logo = UsercentricsImage.ImageDrawableId(someLocalImageDrawableId)
715
693
  )
716
694
  )
717
695
  assertEquals(expectedBannerSettings, usercentricsProxy.showFirstLayerBannerSettings)
718
696
  }
697
+
698
+ @Test
699
+ fun testShowFirstLayerWhenShowCloseButtonIsNull() {
700
+ val usercentricsProxy = FakeUsercentricsProxy()
701
+ val contextMock = mockk<ReactApplicationContext>(relaxed = true)
702
+ val module = RNUsercentricsModule(contextMock, usercentricsProxy, ReactContextProviderMock())
703
+ val bannerSettingsMap = mapOf(
704
+ "secondLayerStyleSettings" to mapOf(
705
+ "showCloseButton" to null
706
+ ),
707
+ )
708
+ val promise = FakePromise()
709
+ module.showFirstLayer(bannerSettingsMap.toWritableMap(), promise)
710
+ promise.await()
711
+
712
+ val expectedBannerSettings = BannerSettings(
713
+ secondLayerStyleSettings = SecondLayerStyleSettings(
714
+ showCloseButton = null
715
+ )
716
+ )
717
+
718
+ assertEquals(expectedBannerSettings, usercentricsProxy.showFirstLayerBannerSettings)
719
+ }
720
+
721
+ @Test
722
+ fun testGetAdditionalConsentModeData() {
723
+ val usercentricsSDK = mockk<UsercentricsSDK>()
724
+ every { usercentricsSDK.getAdditionalConsentModeData() }.answers {
725
+ GetCMPDataMock.fakeAdditionalConsentModeData
726
+ }
727
+
728
+ val usercentricsProxy = FakeUsercentricsProxy(usercentricsSDK)
729
+ val contextMock = mockk<ReactApplicationContext>(relaxed = true)
730
+ val module = RNUsercentricsModule(contextMock, usercentricsProxy, ReactContextProviderMock())
731
+ val promise = FakePromise()
732
+
733
+ module.getAdditionalConsentModeData(promise)
734
+
735
+ val result = promise.resolveValue
736
+
737
+ verify(exactly = 1) { usercentricsSDK.getAdditionalConsentModeData() }
738
+ assertEquals(GetCMPDataMock.expectedAdditionalConsentModeData.toWritableMap(), result)
739
+ }
719
740
  }