diff --git a/Runtime/Code/Model/GuruSDKModel.cs b/Runtime/Code/Model/GuruSDKModel.cs index d21f20e..be9c302 100644 --- a/Runtime/Code/Model/GuruSDKModel.cs +++ b/Runtime/Code/Model/GuruSDKModel.cs @@ -31,7 +31,7 @@ namespace Guru public int b_play = 0; public int buy_count = 0; public bool no_ads = false; - public string first_open_time = GetFirstOpenTime(); + public string first_open_time = ""; public List purchased; @@ -97,7 +97,15 @@ namespace Guru } } - public string FirstOpenTime => first_open_time; + public string FirstOpenTime + { + get => first_open_time; + set + { + first_open_time = value; + Save(); + } + } public bool IsIapUser => PurchasedCount > 0; diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 8af4b45..7fe949f 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -395,6 +395,11 @@ namespace Guru public static void SetFirstOpenTime(string timestamp) { + if (string.IsNullOrEmpty(timestamp)) + { + timestamp = IPMConfig.FIRST_OPEN_TIME; + Model.FirstOpenTime = timestamp; + } SetUserProperty(Analytics.PropertyFirstOpenTime, timestamp); } @@ -431,7 +436,7 @@ namespace Guru if (_hasUserPropertiesInitiallyUpdated) return; _hasUserPropertiesInitiallyUpdated = true; - SetFirstOpenTime(Model?.FirstOpenTime ?? GuruSDKModel.GetFirstOpenTime()); // first_open_time + SetFirstOpenTime(Model?.FirstOpenTime ?? ""); // first_open_time SetUserIsIAP(Model?.IsIapUser ?? false); // is_iap_user SetUserBLevel(Model?.SuccessLevelId ?? 0); // b_level SetUserBLevel(Model?.TotalPlayedCount ?? 0); // b_play