fix: 启动默认上报用户的 is_iap_user 属性

deeplink
胡宇飞 2024-04-03 12:47:25 +08:00
parent 93935f87c4
commit faa8692667
2 changed files with 12 additions and 5 deletions

View File

@ -266,6 +266,10 @@ namespace Guru
SetUserProperty(Analytics.PropertyGrade, $"{grade}");
}
public static void SetUserIsIAP(bool isIapUser)
{
SetUserProperty(Analytics.PropertyIsIAPUser, isIapUser? "true" : "false");
}
#endregion

View File

@ -227,10 +227,13 @@ namespace Guru
/// </summary>
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 ---");