From 0472bc2d987e8cb8f21c3f9b1e94dc0443d1bf88 Mon Sep 17 00:00:00 2001 From: huyfei Date: Wed, 31 Jan 2024 12:54:03 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=B7=BB=E5=8A=A0=20using=5Fuuid=20?= =?UTF-8?q?=E5=92=8C=E4=BA=91=E6=8E=A7=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Code/Config/GuruServicesConfig.cs | 1 + Runtime/Code/SDK/GuruSDK.cs | 65 +++++++++++++---------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/Runtime/Code/Config/GuruServicesConfig.cs b/Runtime/Code/Config/GuruServicesConfig.cs index bfbf020..f79c368 100644 --- a/Runtime/Code/Config/GuruServicesConfig.cs +++ b/Runtime/Code/Config/GuruServicesConfig.cs @@ -59,6 +59,7 @@ namespace Guru public bool enable_adjust = true; public bool enable_iap = false; public double tch020_val = 0; + public bool using_uuid = false; } [Serializable] diff --git a/Runtime/Code/SDK/GuruSDK.cs b/Runtime/Code/SDK/GuruSDK.cs index 24801aa..c418821 100644 --- a/Runtime/Code/SDK/GuruSDK.cs +++ b/Runtime/Code/SDK/GuruSDK.cs @@ -195,7 +195,7 @@ namespace Guru private void SetupServicesConfig() { - bool useKeywords = true; + bool useKeywords = false; bool useIAP = true; var services = GetRemoteServicesConfig(); @@ -203,45 +203,54 @@ namespace Guru { _appServicesConfig = services; useKeywords = _appServicesConfig.IsKeywordsEnabled(); - - if (null != GuruSettings) - { - if(_appServicesConfig.adjust_settings != null) - { - // 更新 Adjust Tokens - GuruSettings.UpdateAdjustTokens(_appServicesConfig.adjust_settings.AndroidToken - ,_appServicesConfig.adjust_settings.iOSToken); - // 更新 Adjust Events - GuruSettings.UpdateAdjustEvents(_appServicesConfig.adjust_settings.events); - } - } useIAP = _appServicesConfig.IsIAPEnabled(); - - if (_appServicesConfig.app_settings != null) + + + if (null != _appServicesConfig.adjust_settings && null != GuruSettings) + { + // 更新 Adjust Tokens + GuruSettings.UpdateAdjustTokens(_appServicesConfig.adjust_settings.AndroidToken + , _appServicesConfig.adjust_settings.iOSToken); + // 更新 Adjust Events + GuruSettings.UpdateAdjustEvents(_appServicesConfig.adjust_settings.events); + } + + if (null != _appServicesConfig.app_settings) { if (_appServicesConfig.app_settings.tch020_val > 0) { Analytics.EnableTch02Event = true; Analytics.SetTch02TargetValue(_appServicesConfig.app_settings.tch020_val); } - - // 更新和升级 GuruSettings 对应的值 - GuruSettings.UpdateAppSettings( - _appServicesConfig.app_settings.bundle_id, - _appServicesConfig.fb_settings.fb_app_id, - _appServicesConfig.app_settings.support_email, - _appServicesConfig.app_settings.privacy_url, - _appServicesConfig.app_settings.terms_url, - _appServicesConfig.app_settings.android_store, - _appServicesConfig.app_settings.ios_store); + + // 设置获取设备 UUID 的方法 + if (_appServicesConfig.app_settings.using_uuid) + { + IPMConfig.UsingUUID = true; // 开始使用 UUID 作为 DeviceID 标识 + } + + if (null != GuruSettings) + { + // 更新和升级 GuruSettings 对应的值 + GuruSettings.UpdateAppSettings( + _appServicesConfig.app_settings.bundle_id, + _appServicesConfig.fb_settings?.fb_app_id ?? "", + _appServicesConfig.app_settings.support_email, + _appServicesConfig.app_settings.privacy_url, + _appServicesConfig.app_settings.terms_url, + _appServicesConfig.app_settings.android_store, + _appServicesConfig.app_settings.ios_store); + } } } - if(useIAP) { + if (useIAP) + { InitIAP(_initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP } - - if(useKeywords) { + + if (useKeywords) + { KeywordsManager.Install(Model.IsIAPUser, Model.SuccessLevelCount); // 启动Keyword管理器 } }