Skip to content

Commit 14b3686

Browse files
authored
Merge pull request #41 from SourcePointUSA/DIA-3628-introduce-gcm-for-ios
[DIA-3628] Add `gcmStatus` data to `consent`
2 parents 7b45e51 + c421d7b commit 14b3686

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

Assets/ConsentManagementProvider/Scripts/json/JsonUnwrapper.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,14 @@ private static GdprConsent UnwrapGdprConsent(GdprConsentWrapper wrapped)
234234
{
235235
unwrapped.consentStatus = UnwrapConsentStatus(wrapped.consentStatus);
236236
}
237-
237+
238+
unwrapped.googleConsentMode = new SPGCMData(
239+
wrapped.gcmStatus.ad_storage,
240+
wrapped.gcmStatus.analytics_storage,
241+
wrapped.gcmStatus.ad_user_data,
242+
wrapped.gcmStatus.ad_personalization
243+
);
244+
238245
return unwrapped;
239246
}
240247

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/model/common/GdprConsent.cs

Lines changed: 23 additions & 1 deletion
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,31 @@ public string ToFullString()
5455
sb.AppendLine($" {category}");
5556
}
5657

58+
sb.AppendLine($"adStorage: {googleConsentMode.adStorage.ToString()}, analyticsStorage: {googleConsentMode.analyticsStorage.ToString()}, adUserData: {googleConsentMode.adUserData.ToString()}, adPersonalization: {googleConsentMode.adPersonalization.ToString()}");
59+
5760
return sb.ToString();
5861
}
5962
}
60-
63+
64+
public class SPGCMData
65+
{
66+
public enum Status
67+
{
68+
granted,
69+
denied
70+
}
71+
public Status? adStorage, analyticsStorage, adUserData, adPersonalization;
72+
73+
public SPGCMData(Status? adStorage, Status? analyticsStorage,
74+
Status? adUserData, Status? adPersonalization)
75+
{
76+
this.adStorage = adStorage;
77+
this.analyticsStorage = analyticsStorage;
78+
this.adUserData = adUserData;
79+
this.adPersonalization = adPersonalization;
80+
}
81+
}
82+
6183
public class ConsentStatus
6284
{
6385
public bool? rejectedAny;

0 commit comments

Comments
 (0)