Skip to content

Commit 4dbba6a

Browse files
authored
Merge pull request #74 from SourcePointUSA/develop
Release 3.2.0
2 parents 0b9e6eb + 0a83224 commit 4dbba6a

8 files changed

Lines changed: 53 additions & 42 deletions

File tree

Assets/ConsentManagementProvider/Scripts/model/SpConsents.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
{
33
public class SpConsents
44
{
5-
public SpGdprConsent gdpr;
6-
public SpCcpaConsent ccpa;
7-
public SpUsnatConsent usnat;
5+
#nullable enable
6+
public SpGdprConsent? gdpr;
7+
public SpCcpaConsent? ccpa;
8+
public SpUsnatConsent? usnat;
9+
#nullable disable
810

911
public SpConsents(SpGdprConsent gdpr, SpCcpaConsent ccpa, SpUsnatConsent usnat)
1012
{

Assets/ConsentManagementProvider/Scripts/model/common/CcpaConsent.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ namespace ConsentManagementProvider
77
public class CcpaConsent
88
{
99
public string uuid;
10-
public string status;
1110
public string uspstring;
1211
public List<string> rejectedVendors;
1312
public List<string> rejectedCategories;
14-
public string childPmId;
1513
public bool applies;
14+
public Dictionary<string, object> GPPData;
1615
#nullable enable
16+
public string? status;
17+
public string? childPmId;
1718
public bool? signedLspa;
18-
public string webConsentPayload;
19+
public string? webConsentPayload;
1920
public ConsentStatus? consentStatus;
20-
public Dictionary<string, object>? GPPData;
2121
#nullable disable
2222

2323
public CcpaConsent(
2424
#nullable enable
2525
string uuid,
26-
string status,
26+
string? status,
2727
string uspstring,
2828
List<string> rejectedVendors,
2929
List<string> rejectedCategories,
30-
string childPmId,
30+
string? childPmId,
3131
bool applies,
3232
bool? signedLspa,
33-
string webConsentPayload,
33+
string? webConsentPayload,
3434
ConsentStatus? consentStatus,
35-
Dictionary<string, object>? GPPData
35+
Dictionary<string, object> GPPData
3636
#nullable disable
3737
) {
3838
this.uuid = uuid;
@@ -52,16 +52,16 @@ public CcpaConsent(
5252
public CcpaConsent(
5353
#nullable enable
5454
string uuid,
55-
string status,
55+
string? status,
5656
string uspstring,
5757
string[] rejectedVendors,
5858
string[] rejectedCategories,
59-
string childPmId,
59+
string? childPmId,
6060
bool applies,
6161
bool? signedLspa,
62-
string webConsentPayload,
63-
ConsentStatus consentStatus,
64-
Dictionary<string, object>? GPPData
62+
string? webConsentPayload,
63+
ConsentStatus? consentStatus,
64+
Dictionary<string, object> GPPData
6565
#nullable disable
6666
) {
6767
this.uuid = uuid;

Assets/ConsentManagementProvider/Scripts/model/common/GdprConsent.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ namespace ConsentManagementProvider
66
public class GdprConsent
77
{
88
public bool applies;
9-
public string uuid;
10-
public string webConsentPayload;
119
public string euconsent;
12-
public Dictionary<string, object> TCData;
1310
public Dictionary<string, SpVendorGrant> grants;
14-
public List<string> acceptedCategories;
15-
public ConsentStatus consentStatus;
11+
public Dictionary<string, object> TCData;
1612
#nullable enable
13+
public string? uuid;
14+
public string? webConsentPayload;
15+
public List<string>? acceptedCategories;
16+
public ConsentStatus? consentStatus;
1717
public SPGCMData? googleConsentMode;
1818
#nullable disable
1919

Assets/ConsentManagementProvider/Scripts/model/common/UsnatConsent.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ namespace ConsentManagementProvider
66
{
77
public class UsnatConsent
88
{
9-
#nullable enable
10-
public string? uuid;
11-
public Dictionary<string, object>? GPPData;
12-
#nullable disable
139
public bool applies;
1410
public List<ConsentString> consentStrings;
1511
public List<Consentable> vendors;
1612
public List<Consentable> categories;
17-
public StatusesUsnat statuses;
13+
#nullable enable
14+
public string? uuid;
15+
public Dictionary<string, object>? GPPData;
16+
public StatusesUsnat? statuses;
17+
#nullable disable
1818

1919
public UsnatConsent(
2020
#nullable enable
@@ -97,9 +97,11 @@ public string ToFullString()
9797

9898
public class StatusesUsnat
9999
{
100+
#nullable enable
100101
public bool? rejectedAny, consentedToAll, consentedToAny,
101102
hasConsentData, sellStatus, shareStatus,
102103
sensitiveDataStatus, gpcStatus, previousOptInAll;
104+
#nullable disable
103105

104106
internal static StatusesUsnat collectData(ConsentStatus status)
105107
{

Assets/ExampleApp/Scripts/PrivacySettings.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public class PrivacySettings : MonoBehaviour, IOnConsentReady, IOnConsentSpFinis
3232
public Button clearDataButton;
3333
public Text sdkStatus;
3434

35-
public static string statusCampaignGDPR = "custom";
36-
public static string statusCampaignCCPA = "custom";
37-
public static string statusCampaignUSNAT = "custom";
35+
public static string statusCampaignGDPR = "default";
36+
public static string statusCampaignCCPA = "default";
37+
public static string statusCampaignUSNAT = "default";
3838

3939
private MESSAGE_LANGUAGE language
4040
{
@@ -166,7 +166,7 @@ public void OnClearDataPress()
166166

167167
public void OnConsentReady(SpConsents consents)
168168
{
169-
storedConsentString = consents.gdpr.consents.euconsent ?? "--";
169+
storedConsentString = consents.gdpr?.consents.euconsent ?? "--";
170170
if(CMP.Instance.UseGDPR)
171171
CmpDebugUtil.Log(consents.gdpr.consents.ToFullString());
172172
if(CMP.Instance.UseCCPA)
@@ -221,35 +221,35 @@ string UpdateStatuses(SpConsents consents, CAMPAIGN_TYPE campaign)
221221
{
222222
if (campaign == CAMPAIGN_TYPE.GDPR)
223223
{
224-
bool rejectedAny = (bool)consents.gdpr.consents.consentStatus.rejectedAny;
225-
bool rejectedLI = (bool)consents.gdpr.consents.consentStatus.rejectedLI;
226-
bool consentedAll = (bool)consents.gdpr.consents.consentStatus.consentedAll;
227-
bool consentedToAny = (bool)consents.gdpr.consents.consentStatus.consentedToAny;
224+
bool rejectedAny = consents.gdpr?.consents.consentStatus.rejectedAny ?? false;
225+
bool rejectedLI = consents.gdpr?.consents.consentStatus.rejectedLI ?? false;
226+
bool consentedAll = consents.gdpr?.consents.consentStatus.consentedAll ?? false;
227+
bool consentedToAny = consents.gdpr?.consents.consentStatus.consentedToAny ?? false;
228228

229229
if (consentedAll && consentedToAny)
230230
return "accepted";
231-
else if (rejectedAny && rejectedLI)
231+
else if (rejectedAny && rejectedLI && !consentedAll && !consentedToAny)
232232
return "rejected";
233233
}
234234
if (campaign == CAMPAIGN_TYPE.CCPA)
235235
{
236-
if (consents.ccpa.consents.status == "consentedAll")
236+
if (consents.ccpa?.consents.status == "consentedAll")
237237
return "accepted";
238-
else if (consents.ccpa.consents.status == "rejectedAll")
238+
else if (consents.ccpa?.consents.status == "rejectedAll")
239239
return "rejected";
240240
}
241241
if (campaign == CAMPAIGN_TYPE.USNAT)
242242
{
243-
bool rejectedAny = (bool)consents.usnat.consents.statuses.rejectedAny;
244-
bool consentedToAll = (bool)consents.usnat.consents.statuses.consentedToAll;
245-
bool consentedToAny = (bool)consents.usnat.consents.statuses.consentedToAny;
243+
bool rejectedAny = consents.usnat?.consents.statuses.rejectedAny ?? false;
244+
bool consentedToAll = consents.usnat?.consents.statuses.consentedToAll ?? false;
245+
bool consentedToAny = consents.usnat?.consents.statuses.consentedToAny ?? false;
246246

247247
if (consentedToAll && consentedToAny)
248248
return "accepted";
249249
else if (rejectedAny)
250250
return "rejected";
251251
}
252-
return "custom";
252+
return "default";
253253
}
254254

255255
private void OnDestroy()

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 3.2.0
2+
* [DIA-5501](https://sourcepoint.atlassian.net/browse/DIA-5501) Update consent classes according to native SDK class structure. Several things were made nullable.
3+
4+
# 3.1.1
5+
* [DIA-5912](https://sourcepoint.atlassian.net/browse/DIA-5912) In `CMPPostProcessBuild.cs`, during `OnPostProcessBuild`, move `SwiftBridge.swift` to the `Pod/ConsentViewController` folder.
6+
* [DIA-3802](https://sourcepoint.atlassian.net/browse/DIA-3802) Alt-Tester UI tests pipeline added
7+
18
# 3.1.0
29
* [DIA-4326](https://sourcepoint.atlassian.net/browse/DIA-4326) Unity SDK is bumped to v7.10.1 Android & v7.7.1 iOS native SDK
310
* Programmatic rejectAll feature added [#67](https://github.com/SourcePointUSA/unity-sdk/pull/67)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.sourcepoint.unitycmp",
33
"displayName": "Sourcepoint Consent Message Plugin",
4-
"version": "3.1.1",
4+
"version": "3.2.0",
55
"unity": "2022.3",
66
"description": "Native UI Privacy Manager for both GDPR and CCPA legislations.",
77
"author": {
-109 KB
Binary file not shown.

0 commit comments

Comments
 (0)