@didomi/react-native 1.1.0 → 1.5.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 +1 -1
- package/android/build.gradle +6 -2
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/java/com/reactnativedidomi/DidomiModule.kt +52 -21
- package/android/src/main/java/com/reactnativedidomi/EventTypes.kt +2 -0
- package/ios/Didomi.m +7 -11
- package/ios/RNDidomi.swift +46 -22
- package/lib/commonjs/Constants.js +13 -0
- package/lib/commonjs/Constants.js.map +1 -0
- package/lib/commonjs/Didomi.js +35 -6
- package/lib/commonjs/Didomi.js.map +1 -1
- package/lib/commonjs/DidomiTypes.js +2 -0
- package/lib/commonjs/DidomiTypes.js.map +1 -1
- package/lib/module/Constants.js +5 -0
- package/lib/module/Constants.js.map +1 -0
- package/lib/module/Didomi.js +34 -6
- package/lib/module/Didomi.js.map +1 -1
- package/lib/module/DidomiTypes.js +2 -0
- package/lib/module/DidomiTypes.js.map +1 -1
- package/lib/typescript/Constants.d.ts +2 -0
- package/lib/typescript/Didomi.d.ts +31 -5
- package/lib/typescript/DidomiTypes.d.ts +28 -0
- package/package.json +2 -2
- package/react-native-didomi.podspec +1 -1
- package/src/Constants.ts +4 -0
- package/src/Didomi.ts +47 -38
- package/src/DidomiTypes.ts +32 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Didomi.addEventListener(DidomiEventType.SHOW_NOTICE, () => {
|
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
For a complete overview of available methods and events, have a look at the [online documentation](https://developers.didomi.io/cmp/react-native).
|
|
57
|
+
For a complete overview of available methods and events, have a look at the [online documentation](https://developers.didomi.io/cmp/mobile-sdk/react-native).
|
|
58
58
|
|
|
59
59
|
## Configuration with local file
|
|
60
60
|
|
package/android/build.gradle
CHANGED
|
@@ -25,6 +25,8 @@ def getExtOrIntegerDefault(name) {
|
|
|
25
25
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Didomi_" + name]).toInteger()
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
def parsedPackage = new groovy.json.JsonSlurper().parseText(file("../package.json").text)
|
|
29
|
+
|
|
28
30
|
android {
|
|
29
31
|
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
30
32
|
buildToolsVersion getExtOrDefault("buildToolsVersion")
|
|
@@ -32,8 +34,10 @@ android {
|
|
|
32
34
|
minSdkVersion 16
|
|
33
35
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
34
36
|
versionCode 1
|
|
35
|
-
versionName "
|
|
37
|
+
versionName "${parsedPackage.version}"
|
|
36
38
|
|
|
39
|
+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
40
|
+
multiDexEnabled = true
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
buildTypes {
|
|
@@ -128,5 +132,5 @@ dependencies {
|
|
|
128
132
|
api "com.facebook.react:react-native:+"
|
|
129
133
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
130
134
|
|
|
131
|
-
implementation "io.didomi.sdk:android:1.
|
|
135
|
+
implementation "io.didomi.sdk:android:1.55.0"
|
|
132
136
|
}
|
|
@@ -9,6 +9,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
9
9
|
import com.google.gson.Gson
|
|
10
10
|
import com.google.gson.reflect.TypeToken
|
|
11
11
|
import io.didomi.sdk.Didomi
|
|
12
|
+
import io.didomi.sdk.DidomiInitializeParameters
|
|
12
13
|
import io.didomi.sdk.events.*
|
|
13
14
|
import io.didomi.sdk.exceptions.DidomiNotReadyException
|
|
14
15
|
|
|
@@ -36,12 +37,12 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
36
37
|
override fun consentChanged(event: ConsentChangedEvent) = prepareEvent(EventTypes.CONSENT_CHANGED.event, null)
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
* The notice is being hidden
|
|
40
|
+
* The notice screen is being hidden
|
|
40
41
|
*/
|
|
41
42
|
override fun hideNotice(event: HideNoticeEvent) = prepareEvent(EventTypes.HIDE_NOTICE.event, null)
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* The notice is being shown
|
|
45
|
+
* The notice screen is being shown
|
|
45
46
|
*/
|
|
46
47
|
override fun showNotice(event: ShowNoticeEvent) = prepareEvent(EventTypes.SHOW_NOTICE.event, null)
|
|
47
48
|
|
|
@@ -70,6 +71,16 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
70
71
|
*/
|
|
71
72
|
override fun noticeClickPrivacyPolicy(event: NoticeClickPrivacyPolicyEvent) = prepareEvent(EventTypes.NOTICE_CLICK_PRIVACY_POLICY.event, null)
|
|
72
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The preferences screen is being hidden
|
|
76
|
+
*/
|
|
77
|
+
override fun hidePreferences(event: HidePreferencesEvent) = prepareEvent(EventTypes.HIDE_PREFERENCES.event, null)
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The preferences screen is being shown
|
|
81
|
+
*/
|
|
82
|
+
override fun showPreferences(event: ShowPreferencesEvent) = prepareEvent(EventTypes.SHOW_PREFERENCES.event, null)
|
|
83
|
+
|
|
73
84
|
/**
|
|
74
85
|
* Click on agree to all on preferences popup
|
|
75
86
|
*/
|
|
@@ -221,28 +232,34 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
221
232
|
}
|
|
222
233
|
|
|
223
234
|
@ReactMethod
|
|
224
|
-
fun initialize(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
fun initialize(
|
|
236
|
+
userAgentName: String,
|
|
237
|
+
userAgentVersion: String,
|
|
238
|
+
apiKey: String,
|
|
239
|
+
localConfigurationPath: String?,
|
|
240
|
+
remoteConfigurationUrl: String?,
|
|
241
|
+
providerId: String?,
|
|
242
|
+
disableDidomiRemoteConfig: Boolean,
|
|
243
|
+
languageCode: String?,
|
|
244
|
+
noticeId: String?,
|
|
245
|
+
promise: Promise) {
|
|
232
246
|
try {
|
|
233
247
|
Didomi.getInstance().addEventListener(eventListener)
|
|
234
248
|
|
|
235
|
-
Didomi.getInstance().
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
249
|
+
Didomi.getInstance().setUserAgent(userAgentName, userAgentVersion)
|
|
250
|
+
|
|
251
|
+
val parameters = DidomiInitializeParameters(
|
|
252
|
+
apiKey,
|
|
253
|
+
localConfigurationPath,
|
|
254
|
+
remoteConfigurationUrl,
|
|
255
|
+
providerId,
|
|
256
|
+
disableDidomiRemoteConfig,
|
|
257
|
+
languageCode,
|
|
258
|
+
noticeId
|
|
244
259
|
)
|
|
245
260
|
|
|
261
|
+
Didomi.getInstance().initialize(currentActivity?.application, parameters)
|
|
262
|
+
|
|
246
263
|
Didomi.getInstance().onReady { prepareEvent(EventTypes.READY_CALLBACK.event, null) }
|
|
247
264
|
Didomi.getInstance().onError { prepareEvent(EventTypes.ERROR_CALLBACK.event, null) }
|
|
248
265
|
|
|
@@ -353,9 +370,14 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
353
370
|
}
|
|
354
371
|
|
|
355
372
|
@ReactMethod
|
|
356
|
-
fun getJavaScriptForWebView(promise: Promise) {
|
|
373
|
+
fun getJavaScriptForWebView(extra: String?, promise: Promise) {
|
|
357
374
|
try {
|
|
358
|
-
|
|
375
|
+
extra?.let {
|
|
376
|
+
promise.resolve(Didomi.getInstance().getJavaScriptForWebView(extra))
|
|
377
|
+
} ?: run {
|
|
378
|
+
promise.resolve(Didomi.getInstance().getJavaScriptForWebView())
|
|
379
|
+
}
|
|
380
|
+
|
|
359
381
|
} catch (e: DidomiNotReadyException) {
|
|
360
382
|
promise.reject(e)
|
|
361
383
|
}
|
|
@@ -494,6 +516,15 @@ class DidomiModule(reactContext: ReactApplicationContext) : ReactContextBaseJava
|
|
|
494
516
|
}
|
|
495
517
|
}
|
|
496
518
|
|
|
519
|
+
@ReactMethod
|
|
520
|
+
fun getUserStatus(promise: Promise) {
|
|
521
|
+
try {
|
|
522
|
+
promise.resolve(objectToWritableMap(Didomi.getInstance().getUserStatus()))
|
|
523
|
+
} catch (e: DidomiNotReadyException) {
|
|
524
|
+
promise.reject(e)
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
497
528
|
@ReactMethod
|
|
498
529
|
fun getUserStatusForVendor(vendorId: String, promise: Promise) {
|
|
499
530
|
try {
|
|
@@ -13,6 +13,8 @@ enum class EventTypes(val event: String) {
|
|
|
13
13
|
NOTICE_CLICK_MORE_INFO("on_notice_click_more_info"),
|
|
14
14
|
NOTICE_CLICK_VIEW_VENDORS("on_notice_click_view_vendors"),
|
|
15
15
|
NOTICE_CLICK_PRIVACY_POLICY("on_notice_click_privacy_policy"),
|
|
16
|
+
HIDE_PREFERENCES("on_hide_preferences"),
|
|
17
|
+
SHOW_PREFERENCES("on_show_preferences"),
|
|
16
18
|
PREFERENCES_CLICK_AGREE_TO_ALL("on_preferences_click_agree_to_all"),
|
|
17
19
|
PREFERENCES_CLICK_DISAGREE_TO_ALL("on_preferences_click_disagree_to_all"),
|
|
18
20
|
PREFERENCES_CLICK_PURPOSE_AGREE("on_preferences_click_purpose_agree"),
|
package/ios/Didomi.m
CHANGED
|
@@ -4,16 +4,12 @@
|
|
|
4
4
|
@interface RCT_EXTERN_MODULE(Didomi, RCTEventEmitter)
|
|
5
5
|
|
|
6
6
|
RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
|
|
7
|
-
|
|
7
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
8
8
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// providerId:(nullable NSString *)providerId
|
|
14
|
-
// disableDidomiRemoteConfig:(BOOL)disableDidomiRemoteConfig)
|
|
15
|
-
|
|
16
|
-
RCT_EXTERN_METHOD(initialize:(NSString *)apikey
|
|
10
|
+
RCT_EXTERN_METHOD(initialize:(NSString *)userAgentName
|
|
11
|
+
userAgentVersion:(NSString *)userAgentVersion
|
|
12
|
+
apiKey:(NSString *)apiKey
|
|
17
13
|
localConfigurationPath:(nullable NSString *)localConfigurationPath
|
|
18
14
|
remoteConfigurationURL:(nullable NSString *)remoteConfigurationURL
|
|
19
15
|
providerId:(nullable NSString *)providerId
|
|
@@ -28,9 +24,6 @@ RCT_EXTERN_METHOD(onError)
|
|
|
28
24
|
RCT_EXTERN_METHOD(getQueryStringForWebView:(RCTPromiseResolveBlock)resolve
|
|
29
25
|
reject:(RCTPromiseRejectBlock)reject)
|
|
30
26
|
|
|
31
|
-
RCT_EXTERN_METHOD(setUserAgent:(NSString *)name
|
|
32
|
-
version:(NSString *)version)
|
|
33
|
-
|
|
34
27
|
RCT_EXTERN_METHOD(setUserConsentStatus:(NSArray<NSString *> *)enabledPurposeIds
|
|
35
28
|
disabledPurposeIds:(NSArray<NSString *> *)disabledPurposeIds
|
|
36
29
|
enabledVendorIds:(NSArray<NSString *> *)enabledVendorIds
|
|
@@ -52,6 +45,9 @@ RCT_EXTERN_METHOD(getUserLegitimateInterestStatusForPurpose:(NSString *)purposeI
|
|
|
52
45
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
53
46
|
reject:(RCTPromiseRejectBlock)reject)
|
|
54
47
|
|
|
48
|
+
RCT_EXTERN_METHOD(getUserStatus:(RCTPromiseResolveBlock)resolve
|
|
49
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
50
|
+
|
|
55
51
|
RCT_EXTERN_METHOD(getUserStatusForVendor:(NSString *)vendorId
|
|
56
52
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
57
53
|
reject:(RCTPromiseRejectBlock)reject)
|
package/ios/RNDidomi.swift
CHANGED
|
@@ -5,23 +5,33 @@ import AppTrackingTransparency
|
|
|
5
5
|
@objc(Didomi)
|
|
6
6
|
class RNDidomi: RCTEventEmitter {
|
|
7
7
|
|
|
8
|
-
var initialized = false
|
|
8
|
+
public static var initialized = false
|
|
9
9
|
let didomiEventListener = EventListener()
|
|
10
10
|
|
|
11
11
|
override static func requiresMainQueueSetup() -> Bool {
|
|
12
12
|
return true
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
@objc(initialize:localConfigurationPath:remoteConfigurationURL:providerId:disableDidomiRemoteConfig:languageCode:noticeId:)
|
|
16
|
-
func initialize(apiKey: String, localConfigurationPath: String?, remoteConfigurationURL: String?, providerId: String?, disableDidomiRemoteConfig: Bool = false, languageCode: String? = nil, noticeId: String? = nil) {
|
|
15
|
+
@objc(initialize:userAgentVersion:apiKey:localConfigurationPath:remoteConfigurationURL:providerId:disableDidomiRemoteConfig:languageCode:noticeId:)
|
|
16
|
+
func initialize(userAgentName: String, userAgentVersion: String, apiKey: String, localConfigurationPath: String?, remoteConfigurationURL: String?, providerId: String?, disableDidomiRemoteConfig: Bool = false, languageCode: String? = nil, noticeId: String? = nil) {
|
|
17
17
|
onReady()
|
|
18
18
|
onError()
|
|
19
|
-
if !initialized {
|
|
19
|
+
if !RNDidomi.initialized {
|
|
20
20
|
initEventListener()
|
|
21
|
-
|
|
22
|
-
Didomi.shared.
|
|
21
|
+
|
|
22
|
+
Didomi.shared.setUserAgent(name: userAgentName, version: userAgentVersion)
|
|
23
|
+
|
|
24
|
+
Didomi.shared.initialize(DidomiInitializeParameters(
|
|
25
|
+
apiKey: apiKey,
|
|
26
|
+
localConfigurationPath: localConfigurationPath,
|
|
27
|
+
remoteConfigurationURL: remoteConfigurationURL,
|
|
28
|
+
providerID: providerId,
|
|
29
|
+
disableDidomiRemoteConfig: disableDidomiRemoteConfig,
|
|
30
|
+
languageCode: languageCode ?? Locale.current.languageCode ?? "",
|
|
31
|
+
noticeID: noticeId
|
|
32
|
+
))
|
|
23
33
|
}
|
|
24
|
-
initialized = true
|
|
34
|
+
RNDidomi.initialized = true
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
private func onReady() {
|
|
@@ -38,12 +48,7 @@ class RNDidomi: RCTEventEmitter {
|
|
|
38
48
|
|
|
39
49
|
@objc(getQueryStringForWebView:reject:)
|
|
40
50
|
func getQueryStringForWebView(resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
41
|
-
resolve(
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@objc(setUserAgent:version:)
|
|
45
|
-
func setUserAgent(name: String, version: String) {
|
|
46
|
-
Didomi.shared.setUserAgent(name: name, version: version)
|
|
51
|
+
resolve(Didomi.shared.getQueryStringForWebView())
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
@objc(setUserConsentStatus:disabledPurposeIds:enabledVendorIds:disabledVendorIds:resolve:reject:)
|
|
@@ -78,6 +83,13 @@ class RNDidomi: RCTEventEmitter {
|
|
|
78
83
|
resolve(consentStatus.rawValue.consentStatusBool)
|
|
79
84
|
}
|
|
80
85
|
|
|
86
|
+
@objc(getUserStatus:reject:)
|
|
87
|
+
func getUserStatus(resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
88
|
+
let encoder = JSONEncoder()
|
|
89
|
+
let userStatus = try? JSONSerialization.jsonObject(with: encoder.encode(Didomi.shared.getUserStatus())) as? [String: Any]
|
|
90
|
+
resolve(userStatus)
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
@objc(getUserStatusForVendor:resolve:reject:)
|
|
82
94
|
func getUserStatusForVendor(vendorId: String, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
83
95
|
let userStatus = Didomi.shared.getUserStatusForVendor(vendorId: vendorId)
|
|
@@ -156,8 +168,6 @@ class RNDidomi: RCTEventEmitter {
|
|
|
156
168
|
resolve(purposes)
|
|
157
169
|
}
|
|
158
170
|
|
|
159
|
-
|
|
160
|
-
|
|
161
171
|
@objc(getRequiredVendors:reject:)
|
|
162
172
|
func getRequiredVendors(resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
163
173
|
let encoder = JSONEncoder()
|
|
@@ -229,8 +239,12 @@ class RNDidomi: RCTEventEmitter {
|
|
|
229
239
|
}
|
|
230
240
|
|
|
231
241
|
@objc(getJavaScriptForWebView:resolve:reject:)
|
|
232
|
-
func getJavaScriptForWebView(extra: String = "", resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
233
|
-
|
|
242
|
+
func getJavaScriptForWebView(_ extra: String? = "", resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) {
|
|
243
|
+
if let extra = extra {
|
|
244
|
+
resolve(Didomi.shared.getJavaScriptForWebView(extra: extra))
|
|
245
|
+
} else {
|
|
246
|
+
resolve(Didomi.shared.getJavaScriptForWebView())
|
|
247
|
+
}
|
|
234
248
|
}
|
|
235
249
|
|
|
236
250
|
@objc(updateSelectedLanguage:)
|
|
@@ -445,15 +459,17 @@ extension RNDidomi {
|
|
|
445
459
|
return ["on_ready_callback",
|
|
446
460
|
"on_error_callback",
|
|
447
461
|
"on_consent_changed",
|
|
448
|
-
"on_hide_notice",
|
|
449
462
|
"on_ready",
|
|
450
463
|
"on_error",
|
|
464
|
+
"on_hide_notice",
|
|
451
465
|
"on_show_notice",
|
|
452
466
|
"on_notice_click_agree",
|
|
453
467
|
"on_notice_click_disagree",
|
|
454
468
|
"on_notice_click_more_info",
|
|
455
469
|
"on_notice_click_view_vendors",
|
|
456
470
|
"on_notice_click_privacy_policy",
|
|
471
|
+
"on_hide_preferences",
|
|
472
|
+
"on_show_preferences",
|
|
457
473
|
"on_preferences_click_agree_to_all",
|
|
458
474
|
"on_preferences_click_disagree_to_all",
|
|
459
475
|
"on_preferences_click_agree_to_all_purposes",
|
|
@@ -482,10 +498,6 @@ extension RNDidomi {
|
|
|
482
498
|
self.sendEvent(withName: "on_consent_changed", body:"")
|
|
483
499
|
}
|
|
484
500
|
|
|
485
|
-
didomiEventListener.onHideNotice = { event in
|
|
486
|
-
self.sendEvent(withName: "on_hide_notice", body: "")
|
|
487
|
-
}
|
|
488
|
-
|
|
489
501
|
didomiEventListener.onReady = { event in
|
|
490
502
|
self.sendEvent(withName: "on_ready", body: "")
|
|
491
503
|
}
|
|
@@ -498,6 +510,10 @@ extension RNDidomi {
|
|
|
498
510
|
self.sendEvent(withName: "on_show_notice", body: "")
|
|
499
511
|
}
|
|
500
512
|
|
|
513
|
+
didomiEventListener.onHideNotice = { event in
|
|
514
|
+
self.sendEvent(withName: "on_hide_notice", body: "")
|
|
515
|
+
}
|
|
516
|
+
|
|
501
517
|
didomiEventListener.onNoticeClickAgree = { event in
|
|
502
518
|
self.sendEvent(withName: "on_notice_click_agree", body: "")
|
|
503
519
|
}
|
|
@@ -518,6 +534,14 @@ extension RNDidomi {
|
|
|
518
534
|
self.sendEvent(withName: "on_notice_click_privacy_policy", body: "")
|
|
519
535
|
}
|
|
520
536
|
|
|
537
|
+
didomiEventListener.onShowPreferences = { event in
|
|
538
|
+
self.sendEvent(withName: "on_show_preferences", body: "")
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
didomiEventListener.onHidePreferences = { event in
|
|
542
|
+
self.sendEvent(withName: "on_hide_preferences", body: "")
|
|
543
|
+
}
|
|
544
|
+
|
|
521
545
|
didomiEventListener.onPreferencesClickAgreeToAll = { event in
|
|
522
546
|
self.sendEvent(withName: "on_preferences_click_agree_to_all", body: "")
|
|
523
547
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DIDOMI_VERSION = exports.DIDOMI_USER_AGENT_NAME = void 0;
|
|
7
|
+
// User agent name
|
|
8
|
+
const DIDOMI_USER_AGENT_NAME = "Didomi React-Native SDK"; // User agent version
|
|
9
|
+
|
|
10
|
+
exports.DIDOMI_USER_AGENT_NAME = DIDOMI_USER_AGENT_NAME;
|
|
11
|
+
const DIDOMI_VERSION = "1.5.0";
|
|
12
|
+
exports.DIDOMI_VERSION = DIDOMI_VERSION;
|
|
13
|
+
//# sourceMappingURL=Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Constants.ts"],"names":["DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION"],"mappings":";;;;;;AAAA;AACO,MAAMA,sBAAsB,GAAG,yBAA/B,C,CACP;;;AACO,MAAMC,cAAc,GAAG,OAAvB","sourcesContent":["// User agent name\nexport const DIDOMI_USER_AGENT_NAME = \"Didomi React-Native SDK\"\n// User agent version\nexport const DIDOMI_VERSION = \"1.5.0\"\n"]}
|
package/lib/commonjs/Didomi.js
CHANGED
|
@@ -9,6 +9,8 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
|
|
10
10
|
var _DidomiListener = require("./DidomiListener");
|
|
11
11
|
|
|
12
|
+
var _Constants = require("./Constants");
|
|
13
|
+
|
|
12
14
|
const {
|
|
13
15
|
Didomi: RNDidomi
|
|
14
16
|
} = _reactNative.NativeModules;
|
|
@@ -29,22 +31,22 @@ const Didomi = {
|
|
|
29
31
|
_DidomiListener.DidomiListener.init(); // Trigger native SDK init
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
RNDidomi.initialize(apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
|
|
34
|
+
RNDidomi.initialize(_Constants.DIDOMI_USER_AGENT_NAME, _Constants.DIDOMI_VERSION, apiKey, localConfigurationPath, remoteConfigurationUrl, providerId, disableDidomiRemoteConfig, languageCode, noticeId);
|
|
33
35
|
},
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* Listen to SDK ready state
|
|
37
|
-
|
|
39
|
+
*/
|
|
38
40
|
onReady: () => _DidomiListener.DidomiListener.onReady(),
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* Listen to SDK errors
|
|
42
|
-
|
|
44
|
+
*/
|
|
43
45
|
onError: () => _DidomiListener.DidomiListener.onError(),
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
* Provide the objects required to display UI elements
|
|
49
|
+
*/
|
|
48
50
|
setupUI: () => RNDidomi.setupUI(),
|
|
49
51
|
|
|
50
52
|
/**
|
|
@@ -144,7 +146,7 @@ const Didomi = {
|
|
|
144
146
|
* @param extra: Extra JavaScript to inject in the returned code
|
|
145
147
|
* @returns: JavaScript code to inject in a WebView
|
|
146
148
|
*/
|
|
147
|
-
getJavaScriptForWebView:
|
|
149
|
+
getJavaScriptForWebView: extra => RNDidomi.getJavaScriptForWebView(extra),
|
|
148
150
|
getQueryStringForWebView: () => RNDidomi.getQueryStringForWebView(),
|
|
149
151
|
|
|
150
152
|
/**
|
|
@@ -214,6 +216,9 @@ const Didomi = {
|
|
|
214
216
|
* Get the user consent status for a specific purpose
|
|
215
217
|
* @param purposeId: The purpose ID to check consent for
|
|
216
218
|
* @returns: The user consent status for the specified purpose
|
|
219
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
220
|
+
* getUserStatus().getPurposes().getConsent().getEnabled() or
|
|
221
|
+
* getUserStatus().getPurposes().getConsent().getDisabled().
|
|
217
222
|
*/
|
|
218
223
|
getUserConsentStatusForPurpose: purposeId => RNDidomi.getUserConsentStatusForPurpose(purposeId),
|
|
219
224
|
|
|
@@ -221,6 +226,9 @@ const Didomi = {
|
|
|
221
226
|
* Get the user consent status for a specific vendor
|
|
222
227
|
* @param vendorId: The vendor ID to check consent for
|
|
223
228
|
* @returns: The user consent status for the specified vendor
|
|
229
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
230
|
+
* getUserStatus().getVendors().getConsent().getEnabled() or
|
|
231
|
+
* getUserStatus().getVendors().getConsent().getDisabled().
|
|
224
232
|
*/
|
|
225
233
|
getUserConsentStatusForVendor: vendorId => RNDidomi.getUserConsentStatusForVendor(vendorId),
|
|
226
234
|
|
|
@@ -228,6 +236,9 @@ const Didomi = {
|
|
|
228
236
|
* Get the user consent status for a specific vendor and all its purposes
|
|
229
237
|
* @param vendorId: The ID of the vendor
|
|
230
238
|
* @returns: The user consent status corresponding to the specified vendor and all its required purposes.
|
|
239
|
+
* @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
|
|
240
|
+
* by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
|
|
241
|
+
* getUserStatus().getVendors().getGlobalConsent().getDisabled().
|
|
231
242
|
*/
|
|
232
243
|
getUserConsentStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),
|
|
233
244
|
|
|
@@ -235,6 +246,9 @@ const Didomi = {
|
|
|
235
246
|
* Get the user legitimate interest status for a specific purpose.
|
|
236
247
|
* @param purposeId: purpose ID.
|
|
237
248
|
* @returns: LI status of a purpose.
|
|
249
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
250
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
|
|
251
|
+
* getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
|
|
238
252
|
*/
|
|
239
253
|
getUserLegitimateInterestStatusForPurpose: purposeId => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),
|
|
240
254
|
|
|
@@ -242,6 +256,9 @@ const Didomi = {
|
|
|
242
256
|
* Get the user legitimate interest status for a specific vendor.
|
|
243
257
|
* @param vendorId: vendor ID.
|
|
244
258
|
* @returns: LI status of a vendor.
|
|
259
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
260
|
+
* getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
|
|
261
|
+
* getUserStatus().getVendors().getLegitimateInterest().getDisabled().
|
|
245
262
|
*/
|
|
246
263
|
getUserLegitimateInterestForVendor: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),
|
|
247
264
|
|
|
@@ -249,13 +266,25 @@ const Didomi = {
|
|
|
249
266
|
* Get the user LI status for a specific vendor and all its purposes.
|
|
250
267
|
* @param vendorId: vendor ID.
|
|
251
268
|
* @returns: The user LI status corresponding to the specified vendor and all its required purposes.
|
|
269
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
|
|
270
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
|
|
271
|
+
* getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
|
|
252
272
|
*/
|
|
253
273
|
getUserLegitimateInterestStatusForVendorAndRequiredPurposes: vendorId => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),
|
|
254
274
|
|
|
275
|
+
/**
|
|
276
|
+
* Get the user consent status.
|
|
277
|
+
* @returns: status that represents user consent.
|
|
278
|
+
*/
|
|
279
|
+
getUserStatus: () => RNDidomi.getUserStatus(),
|
|
280
|
+
|
|
255
281
|
/**
|
|
256
282
|
* Get the user consent and legitimate interest status for a specific vendor.
|
|
257
283
|
* @param vendorId: vendor ID.
|
|
258
284
|
* @returns: status that represents both consent and legitimate interest status of a vendor.
|
|
285
|
+
* @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
|
|
286
|
+
* getUserStatus().getVendors().getGlobal().getEnabled() or
|
|
287
|
+
* getUserStatus().getVendors().getGlobal().getDisabled().
|
|
259
288
|
*/
|
|
260
289
|
getUserStatusForVendor: vendorId => RNDidomi.getUserStatusForVendor(vendorId),
|
|
261
290
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Didomi.ts"],"names":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","init","onReady","onError","setupUI","setLogLevel","level","addEventListener","eventType","callback","removeEventListener","removeAllEventListeners","reset","getDisabledPurposes","getDisabledPurposeIds","getDisabledVendors","getDisabledVendorIds","getEnabledPurposes","getEnabledPurposeIds","getEnabledVendors","getEnabledVendorIds","getJavaScriptForWebView","getQueryStringForWebView","getPurpose","purposeId","getRequiredPurposes","getRequiredPurposeIds","getRequiredVendors","getRequiredVendorIds","getText","key","getTranslatedText","getUserConsentStatusForPurpose","getUserConsentStatusForVendor","vendorId","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","isUserConsentStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","setUser","organizationUserId","organizationUserIdAuthAlgorithm","organizationUserIdAuthSid","organizationUserIdAuthSalt","organizationUserIdAuthDigest","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage"],"mappings":";;;;;;;AAAA;;AACA;;AAGA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;AAEO,MAAMF,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEG,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQP;AACH;AACAC,mCAAeC,IAAf,GA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A;AACA;AACA;AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,CACpBC,iBADoB,EAEpBC,kBAFoB,EAGpBC,gBAHoB,EAIpBC,iBAJoB,KAMpB1E,QAAQ,CAACsE,oBAAT,CACEC,iBADF,EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,iBAJF,CAlZkB;;AAyZpB;AACF;AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,MAAwB3E,QAAQ,CAAC2E,oBAAT,EA7Z1B;;AA+ZpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,CACbC,qBADa,EAEbC,gBAFa,EAGbC,oBAHa,EAIbC,eAJa,KAMbhF,QAAQ,CAAC4E,aAAT,CACEC,qBADF,EAEEC,gBAFF,EAGEC,oBAHF,EAIEC,eAJF,CA7akB;;AAobpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,EAAE,CACjBC,wBADiB,EAEjBC,yBAFiB,EAGjBC,mBAHiB,EAIjBC,oBAJiB,EAKjBC,uBALiB,EAMjBC,wBANiB,EAOjBC,kBAPiB,EAQjBC,mBARiB,KAUjBzF,QAAQ,CAACiF,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAzckB;;AAodpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB1F,QAAQ,CAAC0F,wBAAT,EAzdkB;;AA2dpB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGnF,YAAD,IACtBR,QAAQ,CAAC2F,sBAAT,CAAgCnF,YAAhC;AAlekB,CAAf","sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType } from './DidomiTypes';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nexport const Didomi = {\n /**\n * Initialize the Didomi SDK\n *\n * @param apiKey: Public API key of the organization from the Didomi Console.\n * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.\n * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.\n * @param providerId: Your provider ID (if any).\n * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to \"false\" for loading configuration from the Didomi Console.\n * @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.\n * @param noticeId: Notice id for the remote configuration.\n */\n initialize: (\n apiKey: string,\n localConfigurationPath?: string,\n remoteConfigurationUrl?: string,\n providerId?: string,\n disableDidomiRemoteConfig: boolean = false,\n languageCode?: string,\n noticeId?: string\n ) => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n RNDidomi.initialize(\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId\n );\n },\n\n /**\n * Listen to SDK ready state\n * */\n onReady: (): Promise<void> => DidomiListener.onReady(),\n\n /**\n * Listen to SDK errors\n * */\n onError: (): Promise<any> => DidomiListener.onError(),\n\n /**\n Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<number> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n */\n getDisabledPurposes: (): Promise<any[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n */\n getDisabledPurposeIds: (): Promise<any[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n */\n getDisabledVendors: (): Promise<any[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n */\n getDisabledVendorIds: (): Promise<any[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n */\n getEnabledPurposes: (): Promise<any[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n */\n getEnabledPurposeIds: (): Promise<any[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n */\n getEnabledVendors: (): Promise<any[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n */\n getEnabledVendorIds: (): Promise<any[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (): Promise<string> =>\n RNDidomi.getJavaScriptForWebView(),\n\n getQueryStringForWebView: (): Promise<string> =>\n RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<any> =>\n RNDidomi.getPurpose(purposeId),\n\n /**\n * Method used to get an array of required purposes.\n *\n * @returns: array of required purposes.\n */\n getRequiredPurposes: (): Promise<any[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<any[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<any[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<any[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * 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.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> =>\n RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> =>\n RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> =>\n RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): Promise<boolean> =>\n RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n */\n getUserLegitimateInterestStatusForPurpose: (\n purposeId: string\n ): Promise<boolean> =>\n RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> =>\n RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (\n vendorId: string\n ): boolean =>\n RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(\n vendorId\n ),\n\n /**\n * Get the user consent and legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: status that represents both consent and legitimate interest status of a vendor.\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> =>\n RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<any> => RNDidomi.getVendor(vendorId),\n\n /**\n * Hide the notice if it is currently displayed\n */\n hideNotice: (): Promise<void> => RNDidomi.hideNotice(),\n\n /**\n * Hide the preferences popup for purposes\n */\n hidePreferences: (): Promise<void> => RNDidomi.hidePreferences(),\n\n /**\n * Determine if consent is required for the user. The rules are (OR):\n * - The user country is in the EU.\n * - The company is from the EU.\n * - The user country is unknown and the app has chosen to collect consent when unknown.\n * @returns: **true** if consent is required, **false** if it is not required.\n */\n isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> =>\n RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Set user information with authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param salt Salt used for computing the digest (optional)\n * @param digest Digest of the organization user ID and secret\n */\n setUser: (\n organizationUserId: string,\n organizationUserIdAuthAlgorithm: string,\n organizationUserIdAuthSid: string,\n organizationUserIdAuthSalt: string,\n organizationUserIdAuthDigest: string\n ): Promise<void> =>\n RNDidomi.setUser(\n organizationUserId,\n organizationUserIdAuthAlgorithm,\n organizationUserIdAuthSid,\n organizationUserIdAuthSalt,\n organizationUserIdAuthDigest\n ),\n\n /**\n * Show the consent notice (if required, not disabled in the config and not already displayed)\n */\n showNotice: (): Promise<void> => RNDidomi.showNotice(),\n\n /**\n * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.\n * @param view: It can be `purposes` or `vendors`\n */\n showPreferences: (view?: string): Promise<void> =>\n RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.\n * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.\n * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.\n * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserStatus: (\n purposesConsentStatus: boolean,\n purposesLIStatus: boolean,\n vendorsConsentStatus: boolean,\n vendorsLIStatus: boolean\n ): Promise<boolean> =>\n RNDidomi.setUserStatus(\n purposesConsentStatus,\n purposesLIStatus,\n vendorsConsentStatus,\n vendorsLIStatus\n ),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.\n * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.\n * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.\n * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.\n * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.\n * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.\n * @param enabledLIVendorIds: List of vendor IDs to enable for LI.\n * @param disabledLIVendorIds: List of vendor IDs to disable for LI.\n */\n setUserStatusSets: (\n enabledConsentPurposeIds: string[],\n disabledConsentPurposeIds: string[],\n enabledLIPurposeIds: string[],\n disabledLIPurposeIds: string[],\n enabledConsentVendorIds: string[],\n disabledConsentVendorIds: string[],\n enabledLIVendorIds: string[],\n disabledLIVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserStatusSets(\n enabledConsentPurposeIds,\n disabledConsentPurposeIds,\n enabledLIPurposeIds,\n disabledLIPurposeIds,\n enabledConsentVendorIds,\n disabledConsentVendorIds,\n enabledLIVendorIds,\n disabledLIVendorIds\n ),\n\n /**\n * 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\n * @returns: A boolean depending if the consent should be collected or not\n */\n shouldConsentBeCollected: (): Promise<boolean> =>\n RNDidomi.shouldConsentBeCollected(),\n\n /**\n * Method used to update the selected language of the Didomi SDK and any property that depends on it.\n * 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.\n * 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.\n * @param languageCode: string containing the language code e.g.: \"es\", \"fr\", etc.\n */\n updateSelectedLanguage: (languageCode: string): Promise<void> =>\n RNDidomi.updateSelectedLanguage(languageCode),\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["Didomi.ts"],"names":["Didomi","RNDidomi","NativeModules","initialize","apiKey","localConfigurationPath","remoteConfigurationUrl","providerId","disableDidomiRemoteConfig","languageCode","noticeId","DidomiListener","init","DIDOMI_USER_AGENT_NAME","DIDOMI_VERSION","onReady","onError","setupUI","setLogLevel","level","addEventListener","eventType","callback","removeEventListener","removeAllEventListeners","reset","getDisabledPurposes","getDisabledPurposeIds","getDisabledVendors","getDisabledVendorIds","getEnabledPurposes","getEnabledPurposeIds","getEnabledVendors","getEnabledVendorIds","getJavaScriptForWebView","extra","getQueryStringForWebView","getPurpose","purposeId","getRequiredPurposes","getRequiredPurposeIds","getRequiredVendors","getRequiredVendorIds","getText","key","getTranslatedText","getUserConsentStatusForPurpose","getUserConsentStatusForVendor","vendorId","getUserConsentStatusForVendorAndRequiredPurposes","getUserLegitimateInterestStatusForPurpose","getUserLegitimateInterestForVendor","getUserLegitimateInterestStatusForVendor","getUserLegitimateInterestStatusForVendorAndRequiredPurposes","getUserStatus","getUserStatusForVendor","getVendor","hideNotice","hidePreferences","isConsentRequired","isUserConsentStatusPartial","isNoticeVisible","isPreferencesVisible","isError","isReady","setUser","organizationUserId","organizationUserIdAuthAlgorithm","organizationUserIdAuthSid","organizationUserIdAuthSalt","organizationUserIdAuthDigest","showNotice","showPreferences","view","setUserAgreeToAll","setUserConsentStatus","enabledPurposeIds","disabledPurposeIds","enabledVendorIds","disabledVendorIds","setUserDisagreeToAll","setUserStatus","purposesConsentStatus","purposesLIStatus","vendorsConsentStatus","vendorsLIStatus","setUserStatusSets","enabledConsentPurposeIds","disabledConsentPurposeIds","enabledLIPurposeIds","disabledLIPurposeIds","enabledConsentVendorIds","disabledConsentVendorIds","enabledLIVendorIds","disabledLIVendorIds","shouldConsentBeCollected","updateSelectedLanguage"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAEA,MAAM;AAAEA,EAAAA,MAAM,EAAEC;AAAV,IAAuBC,0BAA7B;AAEO,MAAMF,MAAM,GAAG;AACpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEG,EAAAA,UAAU,EAAE,CACVC,MADU,EAEVC,sBAFU,EAGVC,sBAHU,EAIVC,UAJU,EAKVC,yBAAkC,GAAG,KAL3B,EAMVC,YANU,EAOVC,QAPU,KAQP;AACH;AACAC,mCAAeC,IAAf,GAFG,CAIH;;;AACAX,IAAAA,QAAQ,CAACE,UAAT,CACEU,iCADF,EAEEC,yBAFF,EAGEV,MAHF,EAIEC,sBAJF,EAKEC,sBALF,EAMEC,UANF,EAOEC,yBAPF,EAQEC,YARF,EASEC,QATF;AAWD,GApCmB;;AAsCpB;AACF;AACA;AACEK,EAAAA,OAAO,EAAE,MAAqBJ,+BAAeI,OAAf,EAzCV;;AA2CpB;AACF;AACA;AACEC,EAAAA,OAAO,EAAE,MAAoBL,+BAAeK,OAAf,EA9CT;;AAgDpB;AACF;AACA;AACEC,EAAA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iBAJoB,KAMpB9E,QAAQ,CAAC0E,oBAAT,CACEC,iBADF,EAEEC,kBAFF,EAGEC,gBAHF,EAIEC,iBAJF,CA1ZkB;;AAiapB;AACF;AACA;AACA;AACEC,EAAAA,oBAAoB,EAAE,MAAwB/E,QAAQ,CAAC+E,oBAAT,EAra1B;;AAuapB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,CACbC,qBADa,EAEbC,gBAFa,EAGbC,oBAHa,EAIbC,eAJa,KAMbpF,QAAQ,CAACgF,aAAT,CACEC,qBADF,EAEEC,gBAFF,EAGEC,oBAHF,EAIEC,eAJF,CArbkB;;AA4bpB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,iBAAiB,EAAE,CACjBC,wBADiB,EAEjBC,yBAFiB,EAGjBC,mBAHiB,EAIjBC,oBAJiB,EAKjBC,uBALiB,EAMjBC,wBANiB,EAOjBC,kBAPiB,EAQjBC,mBARiB,KAUjB7F,QAAQ,CAACqF,iBAAT,CACEC,wBADF,EAEEC,yBAFF,EAGEC,mBAHF,EAIEC,oBAJF,EAKEC,uBALF,EAMEC,wBANF,EAOEC,kBAPF,EAQEC,mBARF,CAjdkB;;AA4dpB;AACF;AACA;AACA;AACEC,EAAAA,wBAAwB,EAAE,MACxB9F,QAAQ,CAAC8F,wBAAT,EAjekB;;AAmepB;AACF;AACA;AACA;AACA;AACA;AACEC,EAAAA,sBAAsB,EAAGvF,YAAD,IACtBR,QAAQ,CAAC+F,sBAAT,CAAgCvF,YAAhC;AA1ekB,CAAf","sourcesContent":["import { NativeModules } from 'react-native';\nimport { DidomiListener } from './DidomiListener';\nimport { DidomiEventType } from './DidomiTypes';\nimport { DIDOMI_USER_AGENT_NAME, DIDOMI_VERSION } from './Constants';\n\nconst { Didomi: RNDidomi } = NativeModules;\n\nexport const Didomi = {\n /**\n * Initialize the Didomi SDK\n *\n * @param apiKey: Public API key of the organization from the Didomi Console.\n * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.\n * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.\n * @param providerId: Your provider ID (if any).\n * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to \"false\" for loading configuration from the Didomi Console.\n * @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.\n * @param noticeId: Notice id for the remote configuration.\n */\n initialize: (\n apiKey: string,\n localConfigurationPath?: string,\n remoteConfigurationUrl?: string,\n providerId?: string,\n disableDidomiRemoteConfig: boolean = false,\n languageCode?: string,\n noticeId?: string\n ) => {\n // Init listener\n DidomiListener.init();\n\n // Trigger native SDK init\n RNDidomi.initialize(\n DIDOMI_USER_AGENT_NAME,\n DIDOMI_VERSION,\n apiKey,\n localConfigurationPath,\n remoteConfigurationUrl,\n providerId,\n disableDidomiRemoteConfig,\n languageCode,\n noticeId\n );\n },\n\n /**\n * Listen to SDK ready state\n */\n onReady: (): Promise<void> => DidomiListener.onReady(),\n\n /**\n * Listen to SDK errors\n */\n onError: (): Promise<any> => DidomiListener.onError(),\n\n /**\n * Provide the objects required to display UI elements\n */\n setupUI: (): Promise<void> => RNDidomi.setupUI(),\n\n /**\n * Set the minimum level of messages to log\n * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize\n *\n * Messages with a level below `minLevel` will not be logged.\n *\n * For iOS:\n * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):\n * - OSLogType.info (1)\n * - OSLogType.debug (2)\n * - OSLogType.error (16)\n * - OSLogType.fault (17)\n *\n * We recommend setting `OSLogType.error` (16) in production\n *\n * For Android:\n * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.\n * (https://developer.android.com/reference/android/util/Log#constants_1)\n *\n * We recommend setting `Log.INFO` (4) in production\n *\n * @param minLevel: Minimum level of messages to log\n */\n setLogLevel: (level: number): Promise<number> => RNDidomi.setLogLevel(level),\n\n /**\n * Add an event listener\n * @param listener:\n */\n addEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.addEventListener(eventType, callback),\n\n /**\n * Remove an event listener\n * @param listener:\n */\n removeEventListener: (\n eventType: DidomiEventType,\n callback: (data: any) => void\n ) => DidomiListener.removeEventListener(eventType, callback),\n\n /**\n * Remove all event listeners\n */\n removeAllEventListeners: () => DidomiListener.reset(),\n\n /**\n * Method used to get an array of disabled purposes.\n * @returns: array of disabled purposes.\n */\n getDisabledPurposes: (): Promise<any[]> => RNDidomi.getDisabledPurposes(),\n\n /**\n * Method used to get a set of disabled purpose IDs.\n * @returns: set that contains the IDs of disabled purposes.\n */\n getDisabledPurposeIds: (): Promise<any[]> => RNDidomi.getDisabledPurposeIds(),\n\n /**\n * Method used to get an array of disabled vendors.\n * @returns: array of disabled vendors.\n */\n getDisabledVendors: (): Promise<any[]> => RNDidomi.getDisabledVendors(),\n\n /**\n * Method used to get a set of disabled vendor IDs.\n * @returns: set that contains the IDs of disabled vendors.\n */\n getDisabledVendorIds: (): Promise<any[]> => RNDidomi.getDisabledVendorIds(),\n\n /**\n * Method used to get an array of enabled purposes.\n * @returns: array of enabled purposes.\n */\n getEnabledPurposes: (): Promise<any[]> => RNDidomi.getEnabledPurposes(),\n\n /**\n * Method used to get a set of enabled purpose IDs.\n * @returns: set that contains the IDs of enabled purposes.\n */\n getEnabledPurposeIds: (): Promise<any[]> => RNDidomi.getEnabledPurposeIds(),\n\n /**\n * Method used to get an array of enabled vendors.\n * @returns: array of enabled vendors.\n */\n getEnabledVendors: (): Promise<any[]> => RNDidomi.getEnabledVendors(),\n\n /**\n * Method used to get a set of enabled vendor IDs.\n * @returns: set that contains the IDs of enabled vendors.\n */\n getEnabledVendorIds: (): Promise<any[]> => RNDidomi.getEnabledVendorIds(),\n\n /**\n * Get JavaScript to embed into a WebView to pass the consent status from the app\n * to the Didomi Web SDK embedded into the WebView\n * Inject the returned JavaScript into a WebView\n * @param extra: Extra JavaScript to inject in the returned code\n * @returns: JavaScript code to inject in a WebView\n */\n getJavaScriptForWebView: (extra?: string | null): Promise<string> => RNDidomi.getJavaScriptForWebView(extra),\n\n getQueryStringForWebView: (): Promise<string> => RNDidomi.getQueryStringForWebView(),\n\n /**\n * Method used to get a Purpose based on its ID.\n * @param purposeId: purpose ID used in the search.\n * @returns: purpose found in the array.\n */\n getPurpose: (purposeId: string): Promise<any> => RNDidomi.getPurpose(purposeId),\n\n /**\n * Method used to get an array of required purposes.\n *\n * @returns: array of required purposes.\n */\n getRequiredPurposes: (): Promise<any[]> => RNDidomi.getRequiredPurposes(),\n\n /**\n * Get the configured purpose IDs\n * @returns: set of purpose IDs.\n */\n getRequiredPurposeIds: (): Promise<any[]> => RNDidomi.getRequiredPurposeIds(),\n\n /**\n * Method used to get an array of required vendors.\n * @returns: array of required vendors.\n */\n getRequiredVendors: (): Promise<any[]> => RNDidomi.getRequiredVendors(),\n\n /**\n * Get the configured vendor IDs\n * @returns: set of vendor IDs.\n */\n getRequiredVendorIds: (): Promise<any[]> => RNDidomi.getRequiredVendorIds(),\n\n /**\n * Method used to get a dictionary/map in the form of { \"en\": \"Key in English\", \"fr\": \"Key in French.\" }\n * for a given key.\n * @param key: used to find its corresponding value in the dictionary/map.\n * @returns: dictionary containing the different translations for a given key.\n */\n getText: (key: string): Promise<any[]> => RNDidomi.getText(key),\n\n /**\n * Method used to get a translated text based on the key being passed.\n * The language and the source of this translated text will depend on the availability of the translation for the specific key.\n * 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.\n *\n * These are the attempts performed by the SDK to try to find a translation for the specific key:\n * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).\n * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).\n * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).\n * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).\n *\n * If no translation can be found after these 4 attempts, the key will be returned.\n *\n * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:\n * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts\n * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text\n * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices\n *\n * @param key: used to find its corresponding value in one of the different sources.\n * @returns: a translated string if a translation was found, the same key that was passed otherwise.\n */\n getTranslatedText: (key: string): Promise<string> => RNDidomi.getTranslatedText(key),\n\n /**\n * Get the user consent status for a specific purpose\n * @param purposeId: The purpose ID to check consent for\n * @returns: The user consent status for the specified purpose\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getConsent().getEnabled() or\n * getUserStatus().getPurposes().getConsent().getDisabled().\n */\n getUserConsentStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForPurpose(purposeId),\n\n /**\n * Get the user consent status for a specific vendor\n * @param vendorId: The vendor ID to check consent for\n * @returns: The user consent status for the specified vendor\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getConsent().getEnabled() or\n * getUserStatus().getVendors().getConsent().getDisabled().\n */\n getUserConsentStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendor(vendorId),\n\n /**\n * Get the user consent status for a specific vendor and all its purposes\n * @param vendorId: The ID of the vendor\n * @returns: The user consent status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced\n * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or\n * getUserStatus().getVendors().getGlobalConsent().getDisabled().\n */\n getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string): Promise<boolean> => RNDidomi.getUserConsentStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user legitimate interest status for a specific purpose.\n * @param purposeId: purpose ID.\n * @returns: LI status of a purpose.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or\n * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForPurpose: (purposeId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForPurpose(purposeId),\n\n /**\n * Get the user legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: LI status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserLegitimateInterestStatusForVendor(vendorId),\n\n /**\n * Get the user LI status for a specific vendor and all its purposes.\n * @param vendorId: vendor ID.\n * @returns: The user LI status corresponding to the specified vendor and all its required purposes.\n * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or\n * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().\n */\n getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string): boolean => RNDidomi.getUserLegitimateInterestStatusForVendorAndRequiredPurposes(vendorId),\n\n /**\n * Get the user consent status.\n * @returns: status that represents user consent.\n */\n getUserStatus: (): Promise<any> => RNDidomi.getUserStatus(),\n\n /**\n * Get the user consent and legitimate interest status for a specific vendor.\n * @param vendorId: vendor ID.\n * @returns: status that represents both consent and legitimate interest status of a vendor.\n * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in\n * getUserStatus().getVendors().getGlobal().getEnabled() or\n * getUserStatus().getVendors().getGlobal().getDisabled().\n */\n getUserStatusForVendor: (vendorId: string): Promise<boolean> => RNDidomi.getUserStatusForVendor(vendorId),\n\n /**\n * Method used to get a Vendor based on its ID.\n * @param vendorId: vendor ID used in the search.\n * @returns: vendor found in the array.\n */\n getVendor: (vendorId: string): Promise<any> => RNDidomi.getVendor(vendorId),\n\n /**\n * Hide the notice if it is currently displayed\n */\n hideNotice: (): Promise<void> => RNDidomi.hideNotice(),\n\n /**\n * Hide the preferences popup for purposes\n */\n hidePreferences: (): Promise<void> => RNDidomi.hidePreferences(),\n\n /**\n * Determine if consent is required for the user. The rules are (OR):\n * - The user country is in the EU.\n * - The company is from the EU.\n * - The user country is unknown and the app has chosen to collect consent when unknown.\n * @returns: **true** if consent is required, **false** if it is not required.\n */\n isConsentRequired: (): Promise<boolean> => RNDidomi.isConsentRequired(),\n\n /**\n * Determine if consent information is available for all purposes and vendors that are required\n * @returns: **true** if consent is required and consent information is available, **false** otherwise.\n */\n isUserConsentStatusPartial: (): Promise<boolean> => RNDidomi.isUserConsentStatusPartial(),\n\n /**\n * Check if the consent notice is currently displayed\n * @returns: **true** if the notice is displayed, **false** if is not.\n */\n isNoticeVisible: (): Promise<boolean> => RNDidomi.isNoticeVisible(),\n\n /**\n * Method used to check if the Preferences view is visible.\n * @returns: **true** if Preferences view is visible, **false** otherwise.\n */\n isPreferencesVisible: (): Promise<boolean> => RNDidomi.isPreferencesVisible(),\n\n isError: (): Promise<boolean> => RNDidomi.isError(),\n\n /**\n * Is the Didomi SDK ready?\n */\n isReady: (): Promise<boolean> => RNDidomi.isReady(),\n\n /**\n * Set user information with authentication\n *\n * @param id Organization user ID\n * @param algorithm Algorithm used for computing the digest\n * @param secretId ID of the secret used for computing the digest\n * @param salt Salt used for computing the digest (optional)\n * @param digest Digest of the organization user ID and secret\n */\n setUser: (\n organizationUserId: string,\n organizationUserIdAuthAlgorithm: string,\n organizationUserIdAuthSid: string,\n organizationUserIdAuthSalt: string,\n organizationUserIdAuthDigest: string\n ): Promise<void> =>\n RNDidomi.setUser(\n organizationUserId,\n organizationUserIdAuthAlgorithm,\n organizationUserIdAuthSid,\n organizationUserIdAuthSalt,\n organizationUserIdAuthDigest\n ),\n\n /**\n * Show the consent notice (if required, not disabled in the config and not already displayed)\n */\n showNotice: (): Promise<void> => RNDidomi.showNotice(),\n\n /**\n * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.\n * @param view: It can be `purposes` or `vendors`\n */\n showPreferences: (view?: string): Promise<void> => RNDidomi.showPreferences(view),\n\n /**\n * Remove all consents for the user\n */\n reset: (): Promise<void> => RNDidomi.reset(),\n\n /**\n * Method that allows to enable consent and legitimate interest for all the required purposes.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserAgreeToAll: (): Promise<boolean> => RNDidomi.setUserAgreeToAll(),\n\n /**\n * Set the user consent status.\n * @param enabledPurposeIds: set containing **enabled purpose ids**\n * @param disabledPurposeIds: set containing **disabled purpose ids**\n * @param enabledVendorIds: set containing **enabled vendor ids**\n * @param disabledVendorIds: set containing **disabled purpose ids**\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserConsentStatus: (\n enabledPurposeIds: string[],\n disabledPurposeIds: string[],\n enabledVendorIds: string[],\n disabledVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserConsentStatus(\n enabledPurposeIds,\n disabledPurposeIds,\n enabledVendorIds,\n disabledVendorIds\n ),\n\n /**\n * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserDisagreeToAll: (): Promise<boolean> => RNDidomi.setUserDisagreeToAll(),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.\n * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.\n * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.\n * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.\n * @returns: **true** if consent status has been updated, **false** otherwise.\n */\n setUserStatus: (\n purposesConsentStatus: boolean,\n purposesLIStatus: boolean,\n vendorsConsentStatus: boolean,\n vendorsLIStatus: boolean\n ): Promise<boolean> =>\n RNDidomi.setUserStatus(\n purposesConsentStatus,\n purposesLIStatus,\n vendorsConsentStatus,\n vendorsLIStatus\n ),\n\n /**\n * Set the user status for purposes and vendors for consent and legitimate interest.\n * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.\n * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.\n * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.\n * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.\n * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.\n * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.\n * @param enabledLIVendorIds: List of vendor IDs to enable for LI.\n * @param disabledLIVendorIds: List of vendor IDs to disable for LI.\n */\n setUserStatusSets: (\n enabledConsentPurposeIds: string[],\n disabledConsentPurposeIds: string[],\n enabledLIPurposeIds: string[],\n disabledLIPurposeIds: string[],\n enabledConsentVendorIds: string[],\n disabledConsentVendorIds: string[],\n enabledLIVendorIds: string[],\n disabledLIVendorIds: string[]\n ): Promise<boolean> =>\n RNDidomi.setUserStatusSets(\n enabledConsentPurposeIds,\n disabledConsentPurposeIds,\n enabledLIPurposeIds,\n disabledLIPurposeIds,\n enabledConsentVendorIds,\n disabledConsentVendorIds,\n enabledLIVendorIds,\n disabledLIVendorIds\n ),\n\n /**\n * 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\n * @returns: A boolean depending if the consent should be collected or not\n */\n shouldConsentBeCollected: (): Promise<boolean> =>\n RNDidomi.shouldConsentBeCollected(),\n\n /**\n * Method used to update the selected language of the Didomi SDK and any property that depends on it.\n * 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.\n * 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.\n * @param languageCode: string containing the language code e.g.: \"es\", \"fr\", etc.\n */\n updateSelectedLanguage: (languageCode: string): Promise<void> =>\n RNDidomi.updateSelectedLanguage(languageCode),\n};\n"]}
|