diff --git a/Assets/Countly/Example/Scripts/UserDetail.cs b/Assets/Countly/Example/Scripts/UserDetail.cs index b27e56cc..19203f91 100644 --- a/Assets/Countly/Example/Scripts/UserDetail.cs +++ b/Assets/Countly/Example/Scripts/UserDetail.cs @@ -30,12 +30,11 @@ public async void SetUserDetail() public async void SetCustomUserDetail() { - Dictionary userCustomDetail = null; - - Countly.Instance.UserDetails.SetCustomUserDetails(userCustomDetail); - userCustomDetail = new Dictionary { + Dictionary userCustomDetail = new Dictionary { { "Language", "English" }, { "Height", "5.9" }, + { "Empty Value", "" }, // valid + { "Null Value", null } // invalid }; Countly.Instance.UserDetails.SetCustomUserDetails(userCustomDetail); @@ -46,56 +45,48 @@ public async void SetPropertyOnce() { Countly.Instance.UserDetails.SetOnce("Distance", "10KM"); await Countly.Instance.UserDetails.SaveAsync(); - } public async void IncrementValue() { Countly.Instance.UserDetails.Increment("Weight"); await Countly.Instance.UserDetails.SaveAsync(); - } public async void IncrementBy() { Countly.Instance.UserDetails.IncrementBy("ShoeSize", 2); await Countly.Instance.UserDetails.SaveAsync(); - } public async void Multiply() { Countly.Instance.UserDetails.Multiply("PetNumber", 2); await Countly.Instance.UserDetails.SaveAsync(); - } public async void Max() { Countly.Instance.UserDetails.Max("TravelDistance", 90); await Countly.Instance.UserDetails.SaveAsync(); - } public async void Min() { Countly.Instance.UserDetails.Min("YearsExperience", 10); await Countly.Instance.UserDetails.SaveAsync(); - } public async void Push() { Countly.Instance.UserDetails.Push("Area", new string[] { "width", "height" }); await Countly.Instance.UserDetails.SaveAsync(); - } public async void PushUnique() { Countly.Instance.UserDetails.PushUnique("Mole", new string[] { "Left Cheek", "Right Cheek" }); await Countly.Instance.UserDetails.SaveAsync(); - } public async void Pull() @@ -103,7 +94,6 @@ public async void Pull() //Remove one or many values Countly.Instance.UserDetails.Pull("Cat", new string[] { "Claw" }); await Countly.Instance.UserDetails.SaveAsync(); - } public async void RecordMultiple() @@ -113,6 +103,5 @@ public async void RecordMultiple() Countly.Instance.UserDetails.SetOnce("FavoriteColor", "Blue"); Countly.Instance.UserDetails.Push("Inventory", new string[] { "Sword", "Shield", "Armor" }); await Countly.Instance.UserDetails.SaveAsync(); - } } diff --git a/Assets/Countly/Plugins/CountlySDK/Services/AbstractBaseService.cs b/Assets/Countly/Plugins/CountlySDK/Services/AbstractBaseService.cs index 8f4c6d86..e8627d6a 100644 --- a/Assets/Countly/Plugins/CountlySDK/Services/AbstractBaseService.cs +++ b/Assets/Countly/Plugins/CountlySDK/Services/AbstractBaseService.cs @@ -102,7 +102,12 @@ protected IDictionary FixSegmentKeysAndValues(IDictionary