From 9b4870c91a58cfb44586fa8d3c63ac0911e1a5c8 Mon Sep 17 00:00:00 2001 From: huyufei Date: Fri, 17 May 2024 10:28:27 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=B7=BB=E5=8A=A0=20IsIapUser=20?= =?UTF-8?q?=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- Runtime/GuruIAP/Runtime/Code/IAPModel.cs | 13 ++++++++++--- Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Runtime/GuruIAP/Runtime/Code/IAPModel.cs b/Runtime/GuruIAP/Runtime/Code/IAPModel.cs index 1be7382..5bf90ee 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPModel.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPModel.cs @@ -7,6 +7,7 @@ namespace Guru using System; using Newtonsoft.Json; + [Serializable] public class IAPModel { public static readonly float SaveInterval = 3; @@ -14,7 +15,8 @@ namespace Guru public static readonly string PlatformAndroid = "android"; public static readonly string PlatformIOS = "ios"; - + + public bool isIapUser = false; public int buyCount = 0; public List androidTokens; public List 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 diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index 696833a..07f359e 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -881,6 +881,7 @@ namespace Guru /// public static void SetIsIAPUser(bool value = true) { + Instance._model.SetIsIapUser(value); // 用户属性 Analytics.SetUserProperty(Analytics.PropertyIsIAPUser, value ? "true" : "false"); }