From 75909ccc1b2fb189bdcddcf4c7b0dd5e41336493 Mon Sep 17 00:00:00 2001 From: huyufei Date: Sun, 7 Apr 2024 16:17:46 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=20GuruSDK=20?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E5=B1=9E=E6=80=A7=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Code/SDK/GuruSDK.Analytics.cs | 18 ++++++++++++++++++ Runtime/Code/SDK/GuruSDK.cs | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 83f9988..17e6c7e 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -206,6 +206,24 @@ namespace Guru #region 用户属性 + /// + /// 提前调用用户属性 + /// + private static void InitUserProperties() + { + if (!IsInitialSuccess) + { + Debug.LogError($"{Tag} :: InitUserProperties :: Please call first, before you call ."); + return; + } + + SetUserIsIAP(Model.IsIAPUser); // 预先设置用户的 IAP User 属性 + SetUserBLevel(Model.SuccessLevelId); // 预先设置用户的 BLevel 属性 + SetUserBPlay(Model.TotalPlayedCount); // 预先设置用户的 BPlay 属性 + } + + + /// /// 设置用户属性 /// diff --git a/Runtime/Code/SDK/GuruSDK.cs b/Runtime/Code/SDK/GuruSDK.cs index cb14943..7e07931 100644 --- a/Runtime/Code/SDK/GuruSDK.cs +++ b/Runtime/Code/SDK/GuruSDK.cs @@ -227,7 +227,9 @@ namespace Guru /// private void InitAllServices() { - SetUserIsIAP(Model.IsIAPUser); // 预先设置用户的 IAP User 属性 + //-------- SetUserProperties --------- + InitUserProperties(); + bool useKeywords = false; bool useIAP = _initConfig.IAPEnabled;