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