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管理器 } }