From e9459f6ad0fbc64029bf15d7ad051f206583c8eb Mon Sep 17 00:00:00 2001 From: ugi Date: Thu, 24 Dec 2020 10:21:02 +0100 Subject: [PATCH 1/3] fix costAmount parsing logic to handle null native values --- Assets/Adjust/Unity/AdjustAttribution.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Assets/Adjust/Unity/AdjustAttribution.cs b/Assets/Adjust/Unity/AdjustAttribution.cs index a8b1c9b9..5ae59129 100644 --- a/Assets/Adjust/Unity/AdjustAttribution.cs +++ b/Assets/Adjust/Unity/AdjustAttribution.cs @@ -36,8 +36,16 @@ public AdjustAttribution(string jsonString) clickLabel = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyClickLabel); adid = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyAdid); costType = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostType); - costAmount = double.Parse(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount), + try + { + costAmount = double.Parse(AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostAmount), System.Globalization.CultureInfo.InvariantCulture); + } + catch (Exception) + { + // attribution response doesn't contain cost amount attached + // value will default to null + } costCurrency = AdjustUtils.GetJsonString(jsonNode, AdjustUtils.KeyCostCurrency); } @@ -57,8 +65,16 @@ public AdjustAttribution(Dictionary dicAttributionData) clickLabel = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyClickLabel); adid = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyAdid); costType = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostType); - costAmount = double.Parse(AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount), + try + { + costAmount = double.Parse(AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostAmount), System.Globalization.CultureInfo.InvariantCulture); + } + catch (Exception) + { + // attribution response doesn't contain cost amount attached + // value will default to null + } costCurrency = AdjustUtils.TryGetValue(dicAttributionData, AdjustUtils.KeyCostCurrency); } } From 36d1c5d0012cf534c59831ca65e750d847480ac1 Mon Sep 17 00:00:00 2001 From: ugi Date: Thu, 24 Dec 2020 10:40:00 +0100 Subject: [PATCH 2/3] update version number to 4.24.1 --- Assets/Adjust/Android/AdjustAndroid.cs | 2 +- Assets/Adjust/Windows/AdjustWindows.cs | 2 +- Assets/Adjust/iOS/AdjustiOS.cs | 2 +- VERSION | 2 +- doc/english/migration/migrate.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Adjust/Android/AdjustAndroid.cs b/Assets/Adjust/Android/AdjustAndroid.cs index 50d2acbc..759204db 100644 --- a/Assets/Adjust/Android/AdjustAndroid.cs +++ b/Assets/Adjust/Android/AdjustAndroid.cs @@ -8,7 +8,7 @@ namespace com.adjust.sdk #if UNITY_ANDROID public class AdjustAndroid { - private const string sdkPrefix = "unity4.24.0"; + private const string sdkPrefix = "unity4.24.1"; private static bool launchDeferredDeeplink = true; private static AndroidJavaClass ajcAdjust = new AndroidJavaClass("com.adjust.sdk.Adjust"); private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic("currentActivity"); diff --git a/Assets/Adjust/Windows/AdjustWindows.cs b/Assets/Adjust/Windows/AdjustWindows.cs index b3883cee..24112698 100644 --- a/Assets/Adjust/Windows/AdjustWindows.cs +++ b/Assets/Adjust/Windows/AdjustWindows.cs @@ -17,7 +17,7 @@ namespace com.adjust.sdk { public class AdjustWindows { - private const string sdkPrefix = "unity4.24.0"; + private const string sdkPrefix = "unity4.24.1"; private static bool appLaunched = false; public static void Start(AdjustConfig adjustConfig) diff --git a/Assets/Adjust/iOS/AdjustiOS.cs b/Assets/Adjust/iOS/AdjustiOS.cs index 82b536de..44dd7b65 100644 --- a/Assets/Adjust/iOS/AdjustiOS.cs +++ b/Assets/Adjust/iOS/AdjustiOS.cs @@ -8,7 +8,7 @@ namespace com.adjust.sdk #if UNITY_IOS public class AdjustiOS { - private const string sdkPrefix = "unity4.24.0"; + private const string sdkPrefix = "unity4.24.1"; [DllImport("__Internal")] private static extern void _AdjustLaunchApp( diff --git a/VERSION b/VERSION index 252fdf2c..60556793 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.24.0 +4.24.1 diff --git a/doc/english/migration/migrate.md b/doc/english/migration/migrate.md index a88f4685..6fc59b0d 100644 --- a/doc/english/migration/migrate.md +++ b/doc/english/migration/migrate.md @@ -1,4 +1,4 @@ -## Migrate your Adjust SDK for Unity3d to 4.24.0 from 3.4.4 +## Migrate your Adjust SDK for Unity3d to 4.24.1 from 3.4.4 ### Migration procedure From b64b21779f9ebebeb4702242e42bdfe471d9ba43 Mon Sep 17 00:00:00 2001 From: ugi Date: Thu, 24 Dec 2020 10:40:53 +0100 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec66280d..bab62b2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### Version 4.24.1 (24th December 2020) +#### Fixed +- Fixed handling of native `null` values for cost amount. + +#### Native SDKs +- [iOS@v4.24.0][ios_sdk_v4.24.0] +- [Android@v4.25.0][android_sdk_v4.25.0] +- [Windows@v4.17.0][windows_sdk_v4.17.0] + +--- + ### Version 4.24.0 (11th December 2020) #### Added - Added possibility to get cost data information in attribution callback.