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 ---");