Skip to content

Commit

Permalink
Merge pull request #42 from SourcePointUSA/DIA-2585-implement-customC…
Browse files Browse the repository at this point in the history
…onsentTo-deleteCustomConsent-method-android

DIA-2585 `DeleteCustomConsent` feature for Android
  • Loading branch information
Nevazhnovu authored Feb 27, 2024
2 parents 14b3686 + 2c5919b commit d98468f
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 289 deletions.
5 changes: 2 additions & 3 deletions Assets/ConsentManagementProvider/Scripts/facade/CMP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ public static void CustomConsentGDPR(string[] vendors, string[] categories, stri
public static void DeleteCustomConsentGDPR(string[] vendors, string[] categories, string[] legIntCategories, Action<GdprConsent> onSuccessDelegate)
{
#if UNITY_ANDROID
// TO-DO
/*ConsentWrapperAndroid.Instance.DeleteCustomConsentGDPR(
ConsentWrapperAndroid.Instance.DeleteCustomConsentGDPR(
vendors: vendors,
categories: categories,
legIntCategories: legIntCategories,
onSuccessDelegate: onSuccessDelegate);*/
onSuccessDelegate: onSuccessDelegate);

#elif UNITY_IOS && !UNITY_EDITOR_OSX
ConsentWrapperIOS.Instance.DeleteCustomConsentGDPR(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ public void CustomConsentGDPR(string[] vendors, string[] categories, string[] le
consentLib.Call("customConsentGDPR", vendors, categories, legIntCategories, customConsentClient);
}

public void DeleteCustomConsentGDPR(string[] vendors, string[] categories, string[] legIntCategories, Action<GdprConsent> onSuccessDelegate)
{
this.customConsentClient = new CustomConsentClient(onSuccessDelegate);
consentLib.Call("deleteCustomConsentTo", vendors, categories, legIntCategories, customConsentClient);
}

public GdprConsent GetCustomGdprConsent()
{
if (this.customConsentClient != null)
Expand Down
227 changes: 227 additions & 0 deletions Assets/ExampleApp/Scenes/SourcepointSampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ RectTransform:
- {fileID: 1511860154}
- {fileID: 957257163}
- {fileID: 448136249}
- {fileID: 506840118}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -539,6 +540,152 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 448136248}
m_CullTransparentMesh: 1
--- !u!1 &506840117
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 506840118}
- component: {fileID: 506840121}
- component: {fileID: 506840120}
- component: {fileID: 506840119}
m_Layer: 5
m_Name: Clear Custome Consent Data Button
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &506840118
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 506840117}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1196510773}
m_Father: {fileID: 207973236}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 676, y: 79.456}
m_SizeDelta: {x: 720, y: 180}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &506840119
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 506840117}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 506840120}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 131616237}
m_TargetAssemblyTypeName: PrivacySettings, Sourcepoint
m_MethodName: OnClearCustomConsentDataPress
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 131616239}
m_TargetAssemblyTypeName: UnityEngine.AudioSource, UnityEngine
m_MethodName: Play
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &506840120
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 506840117}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8867924, g: 0.1966002, b: 0.35890934, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 0f51b1b75b0cda146a0198335ba7afad, type: 3}
m_Type: 1
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 1
m_PixelsPerUnitMultiplier: 1
--- !u!222 &506840121
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 506840117}
m_CullTransparentMesh: 1
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1395,6 +1542,86 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1032806485}
m_CullTransparentMesh: 1
--- !u!1 &1196510772
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1196510773}
- component: {fileID: 1196510775}
- component: {fileID: 1196510774}
m_Layer: 5
m_Name: Label (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1196510773
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196510772}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 506840118}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1196510774
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196510772}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 44
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 44
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Clear Data
--- !u!222 &1196510775
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196510772}
m_CullTransparentMesh: 1
--- !u!1 &1398530920
GameObject:
m_ObjectHideFlags: 0
Expand Down
14 changes: 14 additions & 0 deletions Assets/ExampleApp/Scripts/PrivacySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public void OnCustomConsentButtonClick()
private void SuccessDelegate(GdprConsent customConsent)
{
Debug.Log($"I am your success callback!"); // TODO print customConsent
storedConsentString = customConsent.euconsent;
updateUI();
}

public void OnCCPAPrivacyManagerButtonClick()
Expand All @@ -119,6 +121,18 @@ public void OnClearDataPress()
updateUI();
}

public void OnClearCustomConsentDataPress()
{
CMP.DeleteCustomConsentGDPR(
vendors: this.vendors,
categories: this.categories,
legIntCategories: this.legIntCategories,
onSuccessDelegate: SuccessDelegate
);
storedConsentString = null;
updateUI();
}

public void OnLoadMessagePress()
{
storedConsentString = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@

<androidPackages>
<!-- <androidPackage spec="org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.0" />-->
<androidPackage spec="com.sourcepoint.cmplibrary:cmplibrary:7.7.0" />
<androidPackage spec="com.sourcepoint.cmplibrary:cmplibrary:7.7.1" />
</androidPackages>
</dependencies>
Binary file not shown.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d98468f

Please sign in to comment.