From 6da9c4363cc63e1555af0a5f21aee76f5b17e0d2 Mon Sep 17 00:00:00 2001 From: Josh Yaganeh <319444+jyaganeh@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:14:34 -0800 Subject: [PATCH] [MOBILE-4122] Release 9.2.1 (#135) --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/release.yaml | 14 +++++++------- .../UrbanAirship/Platforms/AttributeEditor.cs | 19 ++++++++++--------- Assets/UrbanAirship/Platforms/CustomEvent.cs | 5 +++-- CHANGELOG.md | 7 +++++++ airship.properties | 2 +- 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48825b2f..4405161e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: # Build - name: Build project env: - UNITY_USERNAME: ${{ secrets.UNITY_USERNAME }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + UNITY_USERNAME: ${{ secrets.ULRICH_UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.ULRICH_UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.ULRICH_UNITY_SERIAL }} run: ./scripts/docker_run.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a451ddcc..fde2037d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,9 +33,9 @@ jobs: - name: Build env: - UNITY_USERNAME: ${{ secrets.UNITY_USERNAME }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + UNITY_USERNAME: ${{ secrets.ULRICH_UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.ULRICH_UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.ULRICH_UNITY_SERIAL }} run: ./scripts/docker_run.sh - name: Create Github Release @@ -60,10 +60,10 @@ jobs: asset_name: urbanairship-${{ steps.get_version.outputs.VERSION }}.unitypackage asset_content_type: application/octet-stream - - name: Bintray Release - env: - BINTRAY_AUTH: ${{ secrets.BINTRAY_AUTH }} - run: bash ./scripts/deploy_bintray.sh ${{ steps.get_version.outputs.VERSION }} +# - name: Bintray Release +# env: +# BINTRAY_AUTH: ${{ secrets.BINTRAY_AUTH }} +# run: bash ./scripts/deploy_bintray.sh ${{ steps.get_version.outputs.VERSION }} docs: runs-on: ubuntu-latest diff --git a/Assets/UrbanAirship/Platforms/AttributeEditor.cs b/Assets/UrbanAirship/Platforms/AttributeEditor.cs index 9476cf6b..62e264c2 100644 --- a/Assets/UrbanAirship/Platforms/AttributeEditor.cs +++ b/Assets/UrbanAirship/Platforms/AttributeEditor.cs @@ -1,6 +1,7 @@ /* Copyright Airship and Contributors */ using System; +using System.Globalization; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -42,7 +43,7 @@ public AttributeEditor SetAttribute (string key, int value) { if (IsInvalidField (key)) { return this; } - operations.Add (new AttributeMutation (AttributeAction.Set, key, value, AttributeType.Integer)); + operations.Add (new AttributeMutation (AttributeAction.Set, key, value.ToString(CultureInfo.InvariantCulture), AttributeType.Integer)); return this; } @@ -56,7 +57,7 @@ public AttributeEditor SetAttribute (string key, long value) { if (IsInvalidField (key)) { return this; } - operations.Add (new AttributeMutation (AttributeAction.Set, key, value, AttributeType.Long)); + operations.Add (new AttributeMutation (AttributeAction.Set, key, value.ToString(CultureInfo.InvariantCulture), AttributeType.Long)); return this; } @@ -73,7 +74,7 @@ public AttributeEditor SetAttribute (string key, float value) { if (float.IsNaN (value) || float.IsInfinity (value)) { throw new FormatException ("Infinity or NaN: " + value); } - operations.Add (new AttributeMutation (AttributeAction.Set, key, value, AttributeType.Float)); + operations.Add (new AttributeMutation (AttributeAction.Set, key, value.ToString(CultureInfo.InvariantCulture), AttributeType.Float)); return this; } @@ -90,7 +91,7 @@ public AttributeEditor SetAttribute (string key, double value) { if (double.IsNaN (value) || double.IsInfinity (value)) { throw new FormatException ("Infinity or NaN: " + value); } - operations.Add (new AttributeMutation (AttributeAction.Set, key, value, AttributeType.Double)); + operations.Add (new AttributeMutation (AttributeAction.Set, key, value.ToString(CultureInfo.InvariantCulture), AttributeType.Double)); return this; } @@ -109,7 +110,7 @@ public AttributeEditor SetAttribute(string key, DateTime value) // Pass date to the plugin as seconds since the epoch System.DateTime epochStart = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); - double valueInMillisecondsSinceEpoch = (value - epochStart).TotalMilliseconds; + string valueInMillisecondsSinceEpoch = (value - epochStart).TotalMilliseconds.ToString(CultureInfo.InvariantCulture); operations.Add(new AttributeMutation(AttributeAction.Set, key, valueInMillisecondsSinceEpoch, AttributeType.Date)); return this; @@ -185,11 +186,11 @@ internal class AttributeMutation { private string type; #pragma warning restore - public AttributeMutation (AttributeAction action, string key, object value, AttributeType type) { - this.action = action.ToString (); + public AttributeMutation (AttributeAction action, string key, string value, AttributeType type) { + this.action = action.ToString(); this.key = key; - this.value = value == null ? null : value.ToString (); - this.type = type.ToString (); + this.value = value; + this.type = type.ToString(); } } } diff --git a/Assets/UrbanAirship/Platforms/CustomEvent.cs b/Assets/UrbanAirship/Platforms/CustomEvent.cs index 5d2914ea..42a2adbb 100755 --- a/Assets/UrbanAirship/Platforms/CustomEvent.cs +++ b/Assets/UrbanAirship/Platforms/CustomEvent.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using UnityEngine; @@ -51,8 +52,8 @@ public string EventName { /// /// The event value. public decimal EventValue { - get { return Decimal.Parse (eventValue); } - set { eventValue = value.ToString (); } + get { return Decimal.Parse(eventValue, CultureInfo.InvariantCulture); } + set { eventValue = value.ToString(CultureInfo.InvariantCulture); } } /// diff --git a/CHANGELOG.md b/CHANGELOG.md index b35e89d1..1d76c119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Unity Plugin ChangeLog +## Version 9.2.1 - February 5, 2024 + +Patch release that fixes an issue with decimal attribute values on certain locales. Apps that make use of attributes with decimal values should update. + +### Changes +- Fixed decimal attribute values for locales that use a comma as the decimal separator. + ## Version 9.2.0 - September 15, 2022 Minor release that updates to the latest SDK versions. diff --git a/airship.properties b/airship.properties index 3f14ffb7..a102dd3f 100644 --- a/airship.properties +++ b/airship.properties @@ -1,5 +1,5 @@ # Plugin version -version = 9.2.0 +version = 9.2.1 # Urban Airship iOS SDK version iosAirshipVersion = 16.9.3