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