@usercentrics/react-native-sdk 2.23.2 → 2.24.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 +5 -5
- package/android/build-legacy.gradle +11 -1
- package/android/build.gradle.kts +44 -14
- package/android/gradle.properties +2 -0
- package/android/settings.gradle.kts +1 -1
- package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/RNUsercentricsModuleTest.kt +5 -5
- package/android/src/androidTest/java/com/usercentrics/reactnative/fake/FakePromise.kt +73 -0
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/RNUsercentricsModule.kt +3 -3
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/RNUsercentricsModuleSpec.kt +1 -1
- package/android/src/main/java/com/usercentrics/reactnative/RNUsercentricsPackage.kt +51 -0
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/ReactContextProvider.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/ReactContextProviderImpl.kt +1 -1
- package/android/src/main/java/com/usercentrics/reactnative/UCRNFlag.kt +4 -0
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/api/UsercentricsProxy.kt +2 -2
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/BannerFontExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/BannerSettingsExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/CCPADataExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/ConsentDisclosureSerializer.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/ReadableMapExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/TCFDataExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UserDecisionExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UserOptionsExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UsercentricsCMPDataExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UsercentricsConsentUserResponseExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UsercentricsReadyStatusExtensions.kt +1 -1
- package/android/src/main/java/com/usercentrics/{reactnativeusercentrics → reactnative}/extensions/UsercentricsServiceConsentExtensions.kt +1 -1
- package/android/src/main/jni/CMakeLists.txt +85 -0
- package/android/src/main/jni/RNUsercentricsModule.cpp +21 -0
- package/android/src/main/jni/rn_usercentrics.cpp +22 -0
- package/android/src/test/java/com/usercentrics/reactnative/RNUsercentricsModuleTest.kt +159 -0
- package/android/src/test/java/com/usercentrics/reactnative/fake/FakePromise.kt +73 -0
- package/ios/Extensions/BannerSettings+Dict.swift +1 -0
- package/ios/Extensions/UIColor+Extensions.swift +1 -1
- package/ios/Extensions/UIImage+UsercentricsLogoDict.swift +1 -0
- package/ios/RNUsercentricsModule.swift +1 -0
- package/lib/NativeUsercentrics.d.ts +1 -1
- package/lib/NativeUsercentrics.js +10 -2
- package/lib/NativeUsercentrics.js.map +1 -1
- package/lib/fabric/NativeUsercentricsModule.d.ts +30 -0
- package/lib/fabric/NativeUsercentricsModule.js +3 -0
- package/lib/fabric/NativeUsercentricsModule.js.map +1 -0
- package/package.json +108 -96
- package/react-native.config.js +15 -0
- package/src/NativeUsercentrics.ts +75 -0
- package/src/Usercentrics.tsx +145 -0
- package/src/__tests__/index.test.ts +476 -0
- package/src/__tests__/mocks.ts +402 -0
- package/src/fabric/NativeUsercentricsModule.ts +51 -0
- package/src/index.tsx +2 -0
- package/src/models/AdditionalConsentModeData.tsx +33 -0
- package/src/models/BannerSettings.tsx +117 -0
- package/src/models/CCPAData.tsx +32 -0
- package/src/models/CCPASettings.tsx +49 -0
- package/src/models/ConsentDisclosureObject.tsx +47 -0
- package/src/models/FirstLayerSettings.tsx +185 -0
- package/src/models/GeolocationRuleset.tsx +10 -0
- package/src/models/LegalBasisLocalization.tsx +100 -0
- package/src/models/NetworkMode.tsx +5 -0
- package/src/models/SecondLayerSettings.tsx +12 -0
- package/src/models/TCF2Settings.tsx +209 -0
- package/src/models/TCFData.tsx +297 -0
- package/src/models/TCFDecisionUILayer.tsx +5 -0
- package/src/models/TCFUserDecisions.tsx +73 -0
- package/src/models/UserDecision.tsx +10 -0
- package/src/models/UsercentricsAnalyticsEventType.tsx +15 -0
- package/src/models/UsercentricsCMPData.tsx +38 -0
- package/src/models/UsercentricsCategory.tsx +26 -0
- package/src/models/UsercentricsConsentType.tsx +5 -0
- package/src/models/UsercentricsConsentUserResponse.tsx +14 -0
- package/src/models/UsercentricsLabels.tsx +276 -0
- package/src/models/UsercentricsLocation.tsx +32 -0
- package/src/models/UsercentricsLoggerLevel.tsx +7 -0
- package/src/models/UsercentricsOptions.tsx +45 -0
- package/src/models/UsercentricsReadyStatus.tsx +20 -0
- package/src/models/UsercentricsService.tsx +134 -0
- package/src/models/UsercentricsServiceConsent.tsx +37 -0
- package/src/models/UsercentricsSettings.tsx +177 -0
- package/src/models/UsercentricsUserInteraction.tsx +7 -0
- package/src/models/UsercentricsVariant.tsx +6 -0
- package/src/models/index.tsx +29 -0
- package/android/src/androidTest/java/com/usercentrics/reactnativemodule/fake/FakePromise.kt +0 -67
- package/android/src/main/java/com/usercentrics/reactnativeusercentrics/RNUsercentricsPackage.kt +0 -22
- package/android/src/main/java/com/usercentrics/reactnativeusercentrics/UCRNFlag.kt +0 -4
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/api/FakeUsercentricsProxy.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/GetCMPDataMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/GetConsentsMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/GetTCFDataMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/GetUSPDataMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/GetUserSessionDataMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/ReactContextProviderMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/SaveDecisionsForTCFMock.kt +0 -0
- /package/android/src/androidTest/java/com/usercentrics/{reactnativemodule → reactnative}/mock/SaveDecisionsMock.kt +0 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CCPASettings,
|
|
3
|
+
ConsentDisclosure,
|
|
4
|
+
ConsentDisclosureObject,
|
|
5
|
+
ConsentDisclosureType,
|
|
6
|
+
DpsDisplayFormat,
|
|
7
|
+
FirstLayer,
|
|
8
|
+
FirstLayerMobileVariant,
|
|
9
|
+
TCF2ChangedPurposes,
|
|
10
|
+
TCF2Scope,
|
|
11
|
+
TCF2Settings,
|
|
12
|
+
TCFUserDecisionOnPurpose,
|
|
13
|
+
TCFUserDecisionOnSpecialFeature,
|
|
14
|
+
TCFUserDecisionOnVendor,
|
|
15
|
+
USAFrameworks, UsercentricsCategory,
|
|
16
|
+
UsercentricsCMPData,
|
|
17
|
+
UsercentricsLabels, UsercentricsLocation,
|
|
18
|
+
UsercentricsSettings,
|
|
19
|
+
UsercentricsVariant
|
|
20
|
+
} from "../models";
|
|
21
|
+
import { TCFFeature, TCFPurpose } from "../models/TCFData";
|
|
22
|
+
import { AdTechProviderDecision } from "../models/TCFUserDecisions";
|
|
23
|
+
import { UsercentricsService } from "../models/UsercentricsService";
|
|
24
|
+
import { LegalBasisLocalization } from "../models/LegalBasisLocalization";
|
|
25
|
+
|
|
26
|
+
export const usercentricsServiceConsent = {
|
|
27
|
+
templateId: "abc",
|
|
28
|
+
status: false,
|
|
29
|
+
dataProcessor: "abc",
|
|
30
|
+
version: "abc",
|
|
31
|
+
type: 0,
|
|
32
|
+
categoty: "essential",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const userDecision = {
|
|
36
|
+
serviceId: "1",
|
|
37
|
+
consent: false
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const ccpaDataExample = {
|
|
41
|
+
uspString: "ABCD1234",
|
|
42
|
+
version: 123,
|
|
43
|
+
optedOut: false,
|
|
44
|
+
lspact: true,
|
|
45
|
+
noticeGiven: false
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const ucLabels: UsercentricsLabels = {
|
|
49
|
+
btnAcceptAll: "btnAcceptAll",
|
|
50
|
+
btnDeny: "btnDeny",
|
|
51
|
+
btnSave: "btnSave",
|
|
52
|
+
firstLayerTitle: "firstLayerTitle",
|
|
53
|
+
accepted: "accepted",
|
|
54
|
+
denied: "denied",
|
|
55
|
+
date: "date",
|
|
56
|
+
decision: "decision",
|
|
57
|
+
dataCollectedList: "dataCollectedList",
|
|
58
|
+
dataCollectedInfo: "dataCollectedInfo",
|
|
59
|
+
locationOfProcessing: "locationOfProcessing",
|
|
60
|
+
transferToThirdCountries: "transferToThirdCountries",
|
|
61
|
+
transferToThirdCountriesInfo: "transferToThirdCountriesInfo",
|
|
62
|
+
dataPurposes: "dataPurposes",
|
|
63
|
+
dataPurposesInfo: "dataPurposesInfo",
|
|
64
|
+
dataRecipientsList: "dataRecipientsList",
|
|
65
|
+
descriptionOfService: "descriptionOfService",
|
|
66
|
+
history: "history",
|
|
67
|
+
historyDescription: "historyDescription",
|
|
68
|
+
legalBasisList: "legalBasisList",
|
|
69
|
+
legalBasisInfo: "legalBasisInfo",
|
|
70
|
+
processingCompanyTitle: "processingCompanyTitle",
|
|
71
|
+
retentionPeriod: "retentionPeriod",
|
|
72
|
+
technologiesUsed: "technologiesUsed",
|
|
73
|
+
technologiesUsedInfo: "technologiesUsedInfo",
|
|
74
|
+
cookiePolicyInfo: "cookiePolicyInfo",
|
|
75
|
+
optOut: "optOut",
|
|
76
|
+
policyOf: "policyOf",
|
|
77
|
+
imprintLinkText: "imprintLinkText",
|
|
78
|
+
privacyPolicyLinkText: "privacyPolicyLinkText",
|
|
79
|
+
categories: "categories",
|
|
80
|
+
anyDomain: "anyDomain",
|
|
81
|
+
day: "day",
|
|
82
|
+
days: "days",
|
|
83
|
+
domain: "domain",
|
|
84
|
+
duration: "duration",
|
|
85
|
+
informationLoadingNotPossible: "informationLoadingNotPossible",
|
|
86
|
+
hour: "hour",
|
|
87
|
+
hours: "hours",
|
|
88
|
+
identifier: "identifier",
|
|
89
|
+
maximumAgeCookieStorage: "maximumAgeCookieStorage",
|
|
90
|
+
minute: "minute",
|
|
91
|
+
minutes: "minutes",
|
|
92
|
+
month: "month",
|
|
93
|
+
months: "months",
|
|
94
|
+
multipleDomains: "multipleDomains",
|
|
95
|
+
no: "no",
|
|
96
|
+
nonCookieStorage: "nonCookieStorage",
|
|
97
|
+
seconds: "seconds",
|
|
98
|
+
session: "session",
|
|
99
|
+
loadingStorageInformation: "loadingStorageInformation",
|
|
100
|
+
storageInformation: "storageInformation",
|
|
101
|
+
detailedStorageInformation: "detailedStorageInformation",
|
|
102
|
+
tryAgain: "tryAgain",
|
|
103
|
+
type: "type",
|
|
104
|
+
year: "year",
|
|
105
|
+
years: "years",
|
|
106
|
+
yes: "yes",
|
|
107
|
+
storageInformationDescription: "storageInformationDescription",
|
|
108
|
+
btnBannerReadMore: "btnBannerReadMore",
|
|
109
|
+
readLess: "readLess",
|
|
110
|
+
btnMore: "btnMore",
|
|
111
|
+
more: "more",
|
|
112
|
+
linkToDpaInfo: "linkToDpaInfo",
|
|
113
|
+
second: "second",
|
|
114
|
+
consent: "consent",
|
|
115
|
+
headerModal: "headerModal",
|
|
116
|
+
secondLayerDescriptionHtml: "secondLayerDescriptionHtml",
|
|
117
|
+
secondLayerTitle: "secondLayerTitle",
|
|
118
|
+
settings: "settings",
|
|
119
|
+
subConsents: "subConsents",
|
|
120
|
+
btnAccept: "btnAccept",
|
|
121
|
+
poweredBy: "poweredBy",
|
|
122
|
+
dataProtectionOfficer: "dataProtectionOfficer",
|
|
123
|
+
nameOfProcessingCompany: "nameOfProcessingCompany",
|
|
124
|
+
btnBack: "btnBack",
|
|
125
|
+
copy: "copy",
|
|
126
|
+
copied: "copied",
|
|
127
|
+
basic: "basic",
|
|
128
|
+
advanced: "advanced",
|
|
129
|
+
processingCompany: "processingCompany",
|
|
130
|
+
name: "name",
|
|
131
|
+
explicit: "explicit",
|
|
132
|
+
implicit: "implicit",
|
|
133
|
+
btnMoreInfo: "btnMoreInfo",
|
|
134
|
+
furtherInformationOptOut: "furtherInformationOptOut",
|
|
135
|
+
cookiePolicyLinkText: "cookiePolicyLinkText",
|
|
136
|
+
noImplicit: "noImplicit",
|
|
137
|
+
yesImplicit: "yesImplicit",
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const ccpaSettings: CCPASettings = {
|
|
141
|
+
optOutNoticeLabel: "optOutNoticeLabel",
|
|
142
|
+
btnSave: "btnSave",
|
|
143
|
+
firstLayerTitle: "firstLayerTitle",
|
|
144
|
+
isActive: true,
|
|
145
|
+
showOnPageLoad: true,
|
|
146
|
+
reshowAfterDays: 90,
|
|
147
|
+
iabAgreementExists: true,
|
|
148
|
+
appFirstLayerDescription: "appFirstLayerDescription",
|
|
149
|
+
firstLayerMobileDescriptionIsActive: true,
|
|
150
|
+
firstLayerMobileDescription: "firstLayerMobileDescription",
|
|
151
|
+
secondLayerTitle: "secondLayerTitle",
|
|
152
|
+
secondLayerDescription: "secondLayerDescription",
|
|
153
|
+
secondLayerHideLanguageSwitch: true,
|
|
154
|
+
btnMoreInfo: "btnMoreInfo",
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const tcf2ChangedPurposes: TCF2ChangedPurposes = {
|
|
158
|
+
legIntPurposes: [1],
|
|
159
|
+
purposes: [2]
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const tcf2Settings: TCF2Settings = {
|
|
163
|
+
firstLayerTitle: "firstLayerTitle",
|
|
164
|
+
secondLayerTitle: "secondLayerTitle",
|
|
165
|
+
tabsPurposeLabel: "tabsPurposeLabel",
|
|
166
|
+
tabsVendorsLabel: "tabsVendorsLabel",
|
|
167
|
+
labelsFeatures: "labelsFeatures",
|
|
168
|
+
labelsIabVendors: "labelsIabVendors",
|
|
169
|
+
labelsNonIabPurposes: "labelsNonIabPurposes",
|
|
170
|
+
labelsNonIabVendors: "labelsNonIabVendors",
|
|
171
|
+
labelsPurposes: "labelsPurposes",
|
|
172
|
+
vendorFeatures: "vendorFeatures",
|
|
173
|
+
vendorLegitimateInterestPurposes: "vendorLegitimateInterestPurposes",
|
|
174
|
+
vendorPurpose: "vendorPurpose",
|
|
175
|
+
vendorSpecialFeatures: "vendorSpecialFeatures",
|
|
176
|
+
vendorSpecialPurposes: "vendorSpecialPurposes",
|
|
177
|
+
togglesConsentToggleLabel: "togglesConsentToggleLabel",
|
|
178
|
+
togglesLegIntToggleLabel: "togglesLegIntToggleLabel",
|
|
179
|
+
buttonsAcceptAllLabel: "buttonsAcceptAllLabel",
|
|
180
|
+
buttonsDenyAllLabel: "buttonsDenyAllLabel",
|
|
181
|
+
buttonsSaveLabel: "buttonsSaveLabel",
|
|
182
|
+
linksManageSettingsLabel: "linksManageSettingsLabel",
|
|
183
|
+
linksVendorListLinkLabel: "linksVendorListLinkLabel",
|
|
184
|
+
cmpId: 1,
|
|
185
|
+
cmpVersion: 1,
|
|
186
|
+
firstLayerHideToggles: true,
|
|
187
|
+
secondLayerHideToggles: true,
|
|
188
|
+
hideLegitimateInterestToggles: true,
|
|
189
|
+
firstLayerHideButtonDeny: true,
|
|
190
|
+
secondLayerHideButtonDeny: true,
|
|
191
|
+
publisherCountryCode: "",
|
|
192
|
+
purposeOneTreatment: true,
|
|
193
|
+
selectedVendorIds: [755],
|
|
194
|
+
gdprApplies: true,
|
|
195
|
+
selectedStacks: [1],
|
|
196
|
+
disabledSpecialFeatures: [1],
|
|
197
|
+
firstLayerShowDescriptions: true,
|
|
198
|
+
hideNonIabOnFirstLayer: true,
|
|
199
|
+
resurfacePeriodEnded: true,
|
|
200
|
+
resurfacePurposeChanged: true,
|
|
201
|
+
resurfaceVendorAdded: true,
|
|
202
|
+
firstLayerDescription: "firstLayerDescription",
|
|
203
|
+
firstLayerAdditionalInfo: "firstLayerAdditionalInfo",
|
|
204
|
+
secondLayerDescription: "secondLayerDescription",
|
|
205
|
+
togglesSpecialFeaturesToggleOn: "togglesSpecialFeaturesToggleOn",
|
|
206
|
+
togglesSpecialFeaturesToggleOff: "togglesSpecialFeaturesToggleOff",
|
|
207
|
+
appLayerNoteResurface: "appLayerNoteResurface",
|
|
208
|
+
firstLayerNoteResurface: "firstLayerNoteResurface",
|
|
209
|
+
categoriesOfDataLabel: "categoriesOfDataLabel",
|
|
210
|
+
dataRetentionPeriodLabel: "dataRetentionPeriodLabel",
|
|
211
|
+
legitimateInterestLabel: "legitimateInterestLabel",
|
|
212
|
+
version: "version",
|
|
213
|
+
examplesLabel: "examplesLabel",
|
|
214
|
+
firstLayerMobileVariant: FirstLayerMobileVariant.full,
|
|
215
|
+
showDataSharedOutsideEUText: true,
|
|
216
|
+
dataSharedOutsideEUText: "dataSharedOutsideEUText",
|
|
217
|
+
vendorIdsOutsideEUList: [1],
|
|
218
|
+
scope: TCF2Scope.global,
|
|
219
|
+
changedPurposes: tcf2ChangedPurposes,
|
|
220
|
+
acmV2Enabled: true,
|
|
221
|
+
selectedATPIds: [10, 20, 30]
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const firstLayer: FirstLayer = {
|
|
225
|
+
hideButtonDeny: false
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const ucSettings: UsercentricsSettings = {
|
|
229
|
+
labels: ucLabels,
|
|
230
|
+
version: "2.2",
|
|
231
|
+
language: "en",
|
|
232
|
+
imprintUrl: "url",
|
|
233
|
+
privacyPolicyUrl: "privacyPolicyUrl",
|
|
234
|
+
cookiePolicyUrl: "cookiePolicyUrl",
|
|
235
|
+
firstLayerDescriptionHtml: "firstLayerDescriptionHtml",
|
|
236
|
+
firstLayerMobileDescriptionHtml: "firstLayerMobileDescriptionHtml",
|
|
237
|
+
settingsId: "someId",
|
|
238
|
+
bannerMobileDescriptionIsActive: true,
|
|
239
|
+
enablePoweredBy: true,
|
|
240
|
+
displayOnlyForEU: true,
|
|
241
|
+
tcf2Enabled: true,
|
|
242
|
+
reshowBanner: 1,
|
|
243
|
+
editableLanguages: ["en"],
|
|
244
|
+
languagesAvailable: ["en"],
|
|
245
|
+
showInitialViewForVersionChange: ["a"],
|
|
246
|
+
ccpa: ccpaSettings,
|
|
247
|
+
tcf2: tcf2Settings,
|
|
248
|
+
customization: "custom",
|
|
249
|
+
firstLayer: firstLayer,
|
|
250
|
+
secondLayer: undefined,
|
|
251
|
+
variants: undefined,
|
|
252
|
+
dpsDisplayFormat: DpsDisplayFormat.all,
|
|
253
|
+
framework: USAFrameworks.cpa,
|
|
254
|
+
publishedApps: undefined,
|
|
255
|
+
renewConsentsTimestamp: 1000,
|
|
256
|
+
consentWebhook: true
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const disclosure: ConsentDisclosure = {
|
|
260
|
+
identifier: "identifier",
|
|
261
|
+
type: ConsentDisclosureType.app,
|
|
262
|
+
name: "name",
|
|
263
|
+
maxAgeSeconds: 0,
|
|
264
|
+
cookieRefresh: false,
|
|
265
|
+
purposes: [0],
|
|
266
|
+
domain: "domain",
|
|
267
|
+
description: "description",
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const consentDisclosureObject: ConsentDisclosureObject = {
|
|
271
|
+
disclosures: [disclosure]
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const ucService: UsercentricsService = {
|
|
275
|
+
templateId: "templateId",
|
|
276
|
+
version: "version",
|
|
277
|
+
categorySlug: "categorySlug",
|
|
278
|
+
isEssential: true,
|
|
279
|
+
type: "type",
|
|
280
|
+
dataProcessor: "dataProcessor",
|
|
281
|
+
dataPurposes: ["dataPurposes"],
|
|
282
|
+
processingCompany: "processingCompany",
|
|
283
|
+
nameOfProcessingCompany: "nameOfProcessingCompany",
|
|
284
|
+
addressOfProcessingCompany: "addressOfProcessingCompany",
|
|
285
|
+
descriptionOfService: "descriptionOfService",
|
|
286
|
+
languagesAvailable: ["languagesAvailable"],
|
|
287
|
+
dataCollectedList: ["dataCollectedList"],
|
|
288
|
+
dataPurposesList: ["dataPurposesList"],
|
|
289
|
+
dataRecipientsList: ["dataRecipientsList"],
|
|
290
|
+
legalBasisList: ["legalBasisList"],
|
|
291
|
+
retentionPeriodList: ["retentionPeriodList"],
|
|
292
|
+
subConsents: ["subConsents"],
|
|
293
|
+
language: "language",
|
|
294
|
+
linkToDpa: "linkToDpa",
|
|
295
|
+
legalGround: "legalGround",
|
|
296
|
+
optOutUrl: "optOutUrl",
|
|
297
|
+
policyOfProcessorUrl: "policyOfProcessorUrl",
|
|
298
|
+
retentionPeriodDescription: "retentionPeriodDescription",
|
|
299
|
+
dataProtectionOfficer: "dataProtectionOfficer",
|
|
300
|
+
privacyPolicyURL: "privacyPolicyURL",
|
|
301
|
+
cookiePolicyURL: "cookiePolicyURL",
|
|
302
|
+
locationOfProcessing: "locationOfProcessing",
|
|
303
|
+
dataCollectedDescription: "dataCollectedDescription",
|
|
304
|
+
thirdCountryTransfer: "thirdCountryTransfer",
|
|
305
|
+
description: "description",
|
|
306
|
+
cookieMaxAgeSeconds: 100,
|
|
307
|
+
usesNonCookieAccess: true,
|
|
308
|
+
deviceStorageDisclosureUrl: "deviceStorageDisclosureUrl",
|
|
309
|
+
technologyUsed: ["technologyUsed"],
|
|
310
|
+
isDeactivated: true,
|
|
311
|
+
disableLegalBasis: true,
|
|
312
|
+
deviceStorage: consentDisclosureObject,
|
|
313
|
+
isHidden: true,
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const ucCategory : UsercentricsCategory = {
|
|
317
|
+
categorySlug: "categorySlug",
|
|
318
|
+
description: "description",
|
|
319
|
+
isEssential: false,
|
|
320
|
+
label: "label"
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const userLocation: UsercentricsLocation = {
|
|
324
|
+
countryCode: "PT",
|
|
325
|
+
isInCalifornia: false,
|
|
326
|
+
isInEU: true,
|
|
327
|
+
isInUS: false,
|
|
328
|
+
regionCode: "PT11"
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
let dataMap: Map<string, string> = new Map();
|
|
332
|
+
dataMap.set('key1', 'value1');
|
|
333
|
+
|
|
334
|
+
const legalBasis: LegalBasisLocalization = {
|
|
335
|
+
data: dataMap,
|
|
336
|
+
labelsAria: undefined
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export const cmpDataExample: UsercentricsCMPData = {
|
|
340
|
+
settings: ucSettings,
|
|
341
|
+
services: [ucService],
|
|
342
|
+
categories: [ucCategory],
|
|
343
|
+
activeVariant: UsercentricsVariant.default,
|
|
344
|
+
userLocation: userLocation,
|
|
345
|
+
legalBasis: legalBasis
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export const featuresExample: [TCFFeature] = [
|
|
349
|
+
{
|
|
350
|
+
purposeDescription: "string",
|
|
351
|
+
illustrations: ['1'],
|
|
352
|
+
id: 123,
|
|
353
|
+
name: "string"
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
|
|
357
|
+
export const purposesExample: [TCFPurpose] = [
|
|
358
|
+
{
|
|
359
|
+
purposeDescription: "string",
|
|
360
|
+
illustrations: ['1'],
|
|
361
|
+
id: 123,
|
|
362
|
+
name: "string",
|
|
363
|
+
isPartOfASelectedStack: false,
|
|
364
|
+
showConsentToggle: false,
|
|
365
|
+
showLegitimateInterestToggle: false,
|
|
366
|
+
legitimateInterestConsent: false,
|
|
367
|
+
consent: true,
|
|
368
|
+
stackId: 42,
|
|
369
|
+
numberOfVendors: 1,
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
|
|
373
|
+
export const tcfUserDecisionOnPurposeExample: [TCFUserDecisionOnPurpose] = [
|
|
374
|
+
{
|
|
375
|
+
id: 123,
|
|
376
|
+
consent: false,
|
|
377
|
+
legitimateInterestConsent: true,
|
|
378
|
+
}
|
|
379
|
+
];
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
export const tcfUserDecisionOnSpecialFeatureExample: [TCFUserDecisionOnSpecialFeature] = [
|
|
383
|
+
{
|
|
384
|
+
id: 222,
|
|
385
|
+
consent: false,
|
|
386
|
+
}
|
|
387
|
+
];
|
|
388
|
+
|
|
389
|
+
export const tcfUserDecisionOnVendorExample: [TCFUserDecisionOnVendor] = [
|
|
390
|
+
{
|
|
391
|
+
id: 111,
|
|
392
|
+
consent: false,
|
|
393
|
+
legitimateInterestConsent: true
|
|
394
|
+
}
|
|
395
|
+
];
|
|
396
|
+
|
|
397
|
+
export const adTechProviderDecisionExample: [AdTechProviderDecision] = [
|
|
398
|
+
{
|
|
399
|
+
id: 43,
|
|
400
|
+
consent: false,
|
|
401
|
+
}
|
|
402
|
+
];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
// Configuration
|
|
6
|
+
configure(options: Object): void;
|
|
7
|
+
isReady(): Promise<Object>;
|
|
8
|
+
|
|
9
|
+
// UI Methods
|
|
10
|
+
showFirstLayer(options?: Object): Promise<Object>;
|
|
11
|
+
showSecondLayer(options?: Object): Promise<Object>;
|
|
12
|
+
|
|
13
|
+
// Session Management
|
|
14
|
+
restoreUserSession(controllerId: string): Promise<Object>;
|
|
15
|
+
getControllerId(): Promise<string>;
|
|
16
|
+
clearUserSession(): Promise<Object>;
|
|
17
|
+
|
|
18
|
+
// Data Retrieval
|
|
19
|
+
getConsents(): Promise<Array<Object>>;
|
|
20
|
+
getCMPData(): Promise<Object>;
|
|
21
|
+
getAdditionalConsentModeData(): Promise<Object>;
|
|
22
|
+
getTCFData(): Promise<Object>;
|
|
23
|
+
getUserSessionData(): Promise<string>;
|
|
24
|
+
getUSPData(): Promise<Object>;
|
|
25
|
+
getABTestingVariant(): Promise<string>;
|
|
26
|
+
|
|
27
|
+
// Configuration Setters
|
|
28
|
+
setCMPId(id: number): void;
|
|
29
|
+
setABTestingVariant(variant: string): void;
|
|
30
|
+
changeLanguage(language: string): Promise<void>;
|
|
31
|
+
|
|
32
|
+
// Consent Actions
|
|
33
|
+
acceptAll(consentType: number): Promise<Array<Object>>;
|
|
34
|
+
acceptAllForTCF(fromLayer: number, consentType: number): Promise<Array<Object>>;
|
|
35
|
+
denyAll(consentType: number): Promise<Array<Object>>;
|
|
36
|
+
denyAllForTCF(fromLayer: number, consentType: number): Promise<Array<Object>>;
|
|
37
|
+
|
|
38
|
+
saveDecisions(decisions: Array<Object>, consentType: number): Promise<Array<Object>>;
|
|
39
|
+
saveDecisionsForTCF(
|
|
40
|
+
tcfDecisions: Object,
|
|
41
|
+
fromLayer: number,
|
|
42
|
+
saveDecisions: Array<Object>,
|
|
43
|
+
consentType: number
|
|
44
|
+
): Promise<Array<Object>>;
|
|
45
|
+
saveOptOutForCCPA(isOptedOut: boolean, consentType: number): Promise<Array<Object>>;
|
|
46
|
+
|
|
47
|
+
// Analytics
|
|
48
|
+
track(event: number): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default TurboModuleRegistry.get<Spec>('RNUsercentricsModule');
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class AdditionalConsentModeData {
|
|
2
|
+
|
|
3
|
+
acString: string
|
|
4
|
+
adTechProviders: AdTechProvider[]
|
|
5
|
+
|
|
6
|
+
constructor(
|
|
7
|
+
acString: string,
|
|
8
|
+
adTechProviders: AdTechProvider[]
|
|
9
|
+
) {
|
|
10
|
+
this.acString = acString
|
|
11
|
+
this.adTechProviders = adTechProviders
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class AdTechProvider {
|
|
16
|
+
|
|
17
|
+
id: number
|
|
18
|
+
name: string
|
|
19
|
+
privacyPolicyUrl: string
|
|
20
|
+
consent: boolean
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
id: number,
|
|
24
|
+
name: string,
|
|
25
|
+
privacyPolicyUrl: string,
|
|
26
|
+
consent: boolean,
|
|
27
|
+
) {
|
|
28
|
+
this.id = id
|
|
29
|
+
this.name = name
|
|
30
|
+
this.privacyPolicyUrl = privacyPolicyUrl
|
|
31
|
+
this.consent = consent
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {ImageResolvedAssetSource} from "react-native";
|
|
2
|
+
import {FirstLayerStyleSettings, SecondLayerStyleSettings} from ".";
|
|
3
|
+
|
|
4
|
+
export class BannerLogo {
|
|
5
|
+
|
|
6
|
+
logoName: string;
|
|
7
|
+
logoPath: string;
|
|
8
|
+
logoUrl?: String;
|
|
9
|
+
|
|
10
|
+
constructor(logoName: string, logoPath: ImageResolvedAssetSource, logoUrl?: String) {
|
|
11
|
+
this.logoName = logoName;
|
|
12
|
+
this.logoPath = logoPath.uri;
|
|
13
|
+
this.logoUrl = logoUrl;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class BannerFont {
|
|
18
|
+
|
|
19
|
+
regularFont: string;
|
|
20
|
+
boldFont: string;
|
|
21
|
+
fontSize: number;
|
|
22
|
+
|
|
23
|
+
constructor(regularFont: string, boldFont: string, fontSize: number) {
|
|
24
|
+
this.regularFont = regularFont;
|
|
25
|
+
this.boldFont = boldFont;
|
|
26
|
+
this.fontSize = fontSize;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum LegalLinksSettings {
|
|
31
|
+
|
|
32
|
+
firstLayerOnly = "FIRST_LAYER_ONLY",
|
|
33
|
+
secondLayerOnly = "SECOND_LAYER_ONLY",
|
|
34
|
+
both = "BOTH",
|
|
35
|
+
hidden = "HIDDEN"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class ToggleStyleSettings {
|
|
39
|
+
|
|
40
|
+
activeBackgroundColorHex?: String;
|
|
41
|
+
inactiveBackgroundColorHex?: String;
|
|
42
|
+
disabledBackgroundColorHex?: String;
|
|
43
|
+
activeThumbColorHex?: String;
|
|
44
|
+
inactiveThumbColorHex?: String;
|
|
45
|
+
disabledThumbColorHex?: String;
|
|
46
|
+
|
|
47
|
+
constructor(
|
|
48
|
+
activeBackgroundColorHex?: String,
|
|
49
|
+
inactiveBackgroundColorHex?: String,
|
|
50
|
+
disabledBackgroundColorHex?: String,
|
|
51
|
+
activeThumbColorHex?: String,
|
|
52
|
+
inactiveThumbColorHex?: String,
|
|
53
|
+
disabledThumbColorHex?: String
|
|
54
|
+
) {
|
|
55
|
+
this.activeBackgroundColorHex = activeBackgroundColorHex;
|
|
56
|
+
this.inactiveBackgroundColorHex = inactiveBackgroundColorHex;
|
|
57
|
+
this.disabledBackgroundColorHex = disabledBackgroundColorHex;
|
|
58
|
+
this.activeThumbColorHex = activeThumbColorHex;
|
|
59
|
+
this.inactiveThumbColorHex = inactiveThumbColorHex;
|
|
60
|
+
this.disabledThumbColorHex = disabledThumbColorHex;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class GeneralStyleSettings {
|
|
65
|
+
|
|
66
|
+
font?: BannerFont;
|
|
67
|
+
logo?: BannerLogo;
|
|
68
|
+
links?: LegalLinksSettings;
|
|
69
|
+
textColorHex?: String;
|
|
70
|
+
layerBackgroundColorHex?: String;
|
|
71
|
+
layerBackgroundSecondaryColorHex?: String;
|
|
72
|
+
linkColorHex?: String;
|
|
73
|
+
tabColorHex?: String;
|
|
74
|
+
bordersColorHex?: String;
|
|
75
|
+
toggleStyleSettings?: ToggleStyleSettings;
|
|
76
|
+
disableSystemBackButton?: Boolean;
|
|
77
|
+
|
|
78
|
+
constructor(font?: BannerFont,
|
|
79
|
+
logo?: BannerLogo,
|
|
80
|
+
links?: LegalLinksSettings,
|
|
81
|
+
textColorHex?: String,
|
|
82
|
+
layerBackgroundColorHex?: String,
|
|
83
|
+
layerBackgroundSecondaryColorHex?: String,
|
|
84
|
+
linkColorHex?: String,
|
|
85
|
+
tabColorHex?: String,
|
|
86
|
+
bordersColorHex?: String,
|
|
87
|
+
toggleStyleSettings?: ToggleStyleSettings,
|
|
88
|
+
disableSystemBackButton?: Boolean
|
|
89
|
+
) {
|
|
90
|
+
this.font = font;
|
|
91
|
+
this.logo = logo;
|
|
92
|
+
this.links = links;
|
|
93
|
+
this.textColorHex = textColorHex;
|
|
94
|
+
this.layerBackgroundColorHex = layerBackgroundColorHex;
|
|
95
|
+
this.layerBackgroundSecondaryColorHex = layerBackgroundSecondaryColorHex;
|
|
96
|
+
this.linkColorHex = linkColorHex;
|
|
97
|
+
this.tabColorHex = tabColorHex;
|
|
98
|
+
this.bordersColorHex = bordersColorHex;
|
|
99
|
+
this.toggleStyleSettings = toggleStyleSettings;
|
|
100
|
+
this.disableSystemBackButton = disableSystemBackButton;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export class BannerSettings {
|
|
105
|
+
|
|
106
|
+
firstLayerStyleSettings?: FirstLayerStyleSettings;
|
|
107
|
+
secondLayerStyleSettings?: SecondLayerStyleSettings;
|
|
108
|
+
generalStyleSettings?: GeneralStyleSettings;
|
|
109
|
+
variantName?: String
|
|
110
|
+
|
|
111
|
+
constructor(firstLayerStyleSettings?: FirstLayerStyleSettings, secondLayerStyleSettings?: SecondLayerStyleSettings, generalStyleSettings?: GeneralStyleSettings, variantName?: String) {
|
|
112
|
+
this.firstLayerStyleSettings = firstLayerStyleSettings;
|
|
113
|
+
this.secondLayerStyleSettings = secondLayerStyleSettings;
|
|
114
|
+
this.generalStyleSettings = generalStyleSettings;
|
|
115
|
+
this.variantName = variantName;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class CCPAData {
|
|
2
|
+
|
|
3
|
+
/// CCPA version.
|
|
4
|
+
version: number
|
|
5
|
+
|
|
6
|
+
/// True if the user opted out the consents, so the user denies the services. False if not, so the user accepts the services.
|
|
7
|
+
optedOut?: boolean
|
|
8
|
+
|
|
9
|
+
/// Limited Service Provider Agreement Covered Transaction.
|
|
10
|
+
lspact?: boolean
|
|
11
|
+
|
|
12
|
+
/// True if the notice was given. False if not.
|
|
13
|
+
noticeGiven?: boolean
|
|
14
|
+
|
|
15
|
+
/// Encoded USP String.
|
|
16
|
+
uspString: string
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
uspString: string,
|
|
21
|
+
version: number,
|
|
22
|
+
optedOut?: boolean,
|
|
23
|
+
lspact?: boolean,
|
|
24
|
+
noticeGiven?: boolean
|
|
25
|
+
) {
|
|
26
|
+
this.version = version
|
|
27
|
+
this.optedOut = optedOut
|
|
28
|
+
this.lspact = lspact
|
|
29
|
+
this.noticeGiven = noticeGiven
|
|
30
|
+
this.uspString = uspString
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export class CCPASettings {
|
|
2
|
+
|
|
3
|
+
optOutNoticeLabel: string
|
|
4
|
+
btnSave: string
|
|
5
|
+
firstLayerTitle: string
|
|
6
|
+
isActive: boolean
|
|
7
|
+
showOnPageLoad: boolean
|
|
8
|
+
reshowAfterDays: number
|
|
9
|
+
iabAgreementExists: boolean
|
|
10
|
+
appFirstLayerDescription: string
|
|
11
|
+
firstLayerMobileDescriptionIsActive: boolean
|
|
12
|
+
firstLayerMobileDescription: string
|
|
13
|
+
secondLayerTitle: string
|
|
14
|
+
secondLayerDescription: string
|
|
15
|
+
secondLayerHideLanguageSwitch: boolean
|
|
16
|
+
btnMoreInfo: string
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
optOutNoticeLabel: string,
|
|
20
|
+
btnSave: string,
|
|
21
|
+
firstLayerTitle: string,
|
|
22
|
+
isActive: boolean,
|
|
23
|
+
showOnPageLoad: boolean,
|
|
24
|
+
reshowAfterDays: number,
|
|
25
|
+
iabAgreementExists: boolean,
|
|
26
|
+
appFirstLayerDescription: string,
|
|
27
|
+
firstLayerMobileDescriptionIsActive: boolean,
|
|
28
|
+
firstLayerMobileDescription: string,
|
|
29
|
+
secondLayerTitle: string,
|
|
30
|
+
secondLayerDescription: string,
|
|
31
|
+
secondLayerHideLanguageSwitch: boolean,
|
|
32
|
+
btnMoreInfo: string
|
|
33
|
+
) {
|
|
34
|
+
this.optOutNoticeLabel = optOutNoticeLabel
|
|
35
|
+
this.btnSave = btnSave
|
|
36
|
+
this.firstLayerTitle = firstLayerTitle
|
|
37
|
+
this.isActive = isActive
|
|
38
|
+
this.showOnPageLoad = showOnPageLoad
|
|
39
|
+
this.reshowAfterDays = reshowAfterDays
|
|
40
|
+
this.iabAgreementExists = iabAgreementExists
|
|
41
|
+
this.appFirstLayerDescription = appFirstLayerDescription
|
|
42
|
+
this.firstLayerMobileDescriptionIsActive = firstLayerMobileDescriptionIsActive
|
|
43
|
+
this.firstLayerMobileDescription = firstLayerMobileDescription
|
|
44
|
+
this.secondLayerTitle = secondLayerTitle
|
|
45
|
+
this.secondLayerDescription = secondLayerDescription
|
|
46
|
+
this.secondLayerHideLanguageSwitch = secondLayerHideLanguageSwitch
|
|
47
|
+
this.btnMoreInfo = btnMoreInfo
|
|
48
|
+
}
|
|
49
|
+
}
|