@didomi/react-native 1.11.0 → 1.12.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 (39) hide show
  1. package/android/build.gradle +14 -22
  2. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  3. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  4. package/android/gradle.properties +6 -4
  5. package/android/gradlew +154 -103
  6. package/android/gradlew.bat +7 -18
  7. package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +186 -111
  8. package/ios/Didomi.m +4 -2
  9. package/ios/Didomi.xcodeproj/project.pbxproj +4 -4
  10. package/ios/RNDidomi.swift +51 -30
  11. package/lib/commonjs/Constants.js +3 -3
  12. package/lib/commonjs/Constants.js.map +1 -1
  13. package/lib/commonjs/Didomi.js +40 -87
  14. package/lib/commonjs/Didomi.js.map +1 -1
  15. package/lib/commonjs/DidomiListener.js +16 -18
  16. package/lib/commonjs/DidomiListener.js.map +1 -1
  17. package/lib/commonjs/DidomiTypes.js +0 -1
  18. package/lib/commonjs/DidomiTypes.js.map +1 -1
  19. package/lib/commonjs/index.js +0 -2
  20. package/lib/commonjs/index.js.map +1 -1
  21. package/lib/module/Constants.js +3 -3
  22. package/lib/module/Constants.js.map +1 -1
  23. package/lib/module/Didomi.js +40 -82
  24. package/lib/module/Didomi.js.map +1 -1
  25. package/lib/module/DidomiListener.js +16 -15
  26. package/lib/module/DidomiListener.js.map +1 -1
  27. package/lib/module/DidomiTypes.js +0 -1
  28. package/lib/module/DidomiTypes.js.map +1 -1
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/typescript/Constants.d.ts +1 -1
  31. package/lib/typescript/Didomi.d.ts +46 -46
  32. package/lib/typescript/DidomiListener.d.ts +2 -2
  33. package/lib/typescript/DidomiTypes.d.ts +17 -12
  34. package/package.json +5 -5
  35. package/react-native-didomi.podspec +2 -2
  36. package/src/Constants.ts +1 -1
  37. package/src/Didomi.ts +47 -39
  38. package/src/DidomiListener.ts +24 -14
  39. package/src/DidomiTypes.ts +17 -12
@@ -5,7 +5,6 @@ import AppTrackingTransparency
5
5
  @objc(Didomi)
6
6
  class RNDidomi: RCTEventEmitter {
7
7
 
8
- public static var initialized = false
9
8
  var didomiEventListener: EventListener
10
9
 
11
10
  override init() {
@@ -20,39 +19,37 @@ class RNDidomi: RCTEventEmitter {
20
19
 
21
20
  @objc(initialize:userAgentVersion:apiKey:localConfigurationPath:remoteConfigurationURL:providerId:disableDidomiRemoteConfig:languageCode:noticeId:androidTvNoticeId:androidTvEnabled:resolve:reject:)
22
21
  func initialize(userAgentName: String, userAgentVersion: String, apiKey: String, localConfigurationPath: String?, remoteConfigurationURL: String?, providerId: String?, disableDidomiRemoteConfig: Bool = false, languageCode: String? = nil, noticeId: String? = nil, androidTvNoticeId: String? = nil, androidTvEnabled: Bool = false, resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) {
23
- onReady()
24
- onError()
25
- if !RNDidomi.initialized {
26
- initEventListener()
27
-
28
- Didomi.shared.setUserAgent(name: userAgentName, version: userAgentVersion)
29
-
30
- Didomi.shared.initialize(DidomiInitializeParameters(
31
- apiKey: apiKey,
32
- localConfigurationPath: localConfigurationPath,
33
- remoteConfigurationURL: remoteConfigurationURL,
34
- providerID: providerId,
35
- disableDidomiRemoteConfig: disableDidomiRemoteConfig,
36
- languageCode: languageCode ?? Locale.current.languageCode ?? "",
37
- noticeID: noticeId
38
- ))
39
- }
40
- RNDidomi.initialized = true
22
+ Didomi.shared.setUserAgent(name: userAgentName, version: userAgentVersion)
23
+
24
+ Didomi.shared.initialize(DidomiInitializeParameters(
25
+ apiKey: apiKey,
26
+ localConfigurationPath: localConfigurationPath,
27
+ remoteConfigurationURL: remoteConfigurationURL,
28
+ providerID: providerId,
29
+ disableDidomiRemoteConfig: disableDidomiRemoteConfig,
30
+ languageCode: languageCode ?? Locale.current.languageCode ?? "",
31
+ noticeID: noticeId
32
+ ))
33
+
41
34
  resolve(0)
42
35
  }
43
-
44
- private func onReady() {
36
+
37
+ @objc(onReady:reject:)
38
+ func onReady(resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) {
45
39
  Didomi.shared.onReady {
46
40
  self.dispatchEvent(withName: "on_ready_callback", body: nil)
47
41
  }
42
+ resolve(0)
48
43
  }
49
-
50
- private func onError() {
44
+
45
+ @objc(onError:reject:)
46
+ func onError(resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) {
51
47
  Didomi.shared.onError { error in
52
48
  self.dispatchEvent(withName: "on_error_callback", body: error.descriptionText)
53
49
  }
50
+ resolve(0)
54
51
  }
55
-
52
+
56
53
  @objc(getQueryStringForWebView:reject:)
57
54
  func getQueryStringForWebView(resolve:RCTPromiseResolveBlock, reject:RCTPromiseRejectBlock) {
58
55
  resolve(Didomi.shared.getQueryStringForWebView())
@@ -579,11 +576,14 @@ public struct Vendor : Codable {
579
576
  /// Unique ID of the vendor.
580
577
  public var id: String?
581
578
 
579
+ /// IAB ID that the vendor should be mapped to (if vendor namespace is not **iab** and the vendor should be treated as an IAB vendor).
580
+ public var iabId: String?
581
+
582
582
  /// Name of the vendor.
583
583
  public var name: String?
584
584
 
585
585
  /// URL to the privacy policy of the vendor.
586
- public var privacyPolicyUrl: String?
586
+ public var policyUrl: String?
587
587
 
588
588
  /// Namespace of the vendor (IAB, didomi or custom).
589
589
  public var namespace: String?
@@ -596,9 +596,30 @@ public struct Vendor : Codable {
596
596
 
597
597
  /// Purpose IDs that the vendor is operating under the legitimate interest legal basis.
598
598
  public var legIntPurposeIds: Set<String>?
599
-
600
- /// IAB ID that the vendor should be mapped to (if vendor namespace is not **iab** and the vendor should be treated as an IAB vendor).
601
- public var iabId: String?
599
+
600
+ /// Set with IDs that represent features.
601
+ public var featureIds: Set<String>?
602
+
603
+ /// Set with IDs that represent Special Features. TCFv2 property.
604
+ public var specialFeatureIds: Set<String>?
605
+
606
+ /// Set with IDs that represent flexible purposes. TCFv2 property.
607
+ public var flexiblePurposeIds: Set<String>?
608
+
609
+ /// Set with IDs that represent Special Purposes. TCFv2 property.
610
+ public var specialPurposeIds: Set<String>?
611
+
612
+ /// Transient property : Set with IDs that represent essential purposes
613
+ public var essentialPurposeIds: Set<String>?
614
+
615
+ /// Cookie Max Age in Seconds.
616
+ public var cookieMaxAgeSeconds: Int?
617
+
618
+ /// If vendor uses other means of storage/access than cookies
619
+ public var usesNonCookieAccess: Bool?
620
+
621
+ /// URL used to download Device Storage Disclosures (done post initialization).
622
+ public var deviceStorageDisclosureUrl: String?
602
623
  }
603
624
 
604
625
  @objc public enum ConsentStatus : Int {
@@ -663,7 +684,7 @@ extension RNDidomi {
663
684
  private func initEventListener() {
664
685
 
665
686
  didomiEventListener.onConsentChanged = { event in
666
- self.dispatchEvent(withName: "on_consent_changed", body:"")
687
+ self.dispatchEvent(withName: "on_consent_changed", body: "")
667
688
  }
668
689
 
669
690
  didomiEventListener.onReady = { event in
@@ -671,7 +692,7 @@ extension RNDidomi {
671
692
  }
672
693
 
673
694
  didomiEventListener.onError = { event in
674
- self.dispatchEvent(withName: "on_error", body: "")
695
+ self.dispatchEvent(withName: "on_error", body: event.descriptionText)
675
696
  }
676
697
 
677
698
  didomiEventListener.onShowNotice = { event in
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.DIDOMI_VERSION = exports.DIDOMI_USER_AGENT_NAME = void 0;
7
7
  // User agent name
8
- const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK"; // User agent version
9
-
8
+ const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK";
9
+ // User agent version
10
10
  exports.DIDOMI_USER_AGENT_NAME = DIDOMI_USER_AGENT_NAME;
11
- const DIDOMI_VERSION = "1.11.0";
11
+ const DIDOMI_VERSION = "1.12.0";
12
12
  exports.DIDOMI_VERSION = DIDOMI_VERSION;
13
13
  //# sourceMappingURL=Constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":";;;;;;AAAA;AACO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;;AACO,MAAMC,cAAc,GAAG,QAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.11.0\"\n"]}
1
+ {"version":3,"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"sources":["Constants.ts"],"sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.12.0\"\n"],"mappings":";;;;;;AAAA;AACO,MAAMA,sBAAsB,GAAG,yBAAyB;AAC/D;AAAA;AACO,MAAMC,cAAc,GAAG,QAAQ;AAAA"}
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Didomi = void 0;
7
-
8
7
  var _reactNative = require("react-native");
9
-
10
8
  var _DidomiListener = require("./DidomiListener");
11
-
12
9
  var _Constants = require("./Constants");
13
-
14
10
  const {
15
11
  Didomi: RNDidomi
16
12
  } = _reactNative.NativeModules;
@@ -28,29 +24,38 @@ const Didomi = {
28
24
  * @param androidTvNoticeId: Notice id for the remote configuration when running on Android TV device (ignored on iOS / tvOS). Note that using remote configuration is mandatory for TV devices.
29
25
  * @param androidTvEnabled: Whether to allow Didomi SDK to run on Android TV, default to "false".
30
26
  */
31
- initialize: (apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig = false, languageCode, noticeId, androidTvNoticeId, androidTvEnabled = false) => {
27
+ initialize: function (apiKey, localConfigurationPath, remoteConfigurationUrl, providerId) {
28
+ let disableDidomiRemoteConfig = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
29
+ let languageCode = arguments.length > 5 ? arguments[5] : undefined;
30
+ let noticeId = arguments.length > 6 ? arguments[6] : undefined;
31
+ let androidTvNoticeId = arguments.length > 7 ? arguments[7] : undefined;
32
+ let androidTvEnabled = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
32
33
  // Init listener
33
- _DidomiListener.DidomiListener.init(); // Trigger native SDK init
34
-
34
+ _DidomiListener.DidomiListener.init();
35
35
 
36
+ // Trigger native SDK init
36
37
  return RNDidomi.initialize(_Constants.DIDOMI_USER_AGENT_NAME, _Constants.DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId, androidTvNoticeId, androidTvEnabled);
37
38
  },
38
-
39
39
  /**
40
40
  * Listen to SDK ready state
41
41
  */
42
- onReady: () => _DidomiListener.DidomiListener.onReady(),
43
-
42
+ onReady: () => {
43
+ var promise = _DidomiListener.DidomiListener.setOnReadyListener();
44
+ RNDidomi.onReady();
45
+ return promise;
46
+ },
44
47
  /**
45
48
  * Listen to SDK errors
46
49
  */
47
- onError: () => _DidomiListener.DidomiListener.onError(),
48
-
50
+ onError: () => {
51
+ var promise = _DidomiListener.DidomiListener.setOnErrorListener();
52
+ RNDidomi.onError();
53
+ return promise;
54
+ },
49
55
  /**
50
56
  * Provide the objects required to display UI elements
51
57
  */
52
58
  setupUI: () => RNDidomi.setupUI(),
53
-
54
59
  /**
55
60
  * Set the minimum level of messages to log
56
61
  * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize
@@ -75,88 +80,76 @@ const Didomi = {
75
80
  * @param minLevel: Minimum level of messages to log
76
81
  */
77
82
  setLogLevel: level => RNDidomi.setLogLevel(level),
78
-
79
83
  /**
80
84
  * Add an event listener
81
85
  * @param listener:
82
86
  */
83
87
  addEventListener: (eventType, callback) => _DidomiListener.DidomiListener.addEventListener(eventType, callback),
84
-
85
88
  /**
86
89
  * Remove an event listener
87
90
  * @param listener:
88
91
  */
89
92
  removeEventListener: (eventType, callback) => _DidomiListener.DidomiListener.removeEventListener(eventType, callback),
90
-
91
93
  /**
92
94
  * Remove all event listeners
93
95
  */
94
96
  removeAllEventListeners: () => _DidomiListener.DidomiListener.reset(),
95
-
96
97
  /**
97
98
  * Method used to get an array of disabled purposes.
98
99
  * @returns: array of disabled purposes.
99
100
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
100
- * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
101
+ * has been replaced by getUserStatus().purposes.consent.disabled.
101
102
  */
102
103
  getDisabledPurposes: () => RNDidomi.getDisabledPurposes(),
103
-
104
104
  /**
105
105
  * Method used to get a set of disabled purpose IDs.
106
106
  * @returns: set that contains the IDs of disabled purposes.
107
107
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
108
- * has been replaced by getUserStatus().getPurposes().getConsent().getDisabled().
108
+ * has been replaced by getUserStatus().purposes.consent.enabled.
109
109
  */
110
110
  getDisabledPurposeIds: () => RNDidomi.getDisabledPurposeIds(),
111
-
112
111
  /**
113
112
  * Method used to get an array of disabled vendors.
114
113
  * @returns: array of disabled vendors.
115
114
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
116
- * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
115
+ * has been replaced by getUserStatus().vendors.consent.disabled.
117
116
  */
118
117
  getDisabledVendors: () => RNDidomi.getDisabledVendors(),
119
-
120
118
  /**
121
119
  * Method used to get a set of disabled vendor IDs.
122
120
  * @returns: set that contains the IDs of disabled vendors.
123
121
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
124
- * has been replaced by getUserStatus().getVendors().getConsent().getDisabled().
122
+ * has been replaced by getUserStatus().vendors.consent.disabled.
125
123
  */
126
124
  getDisabledVendorIds: () => RNDidomi.getDisabledVendorIds(),
127
-
128
125
  /**
129
126
  * Method used to get an array of enabled purposes.
130
127
  * @returns: array of enabled purposes.
131
128
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
132
- * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
129
+ * has been replaced by getUserStatus().purposes.consent.enabled.
133
130
  */
134
131
  getEnabledPurposes: () => RNDidomi.getEnabledPurposes(),
135
-
136
132
  /**
137
133
  * Method used to get a set of enabled purpose IDs.
138
134
  * @returns: set that contains the IDs of enabled purposes.
139
135
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
140
- * has been replaced by getUserStatus().getPurposes().getConsent().getEnabled().
136
+ * has been replaced by getUserStatus().purposes.consent.enabled.
141
137
  */
142
138
  getEnabledPurposeIds: () => RNDidomi.getEnabledPurposeIds(),
143
-
144
139
  /**
145
140
  * Method used to get an array of enabled vendors.
146
141
  * @returns: array of enabled vendors.
147
142
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
148
- * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
143
+ * has been replaced by getUserStatus().vendors.consent.enabled.
149
144
  */
150
145
  getEnabledVendors: () => RNDidomi.getEnabledVendors(),
151
-
152
146
  /**
153
147
  * Method used to get a set of enabled vendor IDs.
154
148
  * @returns: set that contains the IDs of enabled vendors.
155
149
  * @deprecated use {@link #getUserStatus()} instead. The result of this method
156
- * has been replaced by getUserStatus().getVendors().getConsent().getEnabled().
150
+ * has been replaced by getUserStatus().vendors.consent.enabled.
157
151
  */
158
152
  getEnabledVendorIds: () => RNDidomi.getEnabledVendorIds(),
159
-
160
153
  /**
161
154
  * Get JavaScript to embed into a WebView to pass the consent status from the app
162
155
  * to the Didomi Web SDK embedded into the WebView
@@ -166,39 +159,33 @@ const Didomi = {
166
159
  */
167
160
  getJavaScriptForWebView: extra => RNDidomi.getJavaScriptForWebView(extra),
168
161
  getQueryStringForWebView: () => RNDidomi.getQueryStringForWebView(),
169
-
170
162
  /**
171
163
  * Method used to get a Purpose based on its ID.
172
164
  * @param purposeId: purpose ID used in the search.
173
165
  * @returns: purpose found in the array.
174
166
  */
175
167
  getPurpose: purposeId => RNDidomi.getPurpose(purposeId),
176
-
177
168
  /**
178
169
  * Method used to get an array of required purposes.
179
170
  *
180
171
  * @returns: array of required purposes.
181
172
  */
182
173
  getRequiredPurposes: () => RNDidomi.getRequiredPurposes(),
183
-
184
174
  /**
185
175
  * Get the configured purpose IDs
186
176
  * @returns: set of purpose IDs.
187
177
  */
188
178
  getRequiredPurposeIds: () => RNDidomi.getRequiredPurposeIds(),
189
-
190
179
  /**
191
180
  * Method used to get an array of required vendors.
192
181
  * @returns: array of required vendors.
193
182
  */
194
183
  getRequiredVendors: () => RNDidomi.getRequiredVendors(),
195
-
196
184
  /**
197
185
  * Get the configured vendor IDs
198
186
  * @returns: set of vendor IDs.
199
187
  */
200
188
  getRequiredVendorIds: () => RNDidomi.getRequiredVendorIds(),
201
-
202
189
  /**
203
190
  * Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
204
191
  * for a given key.
@@ -206,7 +193,6 @@ const Didomi = {
206
193
  * @returns: dictionary containing the different translations for a given key.
207
194
  */
208
195
  getText: key => RNDidomi.getText(key),
209
-
210
196
  /**
211
197
  * Method used to get a translated text based on the key being passed.
212
198
  * The language and the source of this translated text will depend on the availability of the translation for the specific key.
@@ -229,100 +215,88 @@ const Didomi = {
229
215
  * @returns: a translated string if a translation was found, the same key that was passed otherwise.
230
216
  */
231
217
  getTranslatedText: key => RNDidomi.getTranslatedText(key),
232
-
233
218
  /**
234
219
  * Get the user consent status for a specific purpose
235
220
  * @param purposeId: The purpose ID to check consent for
236
221
  * @returns: The user consent status for the specified purpose
237
222
  * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
238
- * getUserStatus().getPurposes().getConsent().getEnabled() or
239
- * getUserStatus().getPurposes().getConsent().getDisabled().
223
+ * getUserStatus().purposes.consent.enabled or
224
+ * getUserStatus().purposes.consent.enabled.
240
225
  */
241
226
  getUserConsentStatusForPurpose: purposeId => RNDidomi.getUserConsentStatusForPurpose(purposeId),
242
-
243
227
  /**
244
228
  * Get the user consent status for a specific vendor
245
229
  * @param vendorId: The vendor ID to check consent for
246
230
  * @returns: The user consent status for the specified vendor
247
231
  * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
248
- * getUserStatus().getVendors().getConsent().getEnabled() or
249
- * getUserStatus().getVendors().getConsent().getDisabled().
232
+ * getUserStatus().vendors.consent.enabled or
233
+ * getUserStatus().vendors.consent.disabled.
250
234
  */
251
235
  getUserConsentStatusForVendor: vendorId => RNDidomi.getUserConsentStatusForVendor(vendorId),
252
-
253
236
  /**
254
237
  * Get the user consent status for a specific vendor and all its purposes
255
238
  * @param vendorId: The ID of the vendor
256
239
  * @returns: The user consent status corresponding to the specified vendor and all its required purposes.
257
240
  * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
258
- * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
259
- * getUserStatus().getVendors().getGlobalConsent().getDisabled().
241
+ * by getUserStatus().vendors.global_consent.enabled or
242
+ * getUserStatus().vendors.global_consent.disabled.
260
243
  */
261
244
  getUserConsentStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
262
-
263
245
  /**
264
246
  * Get the user legitimate interest status for a specific purpose.
265
247
  * @param purposeId: purpose ID.
266
248
  * @returns: LI status of a purpose.
267
249
  * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
268
- * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
269
- * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
250
+ * getUserStatus().purposes.consent.enabled or
251
+ * getUserStatus().purposes.consent.enabled.
270
252
  */
271
253
  getUserLegitimateInterestStatusForPurpose: purposeId => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
272
-
273
254
  /**
274
255
  * Get the user legitimate interest status for a specific vendor.
275
256
  * @param vendorId: vendor ID.
276
257
  * @returns: LI status of a vendor.
277
258
  * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
278
- * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
279
- * getUserStatus().getVendors().getLegitimateInterest().getDisabled().
259
+ * getUserStatus().vendors.legitimate_interest.enabled or
260
+ * getUserStatus().vendors.legitimate_interest.disabled.
280
261
  */
281
262
  getUserLegitimateInterestForVendor: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
282
-
283
263
  /**
284
264
  * Get the user LI status for a specific vendor and all its purposes.
285
265
  * @param vendorId: vendor ID.
286
266
  * @returns: The user LI status corresponding to the specified vendor and all its required purposes.
287
267
  * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
288
- * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
289
- * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
268
+ * getUserStatus().vendors.global_legitimate_interest.enabled or
269
+ * getUserStatus().vendors.global_legitimate_interest.disabled.
290
270
  */
291
271
  getUserLegitimateInterestStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
292
-
293
272
  /**
294
273
  * Get the user consent status.
295
274
  * @returns: status that represents user consent.
296
275
  */
297
276
  getUserStatus: () => RNDidomi.getUserStatus(),
298
-
299
277
  /**
300
278
  * Get the user consent and legitimate interest status for a specific vendor.
301
279
  * @param vendorId: vendor ID.
302
280
  * @returns: status that represents both consent and legitimate interest status of a vendor.
303
281
  * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
304
- * getUserStatus().getVendors().getGlobal().getEnabled() or
305
- * getUserStatus().getVendors().getGlobal().getDisabled().
282
+ * getUserStatus().vendors.global.enabled or
283
+ * getUserStatus().vendors.global.disabled.
306
284
  */
307
285
  getUserStatusForVendor: vendorId => RNDidomi.getUserStatusForVendor(vendorId),
308
-
309
286
  /**
310
287
  * Method used to get a Vendor based on its ID.
311
288
  * @param vendorId: vendor ID used in the search.
312
289
  * @returns: vendor found in the array.
313
290
  */
314
291
  getVendor: vendorId => RNDidomi.getVendor(vendorId),
315
-
316
292
  /**
317
293
  * Hide the notice if it is currently displayed
318
294
  */
319
295
  hideNotice: () => RNDidomi.hideNotice(),
320
-
321
296
  /**
322
297
  * Hide the preferences popup for purposes
323
298
  */
324
299
  hidePreferences: () => RNDidomi.hidePreferences(),
325
-
326
300
  /**
327
301
  * Determine if consent is required for the user. The rules are (OR):
328
302
  * - The user country is in the EU.
@@ -331,36 +305,30 @@ const Didomi = {
331
305
  * @returns: **true** if consent is required, **false** if it is not required.
332
306
  */
333
307
  isConsentRequired: () => RNDidomi.isConsentRequired(),
334
-
335
308
  /**
336
309
  * Determine if consent information is available for all purposes and vendors that are required
337
310
  * @returns: **true** if consent is required and consent information is available, **false** otherwise.
338
311
  */
339
312
  isUserConsentStatusPartial: () => RNDidomi.isUserConsentStatusPartial(),
340
-
341
313
  /**
342
314
  * Check if the consent notice is currently displayed
343
315
  * @returns: **true** if the notice is displayed, **false** if is not.
344
316
  */
345
317
  isNoticeVisible: () => RNDidomi.isNoticeVisible(),
346
-
347
318
  /**
348
319
  * Method used to check if the Preferences view is visible.
349
320
  * @returns: **true** if Preferences view is visible, **false** otherwise.
350
321
  */
351
322
  isPreferencesVisible: () => RNDidomi.isPreferencesVisible(),
352
323
  isError: () => RNDidomi.isError(),
353
-
354
324
  /**
355
325
  * Is the Didomi SDK ready?
356
326
  */
357
327
  isReady: () => RNDidomi.isReady(),
358
-
359
328
  /**
360
329
  * Clear user information
361
330
  */
362
331
  clearUser: () => RNDidomi.clearUser(),
363
-
364
332
  /**
365
333
  * Set user information without authentication
366
334
  *
@@ -371,14 +339,12 @@ const Didomi = {
371
339
  * @param digest Deprecated. To set user with authentication, use setUserWithHashAuth or setUserWithEncryptionAuth.
372
340
  */
373
341
  setUser: (id, algorithm, secretId, salt, digest) => RNDidomi.setUser(id, algorithm, secretId, salt, digest),
374
-
375
342
  /**
376
343
  * Set user information without authentication and check for missing consent
377
344
  *
378
345
  * @param id Organization user ID
379
346
  */
380
347
  setUserAndSetupUI: id => RNDidomi.setUserAndSetupUI(id),
381
-
382
348
  /**
383
349
  * Set user information with Hash authentication
384
350
  *
@@ -396,7 +362,6 @@ const Didomi = {
396
362
  RNDidomi.setUserWithHashAuthWithExpiration(id, algorithm, secretId, digest, salt, expiration);
397
363
  }
398
364
  },
399
-
400
365
  /**
401
366
  * Set user information with Hash authentication and check for missing consent
402
367
  *
@@ -414,7 +379,6 @@ const Didomi = {
414
379
  RNDidomi.setUserWithHashAuthWithExpirationAndSetupUI(id, algorithm, secretId, digest, salt, expiration);
415
380
  }
416
381
  },
417
-
418
382
  /**
419
383
  * Set user information with Encryption authentication
420
384
  *
@@ -431,7 +395,6 @@ const Didomi = {
431
395
  RNDidomi.setUserWithEncryptionAuthWithExpiration(id, algorithm, secretId, initializationVector, expiration);
432
396
  }
433
397
  },
434
-
435
398
  /**
436
399
  * Set user information with Encryption authentication and check for missing consent
437
400
  *
@@ -448,29 +411,24 @@ const Didomi = {
448
411
  RNDidomi.setUserWithEncryptionAuthWithExpirationAndSetupUI(id, algorithm, secretId, initializationVector, expiration);
449
412
  }
450
413
  },
451
-
452
414
  /**
453
415
  * Show the consent notice (if required, not disabled in the config and not already displayed)
454
416
  */
455
417
  showNotice: () => RNDidomi.showNotice(),
456
-
457
418
  /**
458
419
  * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.
459
420
  * @param view: It can be `purposes` or `vendors`
460
421
  */
461
422
  showPreferences: view => RNDidomi.showPreferences(view),
462
-
463
423
  /**
464
424
  * Remove all consents for the user
465
425
  */
466
426
  reset: () => RNDidomi.reset(),
467
-
468
427
  /**
469
428
  * Method that allows to enable consent and legitimate interest for all the required purposes.
470
429
  * @returns: **true** if consent status has been updated, **false** otherwise.
471
430
  */
472
431
  setUserAgreeToAll: () => RNDidomi.setUserAgreeToAll(),
473
-
474
432
  /**
475
433
  * Set the user consent status.
476
434
  * @param enabledPurposeIds: set containing **enabled purpose ids**
@@ -480,13 +438,11 @@ const Didomi = {
480
438
  * @returns: **true** if consent status has been updated, **false** otherwise.
481
439
  */
482
440
  setUserConsentStatus: (enabledPurposeIds, disabledPurposeIds, enabledVendorIds, disabledVendorIds) => RNDidomi.setUserConsentStatus(enabledPurposeIds, disabledPurposeIds, enabledVendorIds, disabledVendorIds),
483
-
484
441
  /**
485
442
  * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.
486
443
  * @returns: **true** if consent status has been updated, **false** otherwise.
487
444
  */
488
445
  setUserDisagreeToAll: () => RNDidomi.setUserDisagreeToAll(),
489
-
490
446
  /**
491
447
  * Set the user status for purposes and vendors for consent and legitimate interest.
492
448
  * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.
@@ -496,7 +452,6 @@ const Didomi = {
496
452
  * @returns: **true** if consent status has been updated, **false** otherwise.
497
453
  */
498
454
  setUserStatus: (purposesConsentStatus, purposesLIStatus, vendorsConsentStatus, vendorsLIStatus) => RNDidomi.setUserStatus(purposesConsentStatus, purposesLIStatus, vendorsConsentStatus, vendorsLIStatus),
499
-
500
455
  /**
501
456
  * Set the user status for purposes and vendors for consent and legitimate interest.
502
457
  * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.
@@ -509,13 +464,11 @@ const Didomi = {
509
464
  * @param disabledLIVendorIds: List of vendor IDs to disable for LI.
510
465
  */
511
466
  setUserStatusSets: (enabledConsentPurposeIds, disabledConsentPurposeIds, enabledLIPurposeIds, disabledLIPurposeIds, enabledConsentVendorIds, disabledConsentVendorIds, enabledLIVendorIds, disabledLIVendorIds) => RNDidomi.setUserStatusSets(enabledConsentPurposeIds, disabledConsentPurposeIds, enabledLIPurposeIds, disabledLIPurposeIds, enabledConsentVendorIds, disabledConsentVendorIds, enabledLIVendorIds, disabledLIVendorIds),
512
-
513
467
  /**
514
468
  * Check if the consent should be collected depending on if we have any consents or if we have some consents but the number of days before displaying the notice again has not expired yet
515
469
  * @returns: A boolean depending if the consent should be collected or not
516
470
  */
517
471
  shouldConsentBeCollected: () => RNDidomi.shouldConsentBeCollected(),
518
-
519
472
  /**
520
473
  * Method used to update the selected language of the Didomi SDK and any property that depends on it.
521
474
  * In most cases this method doesn't need to be called. It would only be required for those apps that allow language change on-the-fly, i.e.: from within the app rather than from the device settings.