@didomi/react-native 1.0.0 → 1.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/src/Didomi.ts CHANGED
@@ -6,16 +6,16 @@ const { Didomi: RNDidomi } = NativeModules;
6
6
 
7
7
  export const Didomi = {
8
8
  /**
9
- Initialize the Didomi SDK
10
-
11
- @param apiKey: Public API key of the organization from the Didomi Console.
12
- @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.
13
- @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.
14
- @param providerId: Your provider ID (if any).
15
- @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to "false" for loading configuration from the Didomi Console.
16
- @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. This property allows you to override the default setting and specify a language to display the UI in. String containing the language code e.g.: "es", "fr", etc.
17
- @param noticeId: Notice id for the remote configuration.
18
- */
9
+ * Initialize the Didomi SDK
10
+ *
11
+ * @param apiKey: Public API key of the organization from the Didomi Console.
12
+ * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.
13
+ * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.
14
+ * @param providerId: Your provider ID (if any).
15
+ * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to "false" for loading configuration from the Didomi Console.
16
+ * @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. This property allows you to override the default setting and specify a language to display the UI in. String containing the language code e.g.: "es", "fr", etc.
17
+ * @param noticeId: Notice id for the remote configuration.
18
+ */
19
19
  initialize: (
20
20
  apiKey: string,
21
21
  localConfigurationPath?: string,
@@ -41,300 +41,326 @@ export const Didomi = {
41
41
  },
42
42
 
43
43
  /**
44
- -Provide the objects required to display UI elements
44
+ * Listen to SDK ready state
45
+ * */
46
+ onReady: (): Promise<void> => DidomiListener.onReady(),
47
+
48
+ /**
49
+ * Listen to SDK errors
50
+ * */
51
+ onError: (): Promise<any> => DidomiListener.onError(),
52
+
53
+ /**
54
+ Provide the objects required to display UI elements
45
55
  */
46
56
  setupUI: (): Promise<void> => RNDidomi.setupUI(),
47
57
 
48
58
  /**
49
- Set the minimum level of messages to log
50
-
51
- Messages with a level below `minLevel` will not be logged.
52
- Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):
53
- - OSLogType.info (1)
54
- - OSLogType.debug (2)
55
- - OSLogType.error (16)
56
- - OSLogType.fault (17)
57
-
58
- We recommend setting `OSLogType.error` (16) in production
59
-
60
- @param minLevel: Minimum level of messages to log
61
- */
59
+ * Set the minimum level of messages to log
60
+ * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize
61
+ *
62
+ * Messages with a level below `minLevel` will not be logged.
63
+ *
64
+ * For iOS:
65
+ * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):
66
+ * - OSLogType.info (1)
67
+ * - OSLogType.debug (2)
68
+ * - OSLogType.error (16)
69
+ * - OSLogType.fault (17)
70
+ *
71
+ * We recommend setting `OSLogType.error` (16) in production
72
+ *
73
+ * For Android:
74
+ * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.
75
+ * (https://developer.android.com/reference/android/util/Log#constants_1)
76
+ *
77
+ * We recommend setting `Log.INFO` (4) in production
78
+ *
79
+ * @param minLevel: Minimum level of messages to log
80
+ */
62
81
  setLogLevel: (level: number): Promise<number> => RNDidomi.setLogLevel(level),
63
82
 
64
83
  /**
65
- Add an event listener
66
- @param listener:
67
- */
84
+ * Add an event listener
85
+ * @param listener:
86
+ */
68
87
  addEventListener: (
69
88
  eventType: DidomiEventType,
70
89
  callback: (data: any) => void
71
90
  ) => DidomiListener.addEventListener(eventType, callback),
72
91
 
73
92
  /**
74
- Remove an event listener
75
- @param listener:
76
- */
93
+ * Remove an event listener
94
+ * @param listener:
95
+ */
77
96
  removeEventListener: (
78
97
  eventType: DidomiEventType,
79
98
  callback: (data: any) => void
80
99
  ) => DidomiListener.removeEventListener(eventType, callback),
81
100
 
82
101
  /**
83
- Remove all event listeners
84
- */
102
+ * Remove all event listeners
103
+ */
85
104
  removeAllEventListeners: () => DidomiListener.reset(),
86
105
 
87
106
  /**
88
- Method used to get an array of disabled purposes.
89
- @returns: array of disabled purposes.
90
- */
107
+ * Method used to get an array of disabled purposes.
108
+ * @returns: array of disabled purposes.
109
+ */
91
110
  getDisabledPurposes: (): Promise<any[]> => RNDidomi.getDisabledPurposes(),
92
111
 
93
112
  /**
94
- Method used to get a set of disabled purpose IDs.
95
- @returns: set that contains the IDs of disabled purposes.
96
- */
113
+ * Method used to get a set of disabled purpose IDs.
114
+ * @returns: set that contains the IDs of disabled purposes.
115
+ */
97
116
  getDisabledPurposeIds: (): Promise<any[]> => RNDidomi.getDisabledPurposeIds(),
98
117
 
99
118
  /**
100
- Method used to get an array of disabled vendors.
101
- @returns: array of disabled vendors.
102
- */
119
+ * Method used to get an array of disabled vendors.
120
+ * @returns: array of disabled vendors.
121
+ */
103
122
  getDisabledVendors: (): Promise<any[]> => RNDidomi.getDisabledVendors(),
104
123
 
105
124
  /**
106
- Method used to get a set of disabled vendor IDs.
107
- @returns: set that contains the IDs of disabled vendors.
108
- */
125
+ * Method used to get a set of disabled vendor IDs.
126
+ * @returns: set that contains the IDs of disabled vendors.
127
+ */
109
128
  getDisabledVendorIds: (): Promise<any[]> => RNDidomi.getDisabledVendorIds(),
110
129
 
111
130
  /**
112
- Method used to get an array of enabled purposes.
113
- @returns: array of enabled purposes.
114
- */
131
+ * Method used to get an array of enabled purposes.
132
+ * @returns: array of enabled purposes.
133
+ */
115
134
  getEnabledPurposes: (): Promise<any[]> => RNDidomi.getEnabledPurposes(),
116
135
 
117
136
  /**
118
- Method used to get a set of enabled purpose IDs.
119
- @returns: set that contains the IDs of enabled purposes.
120
- */
137
+ * Method used to get a set of enabled purpose IDs.
138
+ * @returns: set that contains the IDs of enabled purposes.
139
+ */
121
140
  getEnabledPurposeIds: (): Promise<any[]> => RNDidomi.getEnabledPurposeIds(),
122
141
 
123
142
  /**
124
- Method used to get an array of enabled vendors.
125
- @returns: array of enabled vendors.
126
- */
143
+ * Method used to get an array of enabled vendors.
144
+ * @returns: array of enabled vendors.
145
+ */
127
146
  getEnabledVendors: (): Promise<any[]> => RNDidomi.getEnabledVendors(),
128
147
 
129
148
  /**
130
- Method used to get a set of enabled vendor IDs.
131
- @returns: set that contains the IDs of enabled vendors.
132
- */
149
+ * Method used to get a set of enabled vendor IDs.
150
+ * @returns: set that contains the IDs of enabled vendors.
151
+ */
133
152
  getEnabledVendorIds: (): Promise<any[]> => RNDidomi.getEnabledVendorIds(),
134
153
 
135
154
  /**
136
- Get JavaScript to embed into a WebView to pass the consent status from the app
137
- to the Didomi Web SDK embedded into the WebView
138
- Inject the returned JavaScript into a WebView
139
- @param extra: Extra JavaScript to inject in the returned code
140
- @returns: JavaScript code to inject in a WebView
141
- */
142
- getJavaScriptForWebView: (): Promise<string> =>
143
- RNDidomi.getJavaScriptForWebView(),
155
+ * Get JavaScript to embed into a WebView to pass the consent status from the app
156
+ * to the Didomi Web SDK embedded into the WebView
157
+ * Inject the returned JavaScript into a WebView
158
+ * @param extra: Extra JavaScript to inject in the returned code
159
+ * @returns: JavaScript code to inject in a WebView
160
+ */
161
+ getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),
144
162
 
145
- getQueryStringForWebView: (): Promise<string> =>
146
- RNDidomi.getQueryStringForWebView(),
163
+ getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),
147
164
 
148
165
  /**
149
- Method used to get a Purpose based on its ID.
150
- @param purposeId: purpose ID used in the search.
151
- @returns: purpose found in the array.
152
- */
153
- getPurpose: (purposeId: string): Promise<any[]> =>
154
- RNDidomi.getPurpose(purposeId),
166
+ * Method used to get a Purpose based on its ID.
167
+ * @param purposeId: purpose ID used in the search.
168
+ * @returns: purpose found in the array.
169
+ */
170
+ getPurpose: (purposeId: string): Promise<any> => RNDidomi.getPurpose(purposeId),
155
171
 
156
172
  /**
157
- Method used to get an array of required purposes.
158
-
159
- @returns: array of required purposes.
160
- */
173
+ * Method used to get an array of required purposes.
174
+ *
175
+ * @returns: array of required purposes.
176
+ */
161
177
  getRequiredPurposes: (): Promise<any[]> => RNDidomi.getRequiredPurposes(),
162
178
 
163
179
  /**
164
- Get the configured purpose IDs
165
- @returns: set of purpose IDs.
166
- */
180
+ * Get the configured purpose IDs
181
+ * @returns: set of purpose IDs.
182
+ */
167
183
  getRequiredPurposeIds: (): Promise<any[]> => RNDidomi.getRequiredPurposeIds(),
168
184
 
169
185
  /**
170
- Method used to get an array of required vendors.
171
- @returns: array of required vendors.
172
- */
186
+ * Method used to get an array of required vendors.
187
+ * @returns: array of required vendors.
188
+ */
173
189
  getRequiredVendors: (): Promise<any[]> => RNDidomi.getRequiredVendors(),
174
190
 
175
191
  /**
176
- Get the configured vendor IDs
177
- @returns: set of vendor IDs.
178
- */
192
+ * Get the configured vendor IDs
193
+ * @returns: set of vendor IDs.
194
+ */
179
195
  getRequiredVendorIds: (): Promise<any[]> => RNDidomi.getRequiredVendorIds(),
180
196
 
181
197
  /**
182
- Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
183
- for a given key.
184
- @param key: used to find its corresponding value in the dictionary/map.
185
- @returns: dictionary containing the different translations for a given key.
186
- */
198
+ * Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
199
+ * for a given key.
200
+ * @param key: used to find its corresponding value in the dictionary/map.
201
+ * @returns: dictionary containing the different translations for a given key.
202
+ */
187
203
  getText: (key: string): Promise<any[]> => RNDidomi.getText(key),
188
204
 
189
205
  /**
190
- Method used to get a translated text based on the key being passed.
191
- The language and the source of this translated text will depend on the availability of the translation for the specific key.
192
- The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.
193
-
194
- These are the attempts performed by the SDK to try to find a translation for the specific key:
195
- - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).
196
- - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).
197
- - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).
198
- - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).
199
-
200
- If no translation can be found after these 4 attempts, the key will be returned.
201
-
202
- App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:
203
- - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts
204
- - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text
205
- - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices
206
-
207
- @param key: used to find its corresponding value in one of the different sources.
208
- @returns: a translated string if a translation was found, the same key that was passed otherwise.
209
- */
210
- getTranslatedText: (key: string): Promise<string> =>
211
- RNDidomi.getTranslatedText(key),
212
-
213
- /**
214
- Get the user consent status for a specific purpose
215
- @param purposeId: The purpose ID to check consent for
216
- @returns: The user consent status for the specified purpose
217
- */
218
- getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> =>
219
- RNDidomi.getUserConsentStatusForPurpose(purposeId),
220
-
221
- /**
222
- Get the user consent status for a specific vendor
223
- @param vendorId: The vendor ID to check consent for
224
- @returns: The user consent status for the specified vendor
225
- */
226
- getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> =>
227
- RNDidomi.getUserConsentStatusForVendor(vendorId),
228
-
229
- /**
230
- Get the user consent status for a specific vendor and all its purposes
231
- @param vendorId: The ID of the vendor
232
- @returns: The user consent status corresponding to the specified vendor and all its required purposes.
233
- */
234
- getUserConsentStatusForVendorAndRequiredPurposes: (
235
- vendorId: string
236
- ): Promise<boolean> =>
237
- RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
238
-
239
- /**
240
- Get the user legitimate interest status for a specific purpose.
241
- @param purposeId: purpose ID.
242
- @returns: LI status of a purpose.
243
- */
244
- getUserLegitimateInterestStatusForPurpose: (
245
- purposeId: string
246
- ): Promise<boolean> =>
247
- RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
248
-
249
- /**
250
- Get the user legitimate interest status for a specific vendor.
251
- @param vendorId: vendor ID.
252
- @returns: LI status of a vendor.
253
- */
254
- getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> =>
255
- RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
256
-
257
- /**
258
- Get the user LI status for a specific vendor and all its purposes.
259
- @param vendorId: vendor ID.
260
- @returns: The user LI status corresponding to the specified vendor and all its required purposes.
261
- */
262
- getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (
263
- vendorId: string
264
- ): boolean =>
265
- RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(
266
- vendorId
267
- ),
268
-
269
- /**
270
- Get the user consent and legitimate interest status for a specific vendor.
271
- @param vendorId: vendor ID.
272
- @returns: status that represents both consent and legitimate interest status of a vendor.
273
- */
274
- getUserStatusForVendor: (vendorId: string): Promise<boolean> =>
275
- RNDidomi.getUserStatusForVendor(vendorId),
276
-
277
- /**
278
- Method used to get a Vendor based on its ID.
279
- @param vendorId: vendor ID used in the search.
280
- @returns: vendor found in the array.
281
- */
282
- getVendor: (vendorId: string): Promise<any[]> => RNDidomi.getVendor(vendorId),
283
-
284
- /**
285
- - Hide the notice if it is currently displayed
286
- */
206
+ * Method used to get a translated text based on the key being passed.
207
+ * The language and the source of this translated text will depend on the availability of the translation for the specific key.
208
+ * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.
209
+ *
210
+ * These are the attempts performed by the SDK to try to find a translation for the specific key:
211
+ * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).
212
+ * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).
213
+ * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).
214
+ * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).
215
+ *
216
+ * If no translation can be found after these 4 attempts, the key will be returned.
217
+ *
218
+ * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:
219
+ * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts
220
+ * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text
221
+ * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices
222
+ *
223
+ * @param key: used to find its corresponding value in one of the different sources.
224
+ * @returns: a translated string if a translation was found, the same key that was passed otherwise.
225
+ */
226
+ getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),
227
+
228
+ /**
229
+ * Get the user consent status for a specific purpose
230
+ * @param purposeId: The purpose ID to check consent for
231
+ * @returns: The user consent status for the specified purpose
232
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
233
+ * getUserStatus().getPurposes().getConsent().getEnabled() or
234
+ * getUserStatus().getPurposes().getConsent().getDisabled().
235
+ */
236
+ getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),
237
+
238
+ /**
239
+ * Get the user consent status for a specific vendor
240
+ * @param vendorId: The vendor ID to check consent for
241
+ * @returns: The user consent status for the specified vendor
242
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
243
+ * getUserStatus().getVendors().getConsent().getEnabled() or
244
+ * getUserStatus().getVendors().getConsent().getDisabled().
245
+ */
246
+ getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),
247
+
248
+ /**
249
+ * Get the user consent status for a specific vendor and all its purposes
250
+ * @param vendorId: The ID of the vendor
251
+ * @returns: The user consent status corresponding to the specified vendor and all its required purposes.
252
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
253
+ * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
254
+ * getUserStatus().getVendors().getGlobalConsent().getDisabled().
255
+ */
256
+ getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
257
+
258
+ /**
259
+ * Get the user legitimate interest status for a specific purpose.
260
+ * @param purposeId: purpose ID.
261
+ * @returns: LI status of a purpose.
262
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
263
+ * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
264
+ * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
265
+ */
266
+ getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
267
+
268
+ /**
269
+ * Get the user legitimate interest status for a specific vendor.
270
+ * @param vendorId: vendor ID.
271
+ * @returns: LI status of a vendor.
272
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
273
+ * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
274
+ * getUserStatus().getVendors().getLegitimateInterest().getDisabled().
275
+ */
276
+ getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
277
+
278
+ /**
279
+ * Get the user LI status for a specific vendor and all its purposes.
280
+ * @param vendorId: vendor ID.
281
+ * @returns: The user LI status corresponding to the specified vendor and all its required purposes.
282
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
283
+ * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
284
+ * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
285
+ */
286
+ getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
287
+
288
+ /**
289
+ * Get the user consent status.
290
+ * @returns: status that represents user consent.
291
+ */
292
+ getUserStatus: (): Promise<any> => RNDidomi.getUserStatus(),
293
+
294
+ /**
295
+ * Get the user consent and legitimate interest status for a specific vendor.
296
+ * @param vendorId: vendor ID.
297
+ * @returns: status that represents both consent and legitimate interest status of a vendor.
298
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
299
+ * getUserStatus().getVendors().getGlobal().getEnabled() or
300
+ * getUserStatus().getVendors().getGlobal().getDisabled().
301
+ */
302
+ getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),
303
+
304
+ /**
305
+ * Method used to get a Vendor based on its ID.
306
+ * @param vendorId: vendor ID used in the search.
307
+ * @returns: vendor found in the array.
308
+ */
309
+ getVendor: (vendorId: string): Promise<any> => RNDidomi.getVendor(vendorId),
310
+
311
+ /**
312
+ * Hide the notice if it is currently displayed
313
+ */
287
314
  hideNotice: (): Promise<void> => RNDidomi.hideNotice(),
288
315
 
289
316
  /**
290
- - Hide the preferences popup for purposes
291
- */
317
+ * Hide the preferences popup for purposes
318
+ */
292
319
  hidePreferences: (): Promise<void> => RNDidomi.hidePreferences(),
293
320
 
294
321
  /**
295
- Determine if consent is required for the user. The rules are (OR):
296
- - The user country is in the EU.
297
- - The company is from the EU.
298
- - The user country is unknown and the app has chosen to collect consent when unknown.
299
- @returns: **true** if consent is required, **false** if it is not required.
300
- */
322
+ * Determine if consent is required for the user. The rules are (OR):
323
+ * - The user country is in the EU.
324
+ * - The company is from the EU.
325
+ * - The user country is unknown and the app has chosen to collect consent when unknown.
326
+ * @returns: **true** if consent is required, **false** if it is not required.
327
+ */
301
328
  isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),
302
329
 
303
330
  /**
304
- Determine if consent information is available for all purposes and vendors that are required
305
- @returns: **true** if consent is required and consent information is available, **false** otherwise.
306
- */
307
- isUserConsentStatusPartial: (): Promise<boolean> =>
308
- RNDidomi.isUserConsentStatusPartial(),
331
+ * Determine if consent information is available for all purposes and vendors that are required
332
+ * @returns: **true** if consent is required and consent information is available, **false** otherwise.
333
+ */
334
+ isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),
309
335
 
310
336
  /**
311
- Check if the consent notice is currently displayed
312
- @returns: **true** if the notice is displayed, **false** if is not.
313
- */
337
+ * Check if the consent notice is currently displayed
338
+ * @returns: **true** if the notice is displayed, **false** if is not.
339
+ */
314
340
  isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),
315
341
 
316
342
  /**
317
- Method used to check if the Preferences view is visible.
318
- @returns: **true** if Preferences view is visible, **false** otherwise.
319
- */
343
+ * Method used to check if the Preferences view is visible.
344
+ * @returns: **true** if Preferences view is visible, **false** otherwise.
345
+ */
320
346
  isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),
321
347
 
322
348
  isError: (): Promise<boolean> => RNDidomi.isError(),
323
349
 
324
350
  /**
325
- Is the Didomi SDK ready?
326
- */
351
+ * Is the Didomi SDK ready?
352
+ */
327
353
  isReady: (): Promise<boolean> => RNDidomi.isReady(),
328
354
 
329
355
  /**
330
- Set user information with authentication
331
-
332
- @param id Organization user ID
333
- @param algorithm Algorithm used for computing the digest
334
- @param secretId ID of the secret used for computing the digest
335
- @param salt Salt used for computing the digest (optional)
336
- @param digest Digest of the organization user ID and secret
337
- */
356
+ * Set user information with authentication
357
+ *
358
+ * @param id Organization user ID
359
+ * @param algorithm Algorithm used for computing the digest
360
+ * @param secretId ID of the secret used for computing the digest
361
+ * @param salt Salt used for computing the digest (optional)
362
+ * @param digest Digest of the organization user ID and secret
363
+ */
338
364
  setUser: (
339
365
  organizationUserId: string,
340
366
  organizationUserIdAuthAlgorithm: string,
@@ -351,37 +377,35 @@ export const Didomi = {
351
377
  ),
352
378
 
353
379
  /**
354
- - Show the consent notice (if required, not disabled in the config and not already displayed)
355
- */
380
+ * Show the consent notice (if required, not disabled in the config and not already displayed)
381
+ */
356
382
  showNotice: (): Promise<void> => RNDidomi.showNotice(),
357
383
 
358
384
  /**
359
- Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.
360
- @param controller: view controller from where preferences will be presented.
361
- @param view: a value from `Didomi.Views`. It can be `.purposes` or `.vendors` (`ViewsPurposes` or `ViewsVendors` in Objective-C)
362
- */
363
- showPreferences: (view?: string): Promise<void> =>
364
- RNDidomi.showPreferences(view),
385
+ * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.
386
+ * @param view: It can be `purposes` or `vendors`
387
+ */
388
+ showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),
365
389
 
366
390
  /**
367
- Remove all consents for the user
368
- */
391
+ * Remove all consents for the user
392
+ */
369
393
  reset: (): Promise<void> => RNDidomi.reset(),
370
394
 
371
395
  /**
372
- Method that allows to enable consent and legitimate interest for all the required purposes.
373
- @returns: **true** if consent status has been updated, **false** otherwise.
374
- */
396
+ * Method that allows to enable consent and legitimate interest for all the required purposes.
397
+ * @returns: **true** if consent status has been updated, **false** otherwise.
398
+ */
375
399
  setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),
376
400
 
377
401
  /**
378
- Set the user consent status.
379
- @param enabledPurposeIds: set containing **enabled purpose ids**
380
- @param disabledPurposeIds: set containing **disabled purpose ids**
381
- @param enabledVendorIds: set containing **enabled vendor ids**
382
- @param disabledVendorIds: set containing **disabled purpose ids**
383
- @returns: **true** if consent status has been updated, **false** otherwise.
384
- */
402
+ * Set the user consent status.
403
+ * @param enabledPurposeIds: set containing **enabled purpose ids**
404
+ * @param disabledPurposeIds: set containing **disabled purpose ids**
405
+ * @param enabledVendorIds: set containing **enabled vendor ids**
406
+ * @param disabledVendorIds: set containing **disabled purpose ids**
407
+ * @returns: **true** if consent status has been updated, **false** otherwise.
408
+ */
385
409
  setUserConsentStatus: (
386
410
  enabledPurposeIds: string[],
387
411
  disabledPurposeIds: string[],
@@ -396,19 +420,19 @@ export const Didomi = {
396
420
  ),
397
421
 
398
422
  /**
399
- Method that allows to disable consent and legitimate interest for all the required purposes and vendors.
400
- @returns: **true** if consent status has been updated, **false** otherwise.
401
- */
423
+ * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.
424
+ * @returns: **true** if consent status has been updated, **false** otherwise.
425
+ */
402
426
  setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),
403
427
 
404
428
  /**
405
- Set the user status for purposes and vendors for consent and legitimate interest.
406
- @params purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.
407
- @params purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.
408
- @params vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.
409
- @params vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.
410
- @returns: **true** if consent status has been updated, **false** otherwise.
411
- */
429
+ * Set the user status for purposes and vendors for consent and legitimate interest.
430
+ * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.
431
+ * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.
432
+ * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.
433
+ * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.
434
+ * @returns: **true** if consent status has been updated, **false** otherwise.
435
+ */
412
436
  setUserStatus: (
413
437
  purposesConsentStatus: boolean,
414
438
  purposesLIStatus: boolean,
@@ -423,17 +447,16 @@ export const Didomi = {
423
447
  ),
424
448
 
425
449
  /**
426
- Set the user status for purposes and vendors for consent and legitimate interest.
427
-
428
- @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.
429
- @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.
430
- @param enabledLIPurposeIds: List of purpose IDs to enable for LI.
431
- @param disabledLIPurposeIds: List of purpose IDs to disable for LI.
432
- @param enabledConsentVendorIds: List of vendor IDs to enable for consent.
433
- @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
434
- @param enabledLIVendorIds: List of vendor IDs to enable for LI.
435
- @param disabledLIVendorIds: List of vendor IDs to disable for LI.
436
- */
450
+ * Set the user status for purposes and vendors for consent and legitimate interest.
451
+ * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.
452
+ * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.
453
+ * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.
454
+ * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.
455
+ * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.
456
+ * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
457
+ * @param enabledLIVendorIds: List of vendor IDs to enable for LI.
458
+ * @param disabledLIVendorIds: List of vendor IDs to disable for LI.
459
+ */
437
460
  setUserStatusSets: (
438
461
  enabledConsentPurposeIds: string[],
439
462
  disabledConsentPurposeIds: string[],
@@ -456,19 +479,18 @@ export const Didomi = {
456
479
  ),
457
480
 
458
481
  /**
459
- 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
460
- @returns: A boolean depending if the consent should be collected or not
461
- */
482
+ * 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
483
+ * @returns: A boolean depending if the consent should be collected or not
484
+ */
462
485
  shouldConsentBeCollected: (): Promise<boolean> =>
463
486
  RNDidomi.shouldConsentBeCollected(),
464
487
 
465
488
  /**
466
- Method used to update the selected language of the Didomi SDK and any property that depends on it.
467
- 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.
468
- In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.
469
-
470
- @param languageCode: string containing the language code e.g.: "es", "fr", etc.
471
- */
489
+ * Method used to update the selected language of the Didomi SDK and any property that depends on it.
490
+ * 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.
491
+ * In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.
492
+ * @param languageCode: string containing the language code e.g.: "es", "fr", etc.
493
+ */
472
494
  updateSelectedLanguage: (languageCode: string): Promise<void> =>
473
495
  RNDidomi.updateSelectedLanguage(languageCode),
474
496
  };