Skip to content

Commit 4051f1d

Browse files
authored
Merge pull request #46 from SourcePointUSA/develop
Release v 2.2.2
2 parents 7b45e51 + 57d46ca commit 4051f1d

32 files changed

+387
-270
lines changed

Assets/ConsentManagementProvider/Plugins/iOS/Source/SwiftBridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ extension SwiftBridge {
290290
}
291291

292292
@objc public func setCallbackOnCustomConsent(callback: @escaping СallbackCharMessage) -> Void{
293-
print("setCallbackOnSPFinished")
293+
print("setCallbackOnCustomConsent")
294294
callbackOnCustomConsent = callback
295295
}
296296

Assets/ConsentManagementProvider/Scripts/facade/CMP.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@ public static void CustomConsentGDPR(string[] vendors, string[] categories, stri
146146
public static void DeleteCustomConsentGDPR(string[] vendors, string[] categories, string[] legIntCategories, Action<GdprConsent> onSuccessDelegate)
147147
{
148148
#if UNITY_ANDROID
149-
// TO-DO
150-
/*ConsentWrapperAndroid.Instance.DeleteCustomConsentGDPR(
149+
ConsentWrapperAndroid.Instance.DeleteCustomConsentGDPR(
151150
vendors: vendors,
152151
categories: categories,
153152
legIntCategories: legIntCategories,
154-
onSuccessDelegate: onSuccessDelegate);*/
153+
onSuccessDelegate: onSuccessDelegate);
155154

156155
#elif UNITY_IOS && !UNITY_EDITOR_OSX
157156
ConsentWrapperIOS.Instance.DeleteCustomConsentGDPR(

Assets/ConsentManagementProvider/Scripts/json/JsonUnwrapper.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ public static SpGdprConsent UnwrapSpGdprConsentAndroid(SpGdprConsentWrapperAndro
102102
}
103103
}
104104

105+
if (wrappedGdpr.gcmStatus != null)
106+
{
107+
unwrapped.googleConsentMode = new SPGCMData(
108+
wrappedGdpr.gcmStatus.ad_storage,
109+
wrappedGdpr.gcmStatus.analytics_storage,
110+
wrappedGdpr.gcmStatus.ad_user_data,
111+
wrappedGdpr.gcmStatus.ad_personalization
112+
);
113+
}
114+
105115
return new SpGdprConsent(unwrapped);
106116
}
107117

@@ -234,7 +244,17 @@ private static GdprConsent UnwrapGdprConsent(GdprConsentWrapper wrapped)
234244
{
235245
unwrapped.consentStatus = UnwrapConsentStatus(wrapped.consentStatus);
236246
}
237-
247+
248+
if (wrapped.gcmStatus != null)
249+
{
250+
unwrapped.googleConsentMode = new SPGCMData(
251+
wrapped.gcmStatus.ad_storage,
252+
wrapped.gcmStatus.analytics_storage,
253+
wrapped.gcmStatus.ad_user_data,
254+
wrapped.gcmStatus.ad_personalization
255+
);
256+
}
257+
238258
return unwrapped;
239259
}
240260

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace ConsentManagementProviderLib.Json
2+
{
3+
internal class GCMDataWrapper
4+
{
5+
public SPGCMData.Status? ad_storage, analytics_storage, ad_user_data, ad_personalization;
6+
}
7+
}

Assets/ConsentManagementProvider/Scripts/json/wrappers/GCMDataWrapper.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/ConsentManagementProvider/Scripts/json/wrappers/GdprConsentWrapper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ internal class GdprConsentWrapper
1212
public bool applies;
1313
public string webConsentPayload;
1414
public ConsentStatusWrapper consentStatus;
15+
public GCMDataWrapper? gcmStatus;
1516
}
1617
}

Assets/ConsentManagementProvider/Scripts/json/wrappers/android/SpGdprConsentWrapperAndroid.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using Newtonsoft.Json;
2+
using System.Collections.Generic;
23

34
namespace ConsentManagementProviderLib.Json
45
{
@@ -8,5 +9,7 @@ internal class SpGdprConsentWrapperAndroid
89
public string euconsent;
910
public Dictionary<string, object> tcData;
1011
public Dictionary<string, Dictionary<string, object>> grants;
12+
[JsonProperty("googleConsentMode")]
13+
public GCMDataWrapper gcmStatus;
1114
}
1215
}

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

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class GdprConsent
1313
public Dictionary<string, SpVendorGrant> grants;
1414
public List<string> acceptedCategories;
1515
public ConsentStatus consentStatus;
16+
public SPGCMData? googleConsentMode;
1617

1718
public string ToFullString()
1819
{
@@ -54,10 +55,35 @@ public string ToFullString()
5455
sb.AppendLine($" {category}");
5556
}
5657

58+
if(googleConsentMode != null)
59+
sb.AppendLine($"adStorage: {googleConsentMode.adStorage}, analyticsStorage: {googleConsentMode.analyticsStorage}, adUserData: {googleConsentMode.adUserData}, adPersonalization: {googleConsentMode.adPersonalization}");
60+
5761
return sb.ToString();
5862
}
5963
}
60-
64+
65+
public class SPGCMData
66+
{
67+
public enum Status
68+
{
69+
granted,
70+
denied
71+
}
72+
public Status? adStorage, analyticsStorage, adUserData, adPersonalization;
73+
74+
public SPGCMData(
75+
Status? adStorage,
76+
Status? analyticsStorage,
77+
Status? adUserData,
78+
Status? adPersonalization)
79+
{
80+
this.adStorage = adStorage;
81+
this.analyticsStorage = analyticsStorage;
82+
this.adUserData = adUserData;
83+
this.adPersonalization = adPersonalization;
84+
}
85+
}
86+
6187
public class ConsentStatus
6288
{
6389
public bool? rejectedAny;
@@ -71,9 +97,17 @@ public class ConsentStatus
7197
public object rejectedVendors;
7298
public object rejectedCategories;
7399

74-
public ConsentStatus(bool? rejectedAny, bool? rejectedLI, bool? consentedAll,
75-
bool? consentedToAny, bool? vendorListAdditions, bool? legalBasisChanges,
76-
bool? hasConsentData, GranularStatus? granularStatus, object rejectedVendors, object rejectedCategories)
100+
public ConsentStatus(
101+
bool? rejectedAny,
102+
bool? rejectedLI,
103+
bool? consentedAll,
104+
bool? consentedToAny,
105+
bool? vendorListAdditions,
106+
bool? legalBasisChanges,
107+
bool? hasConsentData,
108+
GranularStatus? granularStatus,
109+
object rejectedVendors,
110+
object rejectedCategories)
77111
{
78112
this.rejectedAny = rejectedAny;
79113
this.rejectedLI = rejectedLI;
@@ -96,7 +130,13 @@ public class GranularStatus
96130
public string? purposeLegInt;
97131
public bool? previousOptInAll;
98132
public bool? defaultConsent;
99-
public GranularStatus(string? vendorConsent, string? vendorLegInt, string? purposeConsent, string? purposeLegInt, bool? previousOptInAll, bool? defaultConsent)
133+
public GranularStatus(
134+
string? vendorConsent,
135+
string? vendorLegInt,
136+
string? purposeConsent,
137+
string? purposeLegInt,
138+
bool? previousOptInAll,
139+
bool? defaultConsent)
100140
{
101141
this.vendorConsent = vendorConsent;
102142
this.vendorLegInt = vendorLegInt;

Assets/ConsentManagementProvider/Scripts/wrapper/Android/ConsentWrapperAndroid.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ public void CustomConsentGDPR(string[] vendors, string[] categories, string[] le
135135
consentLib.Call("customConsentGDPR", vendors, categories, legIntCategories, customConsentClient);
136136
}
137137

138+
public void DeleteCustomConsentGDPR(string[] vendors, string[] categories, string[] legIntCategories, Action<GdprConsent> onSuccessDelegate)
139+
{
140+
this.customConsentClient = new CustomConsentClient(onSuccessDelegate);
141+
consentLib.Call("deleteCustomConsentTo", vendors, categories, legIntCategories, customConsentClient);
142+
}
143+
138144
public GdprConsent GetCustomGdprConsent()
139145
{
140146
if (this.customConsentClient != null)

0 commit comments

Comments
 (0)