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>
public bool AutoRecordFinishedLevels = true;
/// <summary>
/// 自定义 Service 云控 Key
/// </summary>
public string CustomServiceKey = "";
/// <summary>
/// Debug模式默认关闭
/// </summary>
public bool DebugMode = false;

View File

@ -207,6 +207,9 @@ namespace Guru
#region App Remote Update
/// <summary>
/// Apply Cloud guru-service configs for sdk assets
/// </summary>
private void SetupServicesConfig()
{
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()
{
var json = GetRemoteString(ServicesConfigKey);
string key = ServicesConfigKey;
if (!string.IsNullOrEmpty(_initConfig.CustomServiceKey))
{
key = _initConfig.CustomServiceKey;
}
var json = GetRemoteString(key);
if (!string.IsNullOrEmpty(json))
{
return JsonParser.ToObject<GuruServicesConfig>(json);