diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs
index b3866f3..47bd7df 100644
--- a/Runtime/Code/SDK/GuruSDK.Analytics.cs
+++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs
@@ -123,7 +123,7 @@ namespace Guru
/// 扩展数据
public static void LogLevelEnd(int levelId, string result = EventLevelEndSuccess,
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
- int? duration = null, int? step = null, int? score = null, Dictionary extra = null )
+ int duration = 0, int? step = null, int? score = null, Dictionary extra = null )
{
if (!IsInitialSuccess)
{
@@ -171,7 +171,7 @@ namespace Guru
///
public static void LogLevelFail(int levelId,
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
- int? duration = null, int? step = null, int? score = null , Dictionary extra = null)
+ int duration = 0, int? step = null, int? score = null , Dictionary extra = null)
{
LogLevelEnd(levelId, EventLevelEndFail, levelType, levelName, puzzleId, duration, step, score, extra);
}
@@ -181,7 +181,7 @@ namespace Guru
///
public static void LogLevelFailExit(int levelId,
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
- int? duration = null, int? step = null, int? score = null, Dictionary extra = null)
+ int duration = 0, int? step = null, int? score = null, Dictionary extra = null)
{
LogLevelEnd(levelId, EventLevelEndExit, levelType, levelName, puzzleId, duration, step, score, extra);
}
@@ -191,7 +191,7 @@ namespace Guru
///
public static void LogLevelFailTimeout(int levelId,
string levelType = LevelTypeMain, string levelName = "", string puzzleId = "",
- int? duration = null, int? step = null, int? score = null, Dictionary extra = null)
+ int duration = 0, int? step = null, int? score = null, Dictionary extra = null)
{
LogLevelEnd(levelId, EventLevelEndTimeout, levelType, levelName, puzzleId, duration, step, score, extra);
}
@@ -286,17 +286,17 @@ namespace Guru
public static void SetUID(string uid)
{
- SetUserProperty(Analytics.PropertyUserID, uid);
+ SetUserProperty(Consts.PropertyUserID, uid);
}
public static void SetUserBLevel(int blevel)
{
- SetUserProperty(Analytics.PropertyLevel, $"{blevel}");
+ SetUserProperty(Consts.PropertyLevel, $"{blevel}");
}
public static void SetUserBPlay(int bplay)
{
- SetUserProperty(Analytics.PropertyPlay, $"{bplay}");
+ SetUserProperty(Consts.PropertyPlay, $"{bplay}");
}
///
@@ -305,7 +305,7 @@ namespace Guru
///
public static void SetUserTotalCoins(int totalCoins)
{
- SetUserProperty(Analytics.PropertyCoin, $"{totalCoins}");
+ SetUserProperty(Consts.PropertyCoin, $"{totalCoins}");
}
///
@@ -314,7 +314,7 @@ namespace Guru
///
public static void SetUserFreeCoins(int freeCoins)
{
- SetUserProperty(Analytics.PropertyNonIAPCoin, $"{freeCoins}");
+ SetUserProperty(Consts.PropertyNonIAPCoin, $"{freeCoins}");
}
///
@@ -323,33 +323,44 @@ namespace Guru
///
public static void SetUserPaidCoins(int paidCoins)
{
- SetUserProperty(Analytics.PropertyIAPCoin, $"{paidCoins}");
+ SetUserProperty(Consts.PropertyIAPCoin, $"{paidCoins}");
}
public static void SetUserExp(int exp)
{
- SetUserProperty(Analytics.PropertyExp, $"{exp}");
+ SetUserProperty(Consts.PropertyExp, $"{exp}");
}
public static void SetUserHp(int hp)
{
- SetUserProperty(Analytics.PropertyHp, $"{hp}");
+ SetUserProperty(Consts.PropertyHp, $"{hp}");
}
public static void SetUserGrade(int grade)
{
- SetUserProperty(Analytics.PropertyGrade, $"{grade}");
+ SetUserProperty(Consts.PropertyGrade, $"{grade}");
}
public static void SetUserIsIAP(bool isIapUser)
{
- SetUserProperty(Analytics.PropertyIsIAPUser, isIapUser? "true" : "false");
+ SetUserProperty(Consts.PropertyIsIAPUser, isIapUser? "true" : "false");
}
public static void SetFirstOpenTime(string timestamp)
{
SetUserProperty(Analytics.PropertyFirstOpenTime, timestamp);
}
+
+ public static void SetNotiPerm(string status)
+ {
+ SetUserProperty(Consts.PropertyNotiPerm, status);
+ }
+
+ public static void SetATTStatus(string status)
+ {
+ SetUserProperty(Consts.PropertyATTStatus, status);
+ }
+
///
/// 初始化时调用一下所有的属性打点
@@ -395,11 +406,11 @@ namespace Guru
#if UNITY_IOS
if(!HasUserPropertyKey(Consts.PropertyATTStatus))
- SetUserProperty(Consts.PropertyATTStatus, "notDetermined");
+ SetATTStatus("notDetermined"); // att_status
#endif
if(!HasUserPropertyKey(Consts.PropertyNotiPerm))
- SetUserProperty(Consts.PropertyNotiPerm, "not_determined");
+ SetNotiPerm("not_determined"); // noti_perm
}
@@ -454,11 +465,11 @@ namespace Guru
///
- /// 当付费页面打开时调用
+ /// 当付费页面打开时调用 iap_imp
///
- /// 付费页面名称, 默认为 Store
+ /// 付费页场景名称
/// 列表中首个商品的 ProductId
- public static void OnIAPPageOpen(string scene = "Store", string productId = "")
+ public static void OnIAPImp(string scene, string productId = "")
{
if (string.IsNullOrEmpty(productId))
{
@@ -468,11 +479,11 @@ namespace Guru
}
///
- /// 当付费页面关闭时调用
+ /// 当付费页面关闭时调用 iap_close
///
///
///
- public static void OnIAPPageClose(string scene = "Store", string productId = "")
+ public static void OnIAPClose(string scene, string productId = "")
{
if (string.IsNullOrEmpty(productId))
{
@@ -483,7 +494,7 @@ namespace Guru
}
///
- /// 当点击 IAP 商品按钮的时候调用
+ /// 当点击 IAP 商品按钮的时候调用 iap_clk
///
///
///
@@ -852,7 +863,7 @@ namespace Guru
#endregion
-
+
#region Crashlytics 接口
public static void CrashLog(string message)