com.usercentrics.sdk.static 0.0.0-stage → 2.36.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/Documentation/LICENSE +2 -0
- package/Documentation/LICENSE.meta +7 -0
- package/Documentation/README +169 -0
- package/Documentation/README.meta +7 -0
- package/Documentation.meta +8 -0
- package/Editor/ATTLocalizationMessageDrawer.cs +92 -0
- package/Editor/ATTLocalizationMessageDrawer.cs.meta +11 -0
- package/Editor/AssemblyInfo.cs +4 -0
- package/Editor/AssemblyInfo.cs.meta +11 -0
- package/Editor/Unity.UsercentricsEditor.asmdef +18 -0
- package/Editor/Unity.UsercentricsEditor.asmdef.meta +7 -0
- package/Editor/UsercentricsATTPostProcessor.cs +125 -0
- package/Editor/UsercentricsATTPostProcessor.cs.meta +11 -0
- package/Editor/UsercentricsAndroidPostBuild.cs +45 -0
- package/Editor/UsercentricsAndroidPostBuild.cs.meta +11 -0
- package/Editor/UsercentricsAndroidSdkCheck.cs +29 -0
- package/Editor/UsercentricsAndroidSdkCheck.cs.meta +11 -0
- package/Editor/UsercentricsDependencies.xml +18 -0
- package/Editor/UsercentricsDependencies.xml.meta +7 -0
- package/Editor/UsercentricsExternalDependencyManagerBuildCheck.cs +56 -0
- package/Editor/UsercentricsExternalDependencyManagerBuildCheck.cs.meta +11 -0
- package/Editor/UsercentricsExternalDependencyManagerCheck.cs +34 -0
- package/Editor/UsercentricsExternalDependencyManagerCheck.cs.meta +11 -0
- package/Editor/UsercentricsIOSBuildFixes.cs +171 -0
- package/Editor/UsercentricsIOSBuildFixes.cs.meta +11 -0
- package/Editor/UsercentricsPBXProjectExtensions.cs +281 -0
- package/Editor/UsercentricsPBXProjectExtensions.cs.meta +11 -0
- package/Editor/UsercentricsPodfilePatches.cs +116 -0
- package/Editor/UsercentricsPodfilePatches.cs.meta +11 -0
- package/Editor/UsercentricsSentryExcludePostBuild.cs +77 -0
- package/Editor/UsercentricsSentryExcludePostBuild.cs.meta +11 -0
- package/Editor/UsercentricsSentryGradleExclude.cs +189 -0
- package/Editor/UsercentricsSentryGradleExclude.cs.meta +11 -0
- package/Editor/UsercentricsWelcomeDialog.cs +76 -0
- package/Editor/UsercentricsWelcomeDialog.cs.meta +11 -0
- package/Editor.meta +8 -0
- package/Prefabs/ATTManager.prefab +47 -0
- package/Prefabs/ATTManager.prefab.meta +7 -0
- package/Prefabs/Usercentrics.prefab +74 -0
- package/Prefabs/Usercentrics.prefab.meta +7 -0
- package/Prefabs.meta +8 -0
- package/Scripts/AppTrackingTransparency/AppTrackingTransparencyManager.cs +59 -0
- package/Scripts/AppTrackingTransparency/AppTrackingTransparencyManager.cs.meta +11 -0
- package/Scripts/AppTrackingTransparency/Model/ATTLocalizationMessage.cs +15 -0
- package/Scripts/AppTrackingTransparency/Model/ATTLocalizationMessage.cs.meta +11 -0
- package/Scripts/AppTrackingTransparency/Model/AuthorizationStatus.cs +10 -0
- package/Scripts/AppTrackingTransparency/Model/AuthorizationStatus.cs.meta +11 -0
- package/Scripts/AppTrackingTransparency/Model/Language.cs +136 -0
- package/Scripts/AppTrackingTransparency/Model/Language.cs.meta +11 -0
- package/Scripts/AppTrackingTransparency/Model.meta +8 -0
- package/Scripts/AppTrackingTransparency.cs +60 -0
- package/Scripts/AppTrackingTransparency.cs.meta +11 -0
- package/Scripts/AppTrackingTransparency.meta +8 -0
- package/Scripts/Internal/AssemblyInfo.cs +3 -0
- package/Scripts/Internal/AssemblyInfo.cs.meta +11 -0
- package/Scripts/Internal/AutoInitialize.cs +42 -0
- package/Scripts/Internal/AutoInitialize.cs.meta +11 -0
- package/Scripts/Internal/BannerSettings.cs +165 -0
- package/Scripts/Internal/BannerSettings.cs.meta +11 -0
- package/Scripts/Internal/ConsentUpdateSubscriptionCoordinator.cs +42 -0
- package/Scripts/Internal/ConsentUpdateSubscriptionCoordinator.cs.meta +11 -0
- package/Scripts/Internal/Data.cs +960 -0
- package/Scripts/Internal/Data.cs.meta +11 -0
- package/Scripts/Internal/Errors.cs +22 -0
- package/Scripts/Internal/Errors.cs.meta +11 -0
- package/Scripts/Internal/FirstLayerStyleSettings.cs +248 -0
- package/Scripts/Internal/FirstLayerStyleSettings.cs.meta +11 -0
- package/Scripts/Internal/IUsercentrics.cs +45 -0
- package/Scripts/Internal/IUsercentrics.cs.meta +11 -0
- package/Scripts/Internal/InspectorLink.cs +27 -0
- package/Scripts/Internal/InspectorLink.cs.meta +11 -0
- package/Scripts/Internal/Singleton.cs +68 -0
- package/Scripts/Internal/Singleton.cs.meta +11 -0
- package/Scripts/Internal/StringParser.cs +41 -0
- package/Scripts/Internal/StringParser.cs.meta +11 -0
- package/Scripts/Internal/UCConstants.cs +13 -0
- package/Scripts/Internal/UCConstants.cs.meta +11 -0
- package/Scripts/Internal/UnityConsentModeAdapter.cs +78 -0
- package/Scripts/Internal/UnityConsentModeAdapter.cs.meta +11 -0
- package/Scripts/Internal/UsercentricsAndroid.cs +210 -0
- package/Scripts/Internal/UsercentricsAndroid.cs.meta +11 -0
- package/Scripts/Internal/UsercentricsIOS.cs +307 -0
- package/Scripts/Internal/UsercentricsIOS.cs.meta +11 -0
- package/Scripts/Internal.meta +8 -0
- package/Scripts/Unity.Usercentrics.asmdef +14 -0
- package/Scripts/Unity.Usercentrics.asmdef.meta +7 -0
- package/Scripts/Usercentrics.cs +1160 -0
- package/Scripts/Usercentrics.cs.meta +11 -0
- package/Scripts.meta +8 -0
- package/UsercentricsInstallGuard/Usercentrics.InstallGuard.Static.asmdef +16 -0
- package/UsercentricsInstallGuard/Usercentrics.InstallGuard.Static.asmdef.meta +7 -0
- package/UsercentricsInstallGuard/UsercentricsInstallGuard.cs +82 -0
- package/UsercentricsInstallGuard/UsercentricsInstallGuard.cs.meta +11 -0
- package/UsercentricsInstallGuard.meta +8 -0
- package/iOS/TrackingTransparencyManager.h +13 -0
- package/iOS/TrackingTransparencyManager.h.meta +27 -0
- package/iOS/TrackingTransparencyManager.mm +99 -0
- package/iOS/TrackingTransparencyManager.mm.meta +37 -0
- package/iOS/Usercentrics.mm +228 -0
- package/iOS/Usercentrics.mm.meta +37 -0
- package/iOS/UsercentricsATTManager.mm +21 -0
- package/iOS/UsercentricsATTManager.mm.meta +37 -0
- package/iOS.meta +8 -0
- package/link.xml +24 -0
- package/link.xml.meta +7 -0
- package/package.json +10 -4
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1,960 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine.Serialization;
|
|
4
|
+
|
|
5
|
+
namespace Unity.Usercentrics
|
|
6
|
+
{
|
|
7
|
+
#region UNITY LOCAL
|
|
8
|
+
|
|
9
|
+
[Serializable]
|
|
10
|
+
public class UsercentricsOptions
|
|
11
|
+
{
|
|
12
|
+
public string DefaultLanguage = "";
|
|
13
|
+
public string Version = "latest";
|
|
14
|
+
public bool DebugMode = true;
|
|
15
|
+
public long TimeoutMillis = 10000L;
|
|
16
|
+
public UsercentricsNetworkMode NetworkMode = UsercentricsNetworkMode.World;
|
|
17
|
+
public bool ConsentMediation = false;
|
|
18
|
+
public long InitTimeoutMillis = 10000L;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
/// Optional controllerId to inject at SDK initialization.
|
|
22
|
+
///
|
|
23
|
+
/// Use this to preserve user identity across login/logout flows that clear local consent
|
|
24
|
+
/// storage. Store the controllerId server-side after the first successful init, then pass
|
|
25
|
+
/// it here on every subsequent login. The SDK will skip generating a new ID and use this
|
|
26
|
+
/// value instead. It is persisted to local storage, so subsequent re-initializations
|
|
27
|
+
/// without this option continue to use it.
|
|
28
|
+
///
|
|
29
|
+
/// The value must be a 64-character lowercase hexadecimal string (the format produced
|
|
30
|
+
/// internally by the SDK). Invalid values are ignored with a warning log and the SDK
|
|
31
|
+
/// falls back to its normal ID resolution (stored -> generated).
|
|
32
|
+
/// </summary>
|
|
33
|
+
public string ControllerId = null;
|
|
34
|
+
|
|
35
|
+
public AndroidOptions Android = new AndroidOptions();
|
|
36
|
+
public UnityConsentModeOptions UnityConsentMode = new UnityConsentModeOptions();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[Serializable]
|
|
40
|
+
public class AndroidOptions
|
|
41
|
+
{
|
|
42
|
+
public bool DisableSystemBackButton = true;
|
|
43
|
+
public string StatusBarColor = "";
|
|
44
|
+
public bool ShowWindowInFullscreen = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// <summary>
|
|
48
|
+
/// Configuration for mapping Usercentrics consent decisions onto Unity's
|
|
49
|
+
/// EndUserConsent.SetConsentState API (Unity Vector). Opt-in only: this mapping
|
|
50
|
+
/// is never applied unless Enabled is explicitly set to true, and it is entirely
|
|
51
|
+
/// independent from the legacy Unity Ads privacy.consent/gdpr.consent mediation.
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Serializable]
|
|
54
|
+
public class UnityConsentModeOptions
|
|
55
|
+
{
|
|
56
|
+
public bool Enabled = false;
|
|
57
|
+
public List<string> AnalyticsCategorySlugs = new List<string>();
|
|
58
|
+
public List<string> AdsCategorySlugs = new List<string>();
|
|
59
|
+
}
|
|
60
|
+
#endregion
|
|
61
|
+
|
|
62
|
+
[Serializable]
|
|
63
|
+
public class UsercentricsOptionsInternal
|
|
64
|
+
{
|
|
65
|
+
public string settingsId;
|
|
66
|
+
public string ruleSetId;
|
|
67
|
+
public string defaultLanguage;
|
|
68
|
+
public string version;
|
|
69
|
+
public long timeoutMillis;
|
|
70
|
+
public UsercentricsLoggerLevel loggerLevel;
|
|
71
|
+
public UsercentricsNetworkMode networkMode;
|
|
72
|
+
public bool consentMediation;
|
|
73
|
+
public long initTimeoutMillis;
|
|
74
|
+
public string controllerId;
|
|
75
|
+
|
|
76
|
+
public static UsercentricsOptionsInternal CreateFrom(UsercentricsOptions unityOptions, string settingsId, string ruleSetId)
|
|
77
|
+
{
|
|
78
|
+
var userOptions = new UsercentricsOptionsInternal();
|
|
79
|
+
userOptions.settingsId = settingsId;
|
|
80
|
+
userOptions.ruleSetId = ruleSetId;
|
|
81
|
+
userOptions.defaultLanguage = unityOptions.DefaultLanguage;
|
|
82
|
+
userOptions.version = unityOptions.Version;
|
|
83
|
+
userOptions.timeoutMillis = unityOptions.TimeoutMillis;
|
|
84
|
+
userOptions.loggerLevel = unityOptions.DebugMode ? UsercentricsLoggerLevel.Debug : UsercentricsLoggerLevel.None;
|
|
85
|
+
userOptions.networkMode = unityOptions.NetworkMode;
|
|
86
|
+
userOptions.consentMediation = unityOptions.ConsentMediation;
|
|
87
|
+
userOptions.initTimeoutMillis = unityOptions.InitTimeoutMillis;
|
|
88
|
+
userOptions.controllerId = unityOptions.ControllerId;
|
|
89
|
+
return userOptions;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[Serializable]
|
|
94
|
+
public enum UsercentricsLoggerLevel
|
|
95
|
+
{
|
|
96
|
+
None,
|
|
97
|
+
Error,
|
|
98
|
+
Warning,
|
|
99
|
+
Debug
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
[Serializable]
|
|
103
|
+
public enum UsercentricsNetworkMode
|
|
104
|
+
{
|
|
105
|
+
World,
|
|
106
|
+
EU
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[Serializable]
|
|
110
|
+
public class UsercentricsReadyStatus
|
|
111
|
+
{
|
|
112
|
+
public bool shouldCollectConsent;
|
|
113
|
+
public List<UsercentricsServiceConsent> consents;
|
|
114
|
+
public GeolocationRuleset geolocationRuleset;
|
|
115
|
+
public UsercentricsLocation location;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[Serializable]
|
|
119
|
+
public class UsercentricsServiceConsent
|
|
120
|
+
{
|
|
121
|
+
public string templateId;
|
|
122
|
+
public bool status;
|
|
123
|
+
public List<UsercentricsConsentHistoryEntry> history;
|
|
124
|
+
public string dataProcessor;
|
|
125
|
+
public string version;
|
|
126
|
+
public bool isEssential;
|
|
127
|
+
public string _type;
|
|
128
|
+
public string category;
|
|
129
|
+
public bool isExempt;
|
|
130
|
+
|
|
131
|
+
public UsercentricsConsentType? type
|
|
132
|
+
{
|
|
133
|
+
get
|
|
134
|
+
{
|
|
135
|
+
var intValue = StringParser.ToInt(_type);
|
|
136
|
+
if (intValue == null)
|
|
137
|
+
{
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
return (UsercentricsConsentType) intValue;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[Serializable]
|
|
146
|
+
public class UsercentricsConsentHistoryEntry
|
|
147
|
+
{
|
|
148
|
+
public bool status;
|
|
149
|
+
public UsercentricsConsentType type;
|
|
150
|
+
public long timestampInMillis;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[Serializable]
|
|
154
|
+
public enum UsercentricsConsentType
|
|
155
|
+
{
|
|
156
|
+
Explicit,
|
|
157
|
+
Implicit
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[Serializable]
|
|
161
|
+
public class UsercentricsConsentUserResponse
|
|
162
|
+
{
|
|
163
|
+
public UsercentricsUserInteraction userInteraction;
|
|
164
|
+
public List<UsercentricsServiceConsent> consents;
|
|
165
|
+
public string controllerId;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[Serializable]
|
|
169
|
+
public enum UsercentricsUserInteraction
|
|
170
|
+
{
|
|
171
|
+
AcceptAll,
|
|
172
|
+
DenyAll,
|
|
173
|
+
Granular,
|
|
174
|
+
NoInteraction
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[Serializable]
|
|
178
|
+
public class TCFData
|
|
179
|
+
{
|
|
180
|
+
public List<TCFFeature> features;
|
|
181
|
+
public List<TCFPurpose> purposes;
|
|
182
|
+
public List<TCFSpecialFeature> specialFeatures;
|
|
183
|
+
public List<TCFSpecialPurpose> specialPurposes;
|
|
184
|
+
public List<TCFStack> stacks;
|
|
185
|
+
public List<TCFVendor> vendors;
|
|
186
|
+
public string tcString;
|
|
187
|
+
public TCF2ConsentOrPaySettings consentOrPay;
|
|
188
|
+
// IAB-mandated standard text for the Features category (TCF 2.4), sourced from the GVL.
|
|
189
|
+
public string featuresStandardText;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[Serializable]
|
|
193
|
+
public class TCF2ConsentOrPaySettings
|
|
194
|
+
{
|
|
195
|
+
public bool enableConsentOrPay = false;
|
|
196
|
+
public bool showTogglesForVendors = true;
|
|
197
|
+
public List<string> publisherRestrictions = new List<string>();
|
|
198
|
+
public List<string> specialFeatures = new List<string>();
|
|
199
|
+
// PL-5714: new restriction format — prefers these when non-null over publisherRestrictions/specialFeatures
|
|
200
|
+
public List<ConsentOrPayRestriction> changedPurposesConsentOrPay = new List<ConsentOrPayRestriction>();
|
|
201
|
+
public List<ConsentOrPayRestriction> specialFeaturesConsentOrPay = new List<ConsentOrPayRestriction>();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
[Serializable]
|
|
205
|
+
public class ConsentOrPayRestriction
|
|
206
|
+
{
|
|
207
|
+
public int id;
|
|
208
|
+
public string value;
|
|
209
|
+
|
|
210
|
+
public bool IsFlexible() => value != null && value.Equals("FLEXIBLE", System.StringComparison.OrdinalIgnoreCase);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[Serializable]
|
|
214
|
+
public class TCFFeature
|
|
215
|
+
{
|
|
216
|
+
public string purposeDescription;
|
|
217
|
+
public string descriptionLegal;
|
|
218
|
+
public int id;
|
|
219
|
+
public string name;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[Serializable]
|
|
223
|
+
public class TCFPurpose
|
|
224
|
+
{
|
|
225
|
+
public string purposeDescription;
|
|
226
|
+
public string descriptionLegal;
|
|
227
|
+
public List<string> illustrations;
|
|
228
|
+
public int id;
|
|
229
|
+
public string name;
|
|
230
|
+
public bool isPartOfASelectedStack;
|
|
231
|
+
public bool showConsentToggle;
|
|
232
|
+
public bool showLegitimateInterestToggle;
|
|
233
|
+
public string _consent;
|
|
234
|
+
public string _legitimateInterestConsent;
|
|
235
|
+
public string _stackId;
|
|
236
|
+
|
|
237
|
+
public bool? consent
|
|
238
|
+
{
|
|
239
|
+
get
|
|
240
|
+
{
|
|
241
|
+
return StringParser.ToBool(_consent);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
public bool? legitimateInterestConsent
|
|
246
|
+
{
|
|
247
|
+
get
|
|
248
|
+
{
|
|
249
|
+
return StringParser.ToBool(_legitimateInterestConsent);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
public int? stackId
|
|
254
|
+
{
|
|
255
|
+
get
|
|
256
|
+
{
|
|
257
|
+
return StringParser.ToInt(_stackId);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
[Serializable]
|
|
263
|
+
public class TCFSpecialFeature
|
|
264
|
+
{
|
|
265
|
+
public string purposeDescription;
|
|
266
|
+
public string descriptionLegal;
|
|
267
|
+
public List<string> illustrations;
|
|
268
|
+
public int id;
|
|
269
|
+
public string name;
|
|
270
|
+
public bool isPartOfASelectedStack;
|
|
271
|
+
public bool showConsentToggle;
|
|
272
|
+
public string _consent;
|
|
273
|
+
public string _stackId;
|
|
274
|
+
|
|
275
|
+
public bool? consent
|
|
276
|
+
{
|
|
277
|
+
get
|
|
278
|
+
{
|
|
279
|
+
return StringParser.ToBool(_consent);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public int? stackId
|
|
284
|
+
{
|
|
285
|
+
get
|
|
286
|
+
{
|
|
287
|
+
return StringParser.ToInt(_stackId);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
[Serializable]
|
|
293
|
+
public class TCFSpecialPurpose
|
|
294
|
+
{
|
|
295
|
+
public string purposeDescription;
|
|
296
|
+
public string descriptionLegal;
|
|
297
|
+
public int id;
|
|
298
|
+
public string name;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
[Serializable]
|
|
302
|
+
public class TCFStack
|
|
303
|
+
{
|
|
304
|
+
public string description;
|
|
305
|
+
public int id;
|
|
306
|
+
public string name;
|
|
307
|
+
public List<int> purposeIds;
|
|
308
|
+
public List<int> specialFeatureIds;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
[Serializable]
|
|
312
|
+
public class TCFVendor
|
|
313
|
+
{
|
|
314
|
+
public List<IdAndName> features;
|
|
315
|
+
public List<IdAndName> flexiblePurposes;
|
|
316
|
+
public int id;
|
|
317
|
+
public List<IdAndName> legitimateInterestPurposes;
|
|
318
|
+
public string name;
|
|
319
|
+
public string policyUrl;
|
|
320
|
+
public List<IdAndName> purposes;
|
|
321
|
+
public List<TCFVendorRestriction> restrictions;
|
|
322
|
+
public List<IdAndName> specialFeatures;
|
|
323
|
+
public List<IdAndName> specialPurposes;
|
|
324
|
+
public bool showConsentToggle;
|
|
325
|
+
public bool showLegitimateInterestToggle;
|
|
326
|
+
public bool usesNonCookieAccess;
|
|
327
|
+
public string deviceStorageDisclosureUrl = null;
|
|
328
|
+
public bool usesCookies = false;
|
|
329
|
+
public bool cookieRefresh;
|
|
330
|
+
public bool dataSharedOutsideEU;
|
|
331
|
+
public DataRetention dataRetention = null;
|
|
332
|
+
public List<IdAndName> dataCategories;
|
|
333
|
+
public List<VendorUrl> vendorUrls;
|
|
334
|
+
public string _consent;
|
|
335
|
+
public string _legitimateInterestConsent;
|
|
336
|
+
public string _cookieMaxAgeSeconds;
|
|
337
|
+
|
|
338
|
+
public bool? consent
|
|
339
|
+
{
|
|
340
|
+
get
|
|
341
|
+
{
|
|
342
|
+
return StringParser.ToBool(_consent);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
public bool? legitimateInterestConsent
|
|
347
|
+
{
|
|
348
|
+
get
|
|
349
|
+
{
|
|
350
|
+
return StringParser.ToBool(_legitimateInterestConsent);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
public double? cookieMaxAgeSeconds
|
|
355
|
+
{
|
|
356
|
+
get
|
|
357
|
+
{
|
|
358
|
+
return StringParser.ToDouble(_cookieMaxAgeSeconds);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
[Serializable]
|
|
364
|
+
public class IdAndName
|
|
365
|
+
{
|
|
366
|
+
public int id;
|
|
367
|
+
public string name;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
[Serializable]
|
|
371
|
+
public class TCFVendorRestriction
|
|
372
|
+
{
|
|
373
|
+
public int purposeId;
|
|
374
|
+
public RestrictionType restrictionType;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
[Serializable]
|
|
378
|
+
public enum RestrictionType
|
|
379
|
+
{
|
|
380
|
+
NotAllowed,
|
|
381
|
+
RequireConsent,
|
|
382
|
+
RequireLi
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
[Serializable]
|
|
386
|
+
public class DataRetention
|
|
387
|
+
{
|
|
388
|
+
public RetentionPeriod purposes;
|
|
389
|
+
public RetentionPeriod specialPurposes;
|
|
390
|
+
public String _stdRetention;
|
|
391
|
+
|
|
392
|
+
public int? stdRetention
|
|
393
|
+
{
|
|
394
|
+
get
|
|
395
|
+
{
|
|
396
|
+
return StringParser.ToInt(_stdRetention);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
[Serializable]
|
|
402
|
+
public class RetentionPeriod
|
|
403
|
+
{
|
|
404
|
+
public Dictionary<int, int> idAndPeriod;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
[Serializable]
|
|
408
|
+
public class VendorUrl
|
|
409
|
+
{
|
|
410
|
+
public string langId = null;
|
|
411
|
+
public string privacy = null;
|
|
412
|
+
public string legIntClaim = null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
[Serializable]
|
|
416
|
+
public class UsercentricsUpdatedConsentEvent
|
|
417
|
+
{
|
|
418
|
+
public List<UsercentricsServiceConsent> consents;
|
|
419
|
+
public string controllerId;
|
|
420
|
+
public string tcString = null;
|
|
421
|
+
public string uspString = null;
|
|
422
|
+
public string acString = null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
[Serializable]
|
|
426
|
+
public class CCPAData
|
|
427
|
+
{
|
|
428
|
+
public int version = 1;
|
|
429
|
+
public bool noticeGiven = false;
|
|
430
|
+
public bool optedOut = false;
|
|
431
|
+
public bool lspact = false;
|
|
432
|
+
public string uspString = null;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
[Serializable]
|
|
436
|
+
public class FirstLayerSettings
|
|
437
|
+
{
|
|
438
|
+
public string title;
|
|
439
|
+
public string description;
|
|
440
|
+
public string additionalInfo;
|
|
441
|
+
public string resurfaceNote;
|
|
442
|
+
public string vendorListLinkTitle;
|
|
443
|
+
public string manageSettingsLinkTitle;
|
|
444
|
+
public string purposesLabel;
|
|
445
|
+
public string featuresLabel;
|
|
446
|
+
public string acceptAllButton;
|
|
447
|
+
public string denyAllButton;
|
|
448
|
+
public string saveButton;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
[Serializable]
|
|
452
|
+
public enum UsercentricsAnalyticsEventType
|
|
453
|
+
{
|
|
454
|
+
CmpShown,
|
|
455
|
+
AcceptAllFirstLayer,
|
|
456
|
+
DenyAllFirstLayer,
|
|
457
|
+
SaveFirstLayer,
|
|
458
|
+
AcceptAllSecondLayer,
|
|
459
|
+
DenyAllSecondLayer,
|
|
460
|
+
SaveSecondLayer,
|
|
461
|
+
ImprintLink,
|
|
462
|
+
MoreInformationLink,
|
|
463
|
+
PrivacyPolicyLink,
|
|
464
|
+
CcpaTogglesOn,
|
|
465
|
+
CcpaTogglesOff,
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
[Serializable]
|
|
469
|
+
public enum PublishedAppPlatform
|
|
470
|
+
{
|
|
471
|
+
Android,
|
|
472
|
+
Ios
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/// <summary>
|
|
476
|
+
/// Tab of the Second Layer that can be opened directly.
|
|
477
|
+
/// A tab the layout does not have opens the default tab.
|
|
478
|
+
/// </summary>
|
|
479
|
+
public enum SecondLayerTab
|
|
480
|
+
{
|
|
481
|
+
Services,
|
|
482
|
+
Partners
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
[Serializable]
|
|
486
|
+
public enum UsercentricsVariant
|
|
487
|
+
{
|
|
488
|
+
Default,
|
|
489
|
+
CCPA,
|
|
490
|
+
TCF
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
[Serializable]
|
|
494
|
+
public class PublishedApp
|
|
495
|
+
{
|
|
496
|
+
public string bundleId;
|
|
497
|
+
public PublishedAppPlatform platform;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
[Serializable]
|
|
501
|
+
public class UsercentricsLocation
|
|
502
|
+
{
|
|
503
|
+
public string countryCode;
|
|
504
|
+
public string regionCode;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
[Serializable]
|
|
508
|
+
public class CmpData
|
|
509
|
+
{
|
|
510
|
+
public UsercentricsVariant activeVariant;
|
|
511
|
+
public List<PublishedApp> publishedApps;
|
|
512
|
+
public UsercentricsLocation userLocation;
|
|
513
|
+
public List<UsercentricsService> services;
|
|
514
|
+
public List<LegalBasisLocalizationEntry> legalBasis;
|
|
515
|
+
public List<UsercentricsCategory> categories;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
[Serializable]
|
|
519
|
+
public class LegalBasisLocalizationEntry
|
|
520
|
+
{
|
|
521
|
+
public string key;
|
|
522
|
+
public string value;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
[Serializable]
|
|
526
|
+
public class UsercentricsService
|
|
527
|
+
{
|
|
528
|
+
public string templateId;
|
|
529
|
+
public string version;
|
|
530
|
+
public string dataProcessor;
|
|
531
|
+
public string nameOfProcessingCompany;
|
|
532
|
+
public string descriptionOfService;
|
|
533
|
+
public List<string> dataPurposes;
|
|
534
|
+
public List<string> dataCollectedList;
|
|
535
|
+
public List<string> dataPurposesList;
|
|
536
|
+
public List<string> dataRecipientsList;
|
|
537
|
+
public List<string> legalBasisList;
|
|
538
|
+
public List<string> retentionPeriodList;
|
|
539
|
+
public string legalGround;
|
|
540
|
+
public string privacyPolicyURL;
|
|
541
|
+
public string retentionPeriodDescription;
|
|
542
|
+
public string defaultCategorySlug;
|
|
543
|
+
public string linkToDpa;
|
|
544
|
+
public string locationOfProcessing;
|
|
545
|
+
public string thirdCountryTransfer;
|
|
546
|
+
public string dataProtectionOfficer;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
[Serializable]
|
|
550
|
+
public class UsercentricsCategory
|
|
551
|
+
{
|
|
552
|
+
public string categorySlug;
|
|
553
|
+
public string label;
|
|
554
|
+
public string description;
|
|
555
|
+
public bool isEssential;
|
|
556
|
+
public bool isHidden;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
[Serializable]
|
|
560
|
+
public class UsercentricsMediationEvent
|
|
561
|
+
{
|
|
562
|
+
public List<ConsentApplied> applied;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
[Serializable]
|
|
566
|
+
public class ConsentApplied
|
|
567
|
+
{
|
|
568
|
+
public string name;
|
|
569
|
+
public string templateId;
|
|
570
|
+
public bool consent = false;
|
|
571
|
+
public bool mediated = false;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
[Serializable]
|
|
575
|
+
public class AdditionalConsentModeData
|
|
576
|
+
{
|
|
577
|
+
public string acString;
|
|
578
|
+
public List<AdTechProvider> adTechProviders;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
[Serializable]
|
|
582
|
+
public class AdTechProvider
|
|
583
|
+
{
|
|
584
|
+
public int id;
|
|
585
|
+
public string name;
|
|
586
|
+
public string privacyPolicyUrl;
|
|
587
|
+
public bool consent;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
[Serializable]
|
|
591
|
+
internal class UsercentricsConsentsHolder
|
|
592
|
+
{
|
|
593
|
+
public List<UsercentricsServiceConsent> consents;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
[Serializable]
|
|
597
|
+
public class GeolocationRuleset
|
|
598
|
+
{
|
|
599
|
+
public String activeSettingsId;
|
|
600
|
+
public bool bannerRequiredAtLocation;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
[Serializable]
|
|
604
|
+
internal class UsercentricsIntegerListHolder
|
|
605
|
+
{
|
|
606
|
+
public int[] list;
|
|
607
|
+
|
|
608
|
+
internal UsercentricsIntegerListHolder(int[] list)
|
|
609
|
+
{
|
|
610
|
+
this.list = list;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
[Serializable]
|
|
615
|
+
public class UsercentricsUserDecision
|
|
616
|
+
{
|
|
617
|
+
public string serviceId;
|
|
618
|
+
public bool consent;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
[Serializable]
|
|
622
|
+
public class UsercentricsUserDecisionListWrapper
|
|
623
|
+
{
|
|
624
|
+
public List<UsercentricsUserDecision> decisions;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
[Serializable]
|
|
628
|
+
public class UsercentricsServiceConsentWrapper
|
|
629
|
+
{
|
|
630
|
+
public List<UsercentricsServiceConsent> consents;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
[Serializable]
|
|
634
|
+
public class GppData
|
|
635
|
+
{
|
|
636
|
+
public string gppString;
|
|
637
|
+
public List<int> applicableSections;
|
|
638
|
+
public string sections;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
[Serializable]
|
|
642
|
+
public class GppSectionChangeEvent
|
|
643
|
+
{
|
|
644
|
+
public string data;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
[Serializable]
|
|
648
|
+
public class SetGPPConsentArgs
|
|
649
|
+
{
|
|
650
|
+
public string sectionName;
|
|
651
|
+
public string fieldName;
|
|
652
|
+
public string value;
|
|
653
|
+
|
|
654
|
+
public SetGPPConsentArgs(string sectionName, string fieldName, string value)
|
|
655
|
+
{
|
|
656
|
+
this.sectionName = sectionName;
|
|
657
|
+
this.fieldName = fieldName;
|
|
658
|
+
this.value = value;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
#region AGE SIGNALS (EXPERIMENTAL)
|
|
663
|
+
// MSDK-4778. The age signals API is experimental: it may change or be removed in any release.
|
|
664
|
+
|
|
665
|
+
/// <summary>
|
|
666
|
+
/// EXPERIMENTAL (MSDK-4778). Where an age signal comes from.
|
|
667
|
+
/// </summary>
|
|
668
|
+
public enum UsercentricsAgeSignalSource
|
|
669
|
+
{
|
|
670
|
+
/// <summary>Apple DeclaredAgeRange framework (iOS 26+).</summary>
|
|
671
|
+
AppleDeclaredAgeRange,
|
|
672
|
+
|
|
673
|
+
/// <summary>Google Play Age Signals API (Android 6.0+, Play-distributed builds).</summary>
|
|
674
|
+
GooglePlayAgeSignals,
|
|
675
|
+
|
|
676
|
+
/// <summary>
|
|
677
|
+
/// The host app (the publisher) provided the age itself, through SetAgeSignal.
|
|
678
|
+
/// No platform vouches for it and the SDK cannot check it.
|
|
679
|
+
/// </summary>
|
|
680
|
+
PublisherProvided
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/// <summary>
|
|
684
|
+
/// EXPERIMENTAL (MSDK-4778). How trustworthy the age behind a signal is.
|
|
685
|
+
/// A successful platform call is not proof of age: both Apple and Google can answer with a plain
|
|
686
|
+
/// self-declared range, so branch on this value.
|
|
687
|
+
/// </summary>
|
|
688
|
+
public enum UsercentricsAgeSignalTrust
|
|
689
|
+
{
|
|
690
|
+
/// <summary>The person declared their own age.</summary>
|
|
691
|
+
SelfDeclared,
|
|
692
|
+
|
|
693
|
+
/// <summary>A parent or guardian set the age.</summary>
|
|
694
|
+
GuardianDeclared,
|
|
695
|
+
|
|
696
|
+
/// <summary>The age was checked by the platform (government ID, payment method or another method).</summary>
|
|
697
|
+
Verified,
|
|
698
|
+
|
|
699
|
+
/// <summary>
|
|
700
|
+
/// The host app (the publisher) declared the age itself, through SetAgeSignal.
|
|
701
|
+
/// It is never Verified: neither the SDK nor a platform checked it, so it is only as good as the
|
|
702
|
+
/// host's own age gate.
|
|
703
|
+
/// </summary>
|
|
704
|
+
PublisherProvided
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/// <summary>
|
|
708
|
+
/// EXPERIMENTAL (MSDK-4778). The age band a signal resolves to.
|
|
709
|
+
/// </summary>
|
|
710
|
+
public enum UsercentricsAgeBand
|
|
711
|
+
{
|
|
712
|
+
/// <summary>Below the minimum age.</summary>
|
|
713
|
+
BelowMinimum,
|
|
714
|
+
|
|
715
|
+
/// <summary>At or above the minimum age but not (provably) an adult.</summary>
|
|
716
|
+
Minor,
|
|
717
|
+
|
|
718
|
+
/// <summary>An adult.</summary>
|
|
719
|
+
Standard
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/// <summary>
|
|
723
|
+
/// EXPERIMENTAL (MSDK-4778). Why no age band is available.
|
|
724
|
+
/// This is not a hard failure: fall back to your default behaviour.
|
|
725
|
+
/// </summary>
|
|
726
|
+
public enum UsercentricsAgeSignalUnavailableReason
|
|
727
|
+
{
|
|
728
|
+
/// <summary>The person (or the parent) declined to share the age range.</summary>
|
|
729
|
+
Declined,
|
|
730
|
+
|
|
731
|
+
/// <summary>The age range is not shared with this app (user setting, region not covered yet, or no age on record).</summary>
|
|
732
|
+
NotShared,
|
|
733
|
+
|
|
734
|
+
/// <summary>The person must verify their age in the store before a signal can be shared (mandated regions).</summary>
|
|
735
|
+
VerificationRequired,
|
|
736
|
+
|
|
737
|
+
/// <summary>The OS version, the device, or an optional dependency does not support the API.</summary>
|
|
738
|
+
Unsupported,
|
|
739
|
+
|
|
740
|
+
/// <summary>The platform service is not reachable here (no Play Store, app not installed by Play, API off, etc.).</summary>
|
|
741
|
+
NotAvailable,
|
|
742
|
+
|
|
743
|
+
/// <summary>The platform rejected the request (for Apple, typically a missing entitlement or invalid age gates).</summary>
|
|
744
|
+
InvalidRequest,
|
|
745
|
+
|
|
746
|
+
/// <summary>A temporary failure (network, service busy). Calling again later may succeed.</summary>
|
|
747
|
+
TransientError,
|
|
748
|
+
|
|
749
|
+
/// <summary>The platform did not answer in time.</summary>
|
|
750
|
+
Timeout,
|
|
751
|
+
|
|
752
|
+
/// <summary>Any other error.</summary>
|
|
753
|
+
Error
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/// <summary>
|
|
757
|
+
/// EXPERIMENTAL (MSDK-4778, signal receiver mode). An age range the host app (the publisher) already
|
|
758
|
+
/// knows about its user, to hand to Usercentrics.Instance.SetAgeSignal.
|
|
759
|
+
///
|
|
760
|
+
/// Build it with AtLeast, Below or Between. The factories never throw: the range is checked by the
|
|
761
|
+
/// native SDK when it is handed over, and one that is not valid comes back through the error callback of
|
|
762
|
+
/// SetAgeSignal.
|
|
763
|
+
///
|
|
764
|
+
/// The optional sourceLabel names where the host got the age from (for example "my-age-gate"). It is
|
|
765
|
+
/// written to the native SDK logger and handed to the age signal engine, and goes nowhere else. It must be
|
|
766
|
+
/// 1 to 32 characters of A-Z, a-z, 0-9, '.', '_' or '-': no personal data.
|
|
767
|
+
///
|
|
768
|
+
/// The band follows the lower age, and a signal without one counts it as 0: AtLeast and Between resolve to
|
|
769
|
+
/// the band of their lower age, and Below always resolves to the lowest band, because it gives an upper age only.
|
|
770
|
+
///
|
|
771
|
+
/// A signal carries no trust level. The SDK always tags it PublisherProvided, so a host cannot present its
|
|
772
|
+
/// own flag as one that a platform verified.
|
|
773
|
+
/// </summary>
|
|
774
|
+
public sealed class UsercentricsPublisherAgeSignal
|
|
775
|
+
{
|
|
776
|
+
private readonly string kind;
|
|
777
|
+
private readonly int age;
|
|
778
|
+
private readonly int lower;
|
|
779
|
+
private readonly int upper;
|
|
780
|
+
private readonly string sourceLabel;
|
|
781
|
+
|
|
782
|
+
private UsercentricsPublisherAgeSignal(string kind, int age, int lower, int upper, string sourceLabel)
|
|
783
|
+
{
|
|
784
|
+
this.kind = kind;
|
|
785
|
+
this.age = age;
|
|
786
|
+
this.lower = lower;
|
|
787
|
+
this.upper = upper;
|
|
788
|
+
this.sourceLabel = sourceLabel;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/// <summary>The person is age or older, for example AtLeast(16) for a "16+" flag. No upper age is known.</summary>
|
|
792
|
+
public static UsercentricsPublisherAgeSignal AtLeast(int age, string sourceLabel = null)
|
|
793
|
+
{
|
|
794
|
+
return new UsercentricsPublisherAgeSignal(UsercentricsAgeSignalRequest.KindAtLeast, age, 0, 0, sourceLabel);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/// <summary>The person is younger than age, for example Below(16) for an "under 16" flag. No lower age is known.</summary>
|
|
798
|
+
public static UsercentricsPublisherAgeSignal Below(int age, string sourceLabel = null)
|
|
799
|
+
{
|
|
800
|
+
return new UsercentricsPublisherAgeSignal(UsercentricsAgeSignalRequest.KindBelow, age, 0, 0, sourceLabel);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/// <summary>The person is between lower and upper years old, both included, for example Between(13, 15).</summary>
|
|
804
|
+
public static UsercentricsPublisherAgeSignal Between(int lower, int upper, string sourceLabel = null)
|
|
805
|
+
{
|
|
806
|
+
return new UsercentricsPublisherAgeSignal(UsercentricsAgeSignalRequest.KindBetween, 0, lower, upper, sourceLabel);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
internal UsercentricsAgeSignalRequest ToRequest()
|
|
810
|
+
{
|
|
811
|
+
return new UsercentricsAgeSignalRequest
|
|
812
|
+
{
|
|
813
|
+
kind = kind,
|
|
814
|
+
age = age,
|
|
815
|
+
lower = lower,
|
|
816
|
+
upper = upper,
|
|
817
|
+
hasSourceLabel = sourceLabel != null,
|
|
818
|
+
sourceLabel = sourceLabel ?? ""
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/// <summary>
|
|
824
|
+
/// What goes over the bridge for a UsercentricsPublisherAgeSignal. JsonUtility writes every field and has
|
|
825
|
+
/// no null, so the ages that the kind does not use are 0, and hasSourceLabel tells "no label" from an empty
|
|
826
|
+
/// one (which the native SDK refuses). The names are the ones of UnityAgeSignalRequest in the native SDK.
|
|
827
|
+
/// </summary>
|
|
828
|
+
[Serializable]
|
|
829
|
+
internal class UsercentricsAgeSignalRequest
|
|
830
|
+
{
|
|
831
|
+
public const string KindAtLeast = "atLeast";
|
|
832
|
+
public const string KindBelow = "below";
|
|
833
|
+
public const string KindBetween = "between";
|
|
834
|
+
|
|
835
|
+
public string kind;
|
|
836
|
+
public int age;
|
|
837
|
+
public int lower;
|
|
838
|
+
public int upper;
|
|
839
|
+
public bool hasSourceLabel;
|
|
840
|
+
public string sourceLabel;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/// <summary>
|
|
844
|
+
/// EXPERIMENTAL (MSDK-4778). The outcome of an age signal request.
|
|
845
|
+
///
|
|
846
|
+
/// The values of the enums and the ages can be absent (null): a decision without a band is "no signal"
|
|
847
|
+
/// (see unavailableReason), never an adult. Only Standard is an adult, so test band == Standard:
|
|
848
|
+
/// band != Minor would take both a missing signal and a child below the minimum age for one.
|
|
849
|
+
///
|
|
850
|
+
/// Do not log or report the decision as it is: it carries the age range. Read ageLower and ageUpper only
|
|
851
|
+
/// where the range is needed.
|
|
852
|
+
/// </summary>
|
|
853
|
+
[Serializable]
|
|
854
|
+
public class UsercentricsAgeSignalDecision
|
|
855
|
+
{
|
|
856
|
+
// What the native SDK sends: the name of the enum (for example "PUBLISHER_PROVIDED"), the digits of
|
|
857
|
+
// an age, or the string "null" when the SDK left the value out. The properties below read them.
|
|
858
|
+
public string _source;
|
|
859
|
+
public string _trust;
|
|
860
|
+
public string _band;
|
|
861
|
+
public string _ageLower;
|
|
862
|
+
public string _ageUpper;
|
|
863
|
+
public string _unavailableReason;
|
|
864
|
+
|
|
865
|
+
/// <summary>Where the signal comes from. Null only if the native SDK sends a source that this plugin does not know.</summary>
|
|
866
|
+
public UsercentricsAgeSignalSource? source
|
|
867
|
+
{
|
|
868
|
+
get
|
|
869
|
+
{
|
|
870
|
+
switch (_source)
|
|
871
|
+
{
|
|
872
|
+
case "APPLE_DECLARED_AGE_RANGE": return UsercentricsAgeSignalSource.AppleDeclaredAgeRange;
|
|
873
|
+
case "GOOGLE_PLAY_AGE_SIGNALS": return UsercentricsAgeSignalSource.GooglePlayAgeSignals;
|
|
874
|
+
case "PUBLISHER_PROVIDED": return UsercentricsAgeSignalSource.PublisherProvided;
|
|
875
|
+
default: return null;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/// <summary>How the age was established, or null when there is no band.</summary>
|
|
881
|
+
public UsercentricsAgeSignalTrust? trust
|
|
882
|
+
{
|
|
883
|
+
get
|
|
884
|
+
{
|
|
885
|
+
switch (_trust)
|
|
886
|
+
{
|
|
887
|
+
case "SELF_DECLARED": return UsercentricsAgeSignalTrust.SelfDeclared;
|
|
888
|
+
case "GUARDIAN_DECLARED": return UsercentricsAgeSignalTrust.GuardianDeclared;
|
|
889
|
+
case "VERIFIED": return UsercentricsAgeSignalTrust.Verified;
|
|
890
|
+
case "PUBLISHER_PROVIDED": return UsercentricsAgeSignalTrust.PublisherProvided;
|
|
891
|
+
default: return null;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/// <summary>The resolved band, or null when no signal is available (see unavailableReason).</summary>
|
|
897
|
+
public UsercentricsAgeBand? band
|
|
898
|
+
{
|
|
899
|
+
get
|
|
900
|
+
{
|
|
901
|
+
switch (_band)
|
|
902
|
+
{
|
|
903
|
+
case "BELOW_MINIMUM": return UsercentricsAgeBand.BelowMinimum;
|
|
904
|
+
case "MINOR": return UsercentricsAgeBand.Minor;
|
|
905
|
+
case "STANDARD": return UsercentricsAgeBand.Standard;
|
|
906
|
+
default: return null;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/// <summary>Inclusive lower bound of the age range, when available.</summary>
|
|
912
|
+
public int? ageLower
|
|
913
|
+
{
|
|
914
|
+
get
|
|
915
|
+
{
|
|
916
|
+
return StringParser.ToInt(_ageLower);
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/// <summary>Inclusive upper bound of the age range, or null for an open-ended top range (for example 18+).</summary>
|
|
921
|
+
public int? ageUpper
|
|
922
|
+
{
|
|
923
|
+
get
|
|
924
|
+
{
|
|
925
|
+
return StringParser.ToInt(_ageUpper);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/// <summary>Why there is no band, or null when there is one.</summary>
|
|
930
|
+
public UsercentricsAgeSignalUnavailableReason? unavailableReason
|
|
931
|
+
{
|
|
932
|
+
get
|
|
933
|
+
{
|
|
934
|
+
switch (_unavailableReason)
|
|
935
|
+
{
|
|
936
|
+
case "DECLINED": return UsercentricsAgeSignalUnavailableReason.Declined;
|
|
937
|
+
case "NOT_SHARED": return UsercentricsAgeSignalUnavailableReason.NotShared;
|
|
938
|
+
case "VERIFICATION_REQUIRED": return UsercentricsAgeSignalUnavailableReason.VerificationRequired;
|
|
939
|
+
case "UNSUPPORTED": return UsercentricsAgeSignalUnavailableReason.Unsupported;
|
|
940
|
+
case "NOT_AVAILABLE": return UsercentricsAgeSignalUnavailableReason.NotAvailable;
|
|
941
|
+
case "INVALID_REQUEST": return UsercentricsAgeSignalUnavailableReason.InvalidRequest;
|
|
942
|
+
case "TRANSIENT_ERROR": return UsercentricsAgeSignalUnavailableReason.TransientError;
|
|
943
|
+
case "TIMEOUT": return UsercentricsAgeSignalUnavailableReason.Timeout;
|
|
944
|
+
case "ERROR": return UsercentricsAgeSignalUnavailableReason.Error;
|
|
945
|
+
default: return null;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/// <summary>True when a band was resolved. False is "no signal", not "adult".</summary>
|
|
951
|
+
public bool isAvailable
|
|
952
|
+
{
|
|
953
|
+
get
|
|
954
|
+
{
|
|
955
|
+
return band != null;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
#endregion
|
|
960
|
+
}
|