From faa86926676cb533d2febefbc2807976be313e2e Mon Sep 17 00:00:00 2001 From: huyufei Date: Wed, 3 Apr 2024 12:47:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=AF=E5=8A=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E7=94=A8=E6=88=B7=E7=9A=84=20is=5Fiap=5Fuser?= =?UTF-8?q?=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Code/SDK/GuruSDK.Analytics.cs | 8 ++++++-- Runtime/Code/SDK/GuruSDK.cs | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 49c62f6..83f9988 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -265,8 +265,12 @@ namespace Guru { SetUserProperty(Analytics.PropertyGrade, $"{grade}"); } - - + + public static void SetUserIsIAP(bool isIapUser) + { + SetUserProperty(Analytics.PropertyIsIAPUser, isIapUser? "true" : "false"); + } + #endregion #region SDK 打点 diff --git a/Runtime/Code/SDK/GuruSDK.cs b/Runtime/Code/SDK/GuruSDK.cs index b345216..cb14943 100644 --- a/Runtime/Code/SDK/GuruSDK.cs +++ b/Runtime/Code/SDK/GuruSDK.cs @@ -227,10 +227,13 @@ namespace Guru /// private void InitAllServices() { + SetUserIsIAP(Model.IsIAPUser); // 预先设置用户的 IAP User 属性 + bool useKeywords = false; bool useIAP = _initConfig.IAPEnabled; bool appleReview = false; + //----------- Set GuruServices ---------------- var services = GetRemoteServicesConfig(); if (services != null) { @@ -301,7 +304,7 @@ namespace Guru } - + //----------- Set IAP ---------------- if (useIAP) { // InitIAP(_initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP @@ -313,9 +316,8 @@ namespace Guru { Debug.LogError($"--- ERROR on useIAP: {ex.Message}"); }); - } - + //----------- Set Keywords ---------------- if (useKeywords) { // KeywordsManager.Install(Model.IsIAPUser, Model.SuccessLevelId); // 启动Keyword管理器 @@ -344,6 +346,7 @@ namespace Guru return; } #endif + //----------- Set Consent ---------------- if (!InitConfig.UseCustomConsent && !appleReview) { // LogI($"--- #3 Start Consent Flow ---");