update: 添加 IsIapUser 的属性

Signed-off-by: huyufei <yufei.hu@castbox.fm>
deeplink
胡宇飞 2024-05-17 10:28:27 +08:00
parent b728102800
commit 9b4870c91a
2 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@ namespace Guru
using System;
using Newtonsoft.Json;
[Serializable]
public class IAPModel
{
public static readonly float SaveInterval = 3;
@ -15,6 +16,7 @@ namespace Guru
public static readonly string PlatformAndroid = "android";
public static readonly string PlatformIOS = "ios";
public bool isIapUser = false;
public int buyCount = 0;
public List<string> androidTokens;
public List<string> iosReceipts;
@ -219,12 +221,17 @@ namespace Guru
set
{
buyCount = value;
if (buyCount > 0 && isIapUser == false) isIapUser = true;
Save();
}
}
public void SetIsIapUser(bool isIap)
{
isIapUser = isIap;
Save();
}
#endregion

View File

@ -881,6 +881,7 @@ namespace Guru
/// <param name="value"></param>
public static void SetIsIAPUser(bool value = true)
{
Instance._model.SetIsIapUser(value); // 用户属性
Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false");
}