Skip to content

Commit

Permalink
Merge pull request #54 from SourcePointUSA/develop
Browse files Browse the repository at this point in the history
Release 2.3.1
  • Loading branch information
Nevazhnovu authored Apr 18, 2024
2 parents 446b691 + 500d3b9 commit 62019c3
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,22 @@ private void Awake()
self=this;
gameObject.name = "CMPiOSListenerHelper";
#if UNITY_IOS && !UNITY_EDITOR_OSX
CmpDebugUtil.Log("Constructing CMPiOSListenerHelper game object...");
DontDestroyOnLoad(this.gameObject);
_setCallbackDefault(Callback);
_setCallbackOnConsentReady(OnConsentReady);
_setCallbackOnConsentUIReady(OnConsentUIReady);
_setCallbackOnConsentAction(OnConsentAction);
_setCallbackOnConsentUIFinished(OnConsentUIFinished);
_setCallbackOnErrorCallback(OnErrorCallback);
_setCallbackOnCustomConsent(OnCustomConsentGDPRCallback);
CmpDebugUtil.Log("Constructing CMPiOSListenerHelper game object...");
DontDestroyOnLoad(this.gameObject);
SetBridgeCallbacks();
#endif
}

internal void SetBridgeCallbacks()
{
#if UNITY_IOS && !UNITY_EDITOR_OSX
_setCallbackDefault(Callback);
_setCallbackOnConsentReady(OnConsentReady);
_setCallbackOnConsentUIReady(OnConsentUIReady);
_setCallbackOnConsentAction(OnConsentAction);
_setCallbackOnConsentUIFinished(OnConsentUIFinished);
_setCallbackOnErrorCallback(OnErrorCallback);
_setCallbackOnCustomConsent(OnCustomConsentGDPRCallback);
#endif
}

Expand Down Expand Up @@ -158,5 +165,14 @@ static void OnCustomConsentGDPRCallback(string jsonSPGDPRConsent)
}
}
}

public void Dispose()
{
if (self != null)
{
Destroy(self.gameObject);
self = null;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public void InitializeLib(
{
#if UNITY_IOS && !UNITY_EDITOR_OSX
_initLib();
if(iOSListener == null)
{
CmpDebugUtil.Log("Creating iosListener");
CreateHelperIOSListener();
}

int campaignsAmount = spCampaigns.Count;
int[] campaignTypes = new int[campaignsAmount];
foreach(SpCampaign sp in spCampaigns)
Expand Down Expand Up @@ -200,6 +206,7 @@ public SpConsents GetSpConsents()
public void ClearAllData()
{
#if UNITY_IOS && !UNITY_EDITOR_OSX
iOSListener._spConsents = null;
_cleanConsent();
#endif
}
Expand All @@ -208,6 +215,7 @@ public void Dispose()
{
#if UNITY_IOS && !UNITY_EDITOR_OSX
_dispose();
iOSListener.Dispose();
#endif
}
}
Expand Down
3 changes: 0 additions & 3 deletions Assets/ExampleApp/Scenes/SourcepointSampleScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ MonoBehaviour:
accountId: 22
propertyId: 16893
propertyName: mobile.multicampaign.demo
useGDPR: 1
useCCPA: 1
useUSNAT: 1
gdprPmId: 488393
ccpaPmId: 509688
usnatPmId: 943886
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.3.1
* [DIA-3844](https://sourcepoint.atlassian.net/browse/DIA-3844) Destroy CMPiOSListenerHelper GameObject in Dispose() call and re-initialize it in CMP.Initialize() call if needed. Also, ClearAllData() method for IOS clears cached value in c# [#53](https://github.com/SourcePointUSA/unity-sdk/pull/53)

# 2.3.0
* [DIA-3046](https://sourcepoint.atlassian.net/browse/DIA-3046) Implemented USNat company for IOS [#47](https://github.com/SourcePointUSA/unity-sdk/pull/47)
* [DIA-3630](https://sourcepoint.atlassian.net/browse/DIA-3630) Implemented USNat company for Android [#48](https://github.com/SourcePointUSA/unity-sdk/pull/48)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.sourcepoint.unitycmp",
"displayName": "Sourcepoint Consent Message Plugin",
"version": "2.3.0",
"version": "2.3.1",
"unity": "2021.3",
"description": "Native UI Privacy Manager for both GDPR and CCPA legislations.",
"author": {
Expand Down
Binary file modified unitypackage/ConsentManagementProvider.unitypackage
Binary file not shown.

0 comments on commit 62019c3

Please sign in to comment.