update: add custom guru-service key

deeplink
胡宇飞 2024-03-11 18:51:49 +08:00
parent 6275afac9b
commit d17a6e2eae
2 changed files with 19 additions and 2 deletions

View File

@ -24,6 +24,10 @@ namespace Guru
/// </summary> /// </summary>
public bool AutoRecordFinishedLevels = true; public bool AutoRecordFinishedLevels = true;
/// <summary> /// <summary>
/// 自定义 Service 云控 Key
/// </summary>
public string CustomServiceKey = "";
/// <summary>
/// Debug模式默认关闭 /// Debug模式默认关闭
/// </summary> /// </summary>
public bool DebugMode = false; public bool DebugMode = false;

View File

@ -207,6 +207,9 @@ namespace Guru
#region App Remote Update #region App Remote Update
/// <summary>
/// Apply Cloud guru-service configs for sdk assets
/// </summary>
private void SetupServicesConfig() private void SetupServicesConfig()
{ {
bool useKeywords = false; bool useKeywords = false;
@ -333,10 +336,20 @@ namespace Guru
}); });
} }
} }
/// <summary>
/// Get the guru-service cloud config value;
/// User can fetch the cloud guru-service config by using Custom Service Key
/// </summary>
/// <returns></returns>
private GuruServicesConfig GetRemoteServicesConfig() private GuruServicesConfig GetRemoteServicesConfig()
{ {
var json = GetRemoteString(ServicesConfigKey); string key = ServicesConfigKey;
if (!string.IsNullOrEmpty(_initConfig.CustomServiceKey))
{
key = _initConfig.CustomServiceKey;
}
var json = GetRemoteString(key);
if (!string.IsNullOrEmpty(json)) if (!string.IsNullOrEmpty(json))
{ {
return JsonParser.ToObject<GuruServicesConfig>(json); return JsonParser.ToObject<GuruServicesConfig>(json);