@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/README.md +23 -9
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +33 -4
- package/android/src/main/java/com/reactnativedidomi/EventTypes.kt +4 -0
- package/ios/Didomi.m +10 -0
- package/ios/RNDidomi.swift +69 -18
- package/lib/commonjs/Didomi.js +257 -213
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiListener.js +27 -0
- package/lib/commonjs/DidomiListener.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js +2 -0
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/module/Didomi.js +257 -213
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiListener.js +27 -0
- package/lib/module/DidomiListener.js.map +1 -1
- package/lib/module/DidomiTypes.js +2 -0
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/typescript/Didomi.d.ts +256 -216
- package/lib/typescript/DidomiListener.d.ts +2 -0
- package/lib/typescript/DidomiTypes.d.ts +28 -0
- package/package.json +8 -7
- package/react-native-didomi.podspec +3 -3
- package/src/Didomi.ts +288 -266
- package/src/DidomiListener.ts +37 -0
- package/src/DidomiTypes.ts +32 -0
package/lib/module/Didomi.js
CHANGED
|
@@ -5,16 +5,16 @@ const {
|
|
|
5
5
|
} = NativeModules;
|
|
6
6
|
export const Didomi = {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
* Add an event listener
|
|
67
|
+
* @param listener:
|
|
68
|
+
*/
|
|
50
69
|
addEventListener: (eventType, callback) => DidomiListener.addEventListener(eventType, callback),
|
|
51
70
|
|
|
52
71
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
* Remove an event listener
|
|
73
|
+
* @param listener:
|
|
74
|
+
*/
|
|
56
75
|
removeEventListener: (eventType, callback) => DidomiListener.removeEventListener(eventType, callback),
|
|
57
76
|
|
|
58
77
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
* Remove all event listeners
|
|
79
|
+
*/
|
|
61
80
|
removeAllEventListeners: () => DidomiListener.reset(),
|
|
62
81
|
|
|
63
82
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
71
|
-
|
|
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
|
-
|
|
77
|
-
|
|
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
|
-
|
|
83
|
-
|
|
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
|
-
|
|
89
|
-
|
|
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
|
-
|
|
95
|
-
|
|
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
|
-
|
|
101
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
155
|
+
* Get the configured purpose IDs
|
|
156
|
+
* @returns: set of purpose IDs.
|
|
157
|
+
*/
|
|
139
158
|
getRequiredPurposeIds: () => RNDidomi.getRequiredPurposeIds(),
|
|
140
159
|
|
|
141
160
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
167
|
+
* Get the configured vendor IDs
|
|
168
|
+
* @returns: set of vendor IDs.
|
|
169
|
+
*/
|
|
151
170
|
getRequiredVendorIds: () => RNDidomi.getRequiredVendorIds(),
|
|
152
171
|
|
|
153
172
|
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
242
|
-
|
|
287
|
+
* Hide the notice if it is currently displayed
|
|
288
|
+
*/
|
|
243
289
|
hideNotice: () => RNDidomi.hideNotice(),
|
|
244
290
|
|
|
245
291
|
/**
|
|
246
|
-
|
|
247
|
-
|
|
292
|
+
* Hide the preferences popup for purposes
|
|
293
|
+
*/
|
|
248
294
|
hidePreferences: () => RNDidomi.hidePreferences(),
|
|
249
295
|
|
|
250
296
|
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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
|
-
|
|
261
|
-
|
|
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
|
-
|
|
267
|
-
|
|
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
|
-
|
|
273
|
-
|
|
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
|
-
|
|
280
|
-
|
|
325
|
+
* Is the Didomi SDK ready?
|
|
326
|
+
*/
|
|
281
327
|
isReady: () => RNDidomi.isReady(),
|
|
282
328
|
|
|
283
329
|
/**
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
308
|
-
|
|
352
|
+
* Remove all consents for the user
|
|
353
|
+
*/
|
|
309
354
|
reset: () => RNDidomi.reset(),
|
|
310
355
|
|
|
311
356
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
329
|
-
|
|
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
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
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
|
-
|
|
358
|
-
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|