Hi, i’m currently use Remote Config for my game. It’s work, but have some bugs what i found here:
1/ Dupplicate trigger FetchCompleted
// Use this for initialization
protected override void Awake()
{
base.Awake();
// Add a listener to apply settings when successfully retrieved:
ConfigManager.FetchCompleted += ApplyRemoteSettings;
// Fetch configuration setting from the remote service:
ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes()
{
});
}
void ApplyRemoteSettings(ConfigResponse configResponse)
{
// Conditionally update settings, depending on the response's origin:
switch (configResponse.requestOrigin)
{
case ConfigOrigin.Default:
Debug.Log("ConfigOrigin.Default:");
break;
case ConfigOrigin.Cached:
Debug.Log("ConfigOrigin.Cached");
break;
case ConfigOrigin.Remote:
Debug.Log("ConfigOrigin.Remote");
break;
}
}
Results on editor and real devices:
ConfigOrigin.Cached
ConfigOrigin.Remote
2. Settings is empty on ConfigOrigin.Remote:
// Use this for initialization
protected override void Awake()
{
base.Awake();
// Add a listener to apply settings when successfully retrieved:
ConfigManager.FetchCompleted += ApplyRemoteSettings;
// Fetch configuration setting from the remote service:
ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes()
{
});
}
void ApplyRemoteSettings(ConfigResponse configResponse)
{
// Conditionally update settings, depending on the response's origin:
switch (configResponse.requestOrigin)
{
case ConfigOrigin.Default:
Debug.Log("ConfigOrigin.Default:");
break;
case ConfigOrigin.Cached:
Debug.Log("ConfigOrigin.Cached");
break;
case ConfigOrigin.Remote:
if(ConfigManager.appConfig.GetKeys().Length <= 0)
Debug.LogError("Keys not found! " );
break;
}
}
Results on editor and real devices:
1st: No error
2nd: No error
3rd: Keys not found!
It's not frequently