+ Add First open time user-property

deeplink
胡宇飞 2024-05-11 10:28:58 +08:00
parent 2cc9d66aa1
commit cd3c53d674
3 changed files with 17 additions and 13 deletions

View File

@ -309,18 +309,7 @@ namespace Guru
SetUserProperty("sdk_version", Version); SetUserProperty("sdk_version", Version);
} }
private static void LogFirebaseDeps(bool success)
{
Analytics.Track(Consts.EventSDKInfo, new Dictionary<string, dynamic>()
{
{ Consts.ParameterItemName, $"fbs_done_{(success ? "true" : "false")}" },
}, new Analytics.EventSetting()
{
EnableFirebaseAnalytics = true,
});
}
#endregion #endregion
#region 经济打点 #region 经济打点

View File

@ -113,10 +113,22 @@ namespace Guru
public static void Init(GuruSDKInitConfig config, Action<bool> onComplete) public static void Init(GuruSDKInitConfig config, Action<bool> onComplete)
{ {
_initTime = DateTime.Now.ToUniversalTime(); _initTime = DateTime.Now.ToUniversalTime();
// ----- First Open Time -----
Analytics.SetUserProperty(Analytics.FirstOpenTime, GetFirstOpenTime());
LogI($"#1 ---- Guru SDK [{Version}] ----\n{config.ToString()}"); LogI($"#1 ---- Guru SDK [{Version}] ----\n{config.ToString()}");
Instance.StartWithConfig(config, onComplete); Instance.StartWithConfig(config, onComplete);
} }
private static string GetFirstOpenTime()
{
string firstOpenTime = IPMConfig.FirstOpenTime;
if (string.IsNullOrEmpty(firstOpenTime))
{
firstOpenTime = TimeUtil.GetCurrentTimeStamp().ToString();
IPMConfig.FirstOpenTime = firstOpenTime;
}
return firstOpenTime;
}
/// <summary> /// <summary>
/// 启动SDK /// 启动SDK
@ -162,7 +174,9 @@ namespace Guru
IsInitialSuccess = true; IsInitialSuccess = true;
_onCompleteCallback?.Invoke(true); _onCompleteCallback?.Invoke(true);
} }
private void OnUserAuthResult(bool success) private void OnUserAuthResult(bool success)
{ {
if (success && string.IsNullOrEmpty(IPMConfig.IPM_UID)) if (success && string.IsNullOrEmpty(IPMConfig.IPM_UID))

View File

@ -26,7 +26,8 @@ namespace Guru.Debug.Tests
$"receipt_{i}", $"receipt_{i}",
$"order_id_{i}", $"order_id_{i}",
DateTime.Now.ToString("g"), DateTime.Now.ToString("g"),
level)); level,
"RMB", 6.99d, "Store"));
level++; level++;
} }