update: 代码优化

Signed-off-by: huyufei <yufei.hu@castbox.fm>
胡宇飞 2024-08-07 23:50:12 +08:00
parent 1456a08003
commit 91e873880b
2 changed files with 4 additions and 24 deletions

View File

@ -32,23 +32,6 @@ namespace Guru
get => PlayerPrefs.GetInt(nameof(BPlay), 0);
set => PlayerPrefs.SetInt(nameof(BPlay), value);
}
/// <summary>
/// 首次启动时间
/// </summary>
public static string FirstOpenTime
{
get
{
var stamp = PlayerPrefs.GetString(nameof(FirstOpenTime), "");
if (string.IsNullOrEmpty(stamp))
{
stamp = TimeUtil.GetCurrentTimeStamp().ToString();
PlayerPrefs.SetString(nameof(FirstOpenTime), stamp);
}
return stamp;
}
}
#endregion

View File

@ -12,9 +12,8 @@ namespace Guru
public abstract class IAPServiceBase<T>: IStoreListener where T: IAPServiceBase<T> , new()
{
public static readonly int OrderRequestTimeout = 10;
public static readonly int OrderRequestRetryTimes = 3;
private const int OrderRequestTimeout = 10;
private const int OrderRequestRetryTimes = 3;
#region 属性定义
@ -802,8 +801,6 @@ namespace Guru
Debug.Log($"[IAP] --- Full receipt: \n{args.purchasedProduct.receipt}");
#endif
allReceipts = _validator.Validate(args.purchasedProduct.receipt);
// ---- Android 订单验证, 上报打点信息 ----
@ -920,11 +917,11 @@ namespace Guru
/// 标记是否为付费用户
/// </summary>
/// <param name="value"></param>
public static void SetIsIAPUser(bool value = true)
private static void SetIsIAPUser(bool value = true)
{
if (Instance != null && Instance._model != null && value)
{
Instance._model.SetIsIapUser(value); // 用户属性
Instance._model.SetIsIapUser(true); // 用户属性
}
Analytics.SetIsIapUser(value);
}