update: 代码优化
Signed-off-by: huyufei <yufei.hu@castbox.fm>
parent
1456a08003
commit
91e873880b
|
|
@ -32,23 +32,6 @@ namespace Guru
|
||||||
get => PlayerPrefs.GetInt(nameof(BPlay), 0);
|
get => PlayerPrefs.GetInt(nameof(BPlay), 0);
|
||||||
set => PlayerPrefs.SetInt(nameof(BPlay), value);
|
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
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,9 @@ namespace Guru
|
||||||
|
|
||||||
public abstract class IAPServiceBase<T>: IStoreListener where T: IAPServiceBase<T> , new()
|
public abstract class IAPServiceBase<T>: IStoreListener where T: IAPServiceBase<T> , new()
|
||||||
{
|
{
|
||||||
|
private const int OrderRequestTimeout = 10;
|
||||||
|
private const int OrderRequestRetryTimes = 3;
|
||||||
|
|
||||||
public static readonly int OrderRequestTimeout = 10;
|
|
||||||
public static readonly int OrderRequestRetryTimes = 3;
|
|
||||||
|
|
||||||
#region 属性定义
|
#region 属性定义
|
||||||
|
|
||||||
private const string Tag = "[IAP]";
|
private const string Tag = "[IAP]";
|
||||||
|
|
@ -802,8 +801,6 @@ namespace Guru
|
||||||
Debug.Log($"[IAP] --- Full receipt: \n{args.purchasedProduct.receipt}");
|
Debug.Log($"[IAP] --- Full receipt: \n{args.purchasedProduct.receipt}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
allReceipts = _validator.Validate(args.purchasedProduct.receipt);
|
allReceipts = _validator.Validate(args.purchasedProduct.receipt);
|
||||||
|
|
||||||
// ---- Android 订单验证, 上报打点信息 ----
|
// ---- Android 订单验证, 上报打点信息 ----
|
||||||
|
|
@ -920,11 +917,11 @@ namespace Guru
|
||||||
/// 标记是否为付费用户
|
/// 标记是否为付费用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value"></param>
|
/// <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)
|
if (Instance != null && Instance._model != null && value)
|
||||||
{
|
{
|
||||||
Instance._model.SetIsIapUser(value); // 用户属性
|
Instance._model.SetIsIapUser(true); // 用户属性
|
||||||
}
|
}
|
||||||
Analytics.SetIsIapUser(value);
|
Analytics.SetIsIapUser(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue