Skip to content

Commit f248d1c

Browse files
committed
Release 2.1.2: Merge branch 'develop'
* develop: Update `unitypackage` Update `CHANGELOG.md` Update `package.json` Android's `onSpFinished` handling and force logging enabled Update logging system Default property example scene
2 parents 435be8a + d9c7c57 commit f248d1c

File tree

7 files changed

+71
-49
lines changed

7 files changed

+71
-49
lines changed

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

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,34 @@ void onConsentReady(string spConsents)
6262
_spConsents = consents;
6363
ConsentMessenger.Broadcast<IOnConsentReady>(consents);
6464
}
65-
65+
66+
/**
67+
* It is invoked when the interaction with native WebView is done, consent sent, JSON received and CMP is ready to close the WebView
68+
*/
6669
void onSpFinished(string spConsents)
6770
{
68-
CmpDebugUtil.Log("I've reached the C# onSpFinished");
69-
SpConsents consents = JsonUnwrapper.UnwrapSpConsentsAndroid(spConsents);
70-
_spConsents = consents;
71-
ConsentMessenger.Broadcast<IOnConsentSpFinished>(consents);
72-
}
71+
CmpDebugUtil.ForceEnableNextCmpLog();
72+
CmpDebugUtil.LogWarning($"I've reached the C# onSpFinished with JSON spConsents={spConsents}");
7373

74+
try
75+
{
76+
SpConsents consents = JsonUnwrapper.UnwrapSpConsentsAndroid(spConsents);
77+
_spConsents = consents;
78+
ConsentMessenger.Broadcast<IOnConsentSpFinished>(consents);
79+
}
80+
catch (Exception e)
81+
{
82+
ConsentMessenger.Broadcast<IOnConsentError>(e);
83+
}
84+
}
7485

7586
void onError(AndroidJavaObject rawThrowableObject)
7687
{
77-
CmpDebugUtil.Log("I've reached the C# onError : " + rawThrowableObject.ToString());
88+
CmpDebugUtil.ForceEnableNextCmpLog();
89+
CmpDebugUtil.LogError("I've reached the C# onError : " + rawThrowableObject.ToString());
7890
Exception exception = CmpJavaToUnityUtils.ConvertThrowableToError(rawThrowableObject);
79-
CmpDebugUtil.Log("Exception converted successfully : " + exception.ToString());
91+
CmpDebugUtil.ForceEnableNextCmpLog();
92+
CmpDebugUtil.LogError("Exception converted successfully : " + exception.ToString());
8093
ConsentMessenger.Broadcast<IOnConsentError>(exception);
8194
}
8295

Assets/ConsentManagementProvider/Scripts/wrapper/CmpDebugUtil.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@ public static class CmpDebugUtil
66
{
77
private static bool enableLogging = false;
88
private static bool enableDebugging = false;
9+
private static bool forceEnableSingleLog;
910

11+
private static bool IsLoggingEnabled
12+
{
13+
get
14+
{
15+
var result = enableLogging || forceEnableSingleLog;
16+
forceEnableSingleLog = false;
17+
return result;
18+
}
19+
}
20+
1021
static CmpDebugUtil()
1122
{
1223
EnableGarbageCollectorDebugging(enableDebugging);
1324
EnableCmpLogs(enableLogging);
1425
}
1526

16-
public static void EnableCmpLogs(bool enable)
17-
{
18-
enableLogging = enable;
19-
}
27+
public static void ForceEnableNextCmpLog() => forceEnableSingleLog = true;
28+
29+
public static void EnableCmpLogs(bool enable) => enableLogging = enable;
2030

2131
public static void EnableGarbageCollectorDebugging(bool enable)
2232
{
@@ -26,19 +36,19 @@ public static void EnableGarbageCollectorDebugging(bool enable)
2636

2737
public static void Log(string message)
2838
{
29-
if(enableLogging)
39+
if(IsLoggingEnabled)
3040
Debug.Log(message);
3141
}
3242

3343
public static void LogWarning(string message)
3444
{
35-
if (enableLogging)
45+
if (IsLoggingEnabled)
3646
Debug.LogWarning(message);
3747
}
3848

3949
public static void LogError(string message)
4050
{
41-
//if(enableLogging)
51+
//if(EnableLogging)
4252
Debug.LogError(message);
4353
}
4454
}

Assets/ExampleApp/Scenes/SourcepointSampleScene.unity

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ NavMeshSettings:
104104
serializedVersion: 2
105105
m_ObjectHideFlags: 0
106106
m_BuildSettings:
107-
serializedVersion: 3
107+
serializedVersion: 2
108108
agentTypeID: 0
109109
agentRadius: 0.5
110110
agentHeight: 2
@@ -117,7 +117,7 @@ NavMeshSettings:
117117
cellSize: 0.16666667
118118
manualTileSize: 0
119119
tileSize: 256
120-
buildHeightMesh: 0
120+
accuratePlacement: 0
121121
maxJobWorkers: 0
122122
preserveTilesOutsideBounds: 0
123123
debug:
@@ -153,9 +153,10 @@ MonoBehaviour:
153153
m_Script: {fileID: 11500000, guid: cde022323c7f34dc983348b3ed862e86, type: 3}
154154
m_Name:
155155
m_EditorClassIdentifier:
156-
accountId: 1909
157-
propertyName: voodoo.ios
158-
pmId: 838714
156+
accountId: 22
157+
propertyName: mobile.multicampaign.demo
158+
propertyId: 16893
159+
pmId: 488393
159160
authId:
160161
campaignTypes: 00000000
161162
consentValueText: {fileID: 740499557}
@@ -169,13 +170,13 @@ Transform:
169170
m_PrefabInstance: {fileID: 0}
170171
m_PrefabAsset: {fileID: 0}
171172
m_GameObject: {fileID: 131616236}
172-
serializedVersion: 2
173173
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
174174
m_LocalPosition: {x: 555.3208, y: 1261.6669, z: 0}
175175
m_LocalScale: {x: 1, y: 1, z: 1}
176176
m_ConstrainProportionsScale: 0
177177
m_Children: []
178178
m_Father: {fileID: 0}
179+
m_RootOrder: 3
179180
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
180181
--- !u!82 &131616239
181182
AudioSource:
@@ -304,6 +305,7 @@ RectTransform:
304305
m_ConstrainProportionsScale: 0
305306
m_Children: []
306307
m_Father: {fileID: 448136249}
308+
m_RootOrder: 0
307309
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
308310
m_AnchorMin: {x: 0, y: 0}
309311
m_AnchorMax: {x: 1, y: 1}
@@ -483,9 +485,7 @@ Canvas:
483485
m_OverrideSorting: 0
484486
m_OverridePixelPerfect: 0
485487
m_SortingBucketNormalizedSize: 0
486-
m_VertexColorAlwaysGammaSpace: 1
487488
m_AdditionalShaderChannelsFlag: 25
488-
m_UpdateRectTransformForStandalone: 0
489489
m_SortingLayerID: 0
490490
m_SortingOrder: 0
491491
m_TargetDisplay: 0
@@ -509,6 +509,7 @@ RectTransform:
509509
- {fileID: 855986890}
510510
- {fileID: 448136249}
511511
m_Father: {fileID: 0}
512+
m_RootOrder: 0
512513
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
513514
m_AnchorMin: {x: 0, y: 0}
514515
m_AnchorMax: {x: 0, y: 0}
@@ -548,6 +549,7 @@ RectTransform:
548549
m_Children:
549550
- {fileID: 183465787}
550551
m_Father: {fileID: 207973236}
552+
m_RootOrder: 6
551553
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
552554
m_AnchorMin: {x: 0.5, y: 0.5}
553555
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -700,17 +702,9 @@ Camera:
700702
m_projectionMatrixMode: 1
701703
m_GateFitMode: 2
702704
m_FOVAxisMode: 0
703-
m_Iso: 200
704-
m_ShutterSpeed: 0.005
705-
m_Aperture: 16
706-
m_FocusDistance: 10
707-
m_FocalLength: 50
708-
m_BladeCount: 5
709-
m_Curvature: {x: 2, y: 11}
710-
m_BarrelClipping: 0.25
711-
m_Anamorphism: 0
712705
m_SensorSize: {x: 36, y: 24}
713706
m_LensShift: {x: 0, y: 0}
707+
m_FocalLength: 50
714708
m_NormalizedViewPortRect:
715709
serializedVersion: 2
716710
x: 0
@@ -744,13 +738,13 @@ Transform:
744738
m_PrefabInstance: {fileID: 0}
745739
m_PrefabAsset: {fileID: 0}
746740
m_GameObject: {fileID: 519420028}
747-
serializedVersion: 2
748741
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
749742
m_LocalPosition: {x: 0, y: 0, z: -10}
750743
m_LocalScale: {x: 1, y: 1, z: 1}
751744
m_ConstrainProportionsScale: 0
752745
m_Children: []
753746
m_Father: {fileID: 0}
747+
m_RootOrder: 2
754748
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
755749
--- !u!1 &575223733
756750
GameObject:
@@ -783,6 +777,7 @@ RectTransform:
783777
m_ConstrainProportionsScale: 0
784778
m_Children: []
785779
m_Father: {fileID: 207973236}
780+
m_RootOrder: 2
786781
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
787782
m_AnchorMin: {x: 0, y: 1}
788783
m_AnchorMax: {x: 1, y: 1}
@@ -917,6 +912,7 @@ RectTransform:
917912
m_ConstrainProportionsScale: 0
918913
m_Children: []
919914
m_Father: {fileID: 1539184778}
915+
m_RootOrder: 0
920916
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
921917
m_AnchorMin: {x: 0, y: 0}
922918
m_AnchorMax: {x: 1, y: 1}
@@ -1051,6 +1047,7 @@ RectTransform:
10511047
m_ConstrainProportionsScale: 0
10521048
m_Children: []
10531049
m_Father: {fileID: 855986890}
1050+
m_RootOrder: 0
10541051
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
10551052
m_AnchorMin: {x: 0, y: 0}
10561053
m_AnchorMax: {x: 1, y: 1}
@@ -1185,6 +1182,7 @@ RectTransform:
11851182
m_ConstrainProportionsScale: 0
11861183
m_Children: []
11871184
m_Father: {fileID: 207973236}
1185+
m_RootOrder: 3
11881186
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
11891187
m_AnchorMin: {x: 0, y: 1}
11901188
m_AnchorMax: {x: 1, y: 1}
@@ -1321,6 +1319,7 @@ RectTransform:
13211319
m_Children:
13221320
- {fileID: 640286547}
13231321
m_Father: {fileID: 207973236}
1322+
m_RootOrder: 5
13241323
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
13251324
m_AnchorMin: {x: 0.5, y: 0.5}
13261325
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -1466,6 +1465,7 @@ RectTransform:
14661465
m_Children:
14671466
- {fileID: 576126876}
14681467
m_Father: {fileID: 207973236}
1468+
m_RootOrder: 4
14691469
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
14701470
m_AnchorMin: {x: 0.5, y: 0.5}
14711471
m_AnchorMax: {x: 0.5, y: 0.5}
@@ -1638,13 +1638,13 @@ Transform:
16381638
m_PrefabInstance: {fileID: 0}
16391639
m_PrefabAsset: {fileID: 0}
16401640
m_GameObject: {fileID: 1808727966}
1641-
serializedVersion: 2
16421641
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
16431642
m_LocalPosition: {x: 579.6337, y: 1769.8843, z: -3.4428744}
16441643
m_LocalScale: {x: 1, y: 1, z: 1}
16451644
m_ConstrainProportionsScale: 0
16461645
m_Children: []
16471646
m_Father: {fileID: 0}
1647+
m_RootOrder: 1
16481648
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
16491649
--- !u!1 &1845083880
16501650
GameObject:
@@ -1677,6 +1677,7 @@ RectTransform:
16771677
m_ConstrainProportionsScale: 0
16781678
m_Children: []
16791679
m_Father: {fileID: 207973236}
1680+
m_RootOrder: 0
16801681
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
16811682
m_AnchorMin: {x: 0, y: 0}
16821683
m_AnchorMax: {x: 1, y: 1}
@@ -1752,6 +1753,7 @@ RectTransform:
17521753
m_ConstrainProportionsScale: 0
17531754
m_Children: []
17541755
m_Father: {fileID: 207973236}
1756+
m_RootOrder: 1
17551757
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17561758
m_AnchorMin: {x: 0, y: 1}
17571759
m_AnchorMax: {x: 1, y: 1}
@@ -1780,8 +1782,8 @@ MonoBehaviour:
17801782
m_Calls: []
17811783
m_text: Sourcepoint
17821784
m_isRightToLeft: 0
1783-
m_fontAsset: {fileID: 11400000, guid: dc36b3fdc14f47ebb36fd484a67e268a, type: 2}
1784-
m_sharedMaterial: {fileID: 2140032, guid: dc36b3fdc14f47ebb36fd484a67e268a, type: 2}
1785+
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
1786+
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
17851787
m_fontSharedMaterials: []
17861788
m_fontMaterial: {fileID: 0}
17871789
m_fontMaterials: []
@@ -1855,11 +1857,3 @@ CanvasRenderer:
18551857
m_PrefabAsset: {fileID: 0}
18561858
m_GameObject: {fileID: 1917161865}
18571859
m_CullTransparentMesh: 1
1858-
--- !u!1660057539 &9223372036854775807
1859-
SceneRoots:
1860-
m_ObjectHideFlags: 0
1861-
m_Roots:
1862-
- {fileID: 519420032}
1863-
- {fileID: 207973236}
1864-
- {fileID: 131616238}
1865-
- {fileID: 1808727969}

Assets/ExampleApp/Scripts/PrivacySettings.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
public class PrivacySettings : MonoBehaviour, IOnConsentReady
99
{
10-
public int accountId = 1909;
11-
public string propertyName = "voodoo.ios";
12-
public int propertyId = 31817;
13-
public string pmId = "838714";
10+
public int accountId = 22;
11+
public string propertyName = "mobile.multicampaign.demo";
12+
public int propertyId = 16893;
13+
public string pmId = "488393";
1414
public string authId = null;
1515
public List<CAMPAIGN_TYPE> campaignTypes = new ();
1616

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.1.2
2+
* Miscellaneous fixes
3+
* Improve logging system and error handling
4+
* Enabling improved logging in onSpFinished
5+
16
# 2.1.1
27
* [DIA-2884](https://sourcepoint.atlassian.net/browse/DIA-2884) Fixed enum error for Android 8.0 [#17](https://github.com/SourcePointUSA/unity-sdk/pull/17)
38
* [DIA-2583](https://sourcepoint.atlassian.net/browse/DIA-2583) Import scene with `TextMesh Pro` [#16](https://github.com/SourcePointUSA/unity-sdk/pull/16)

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": "2.1.1",
4+
"version": "2.1.2",
55
"unity": "2021.3",
66
"description": "Native UI Privacy Manager for both GDPR and CCPA legislations.",
77
"author": {
Binary file not shown.

0 commit comments

Comments
 (0)