I noficed that when I run my game in Unity Editor, the callback for Remote Config is fired many times:
This is my configuration:
private void Awake ()
{
UnityServices.InitializeAsync();
TimeManager.RunDelayed(0.5f, () =>
{
RemoteConfigService.Instance.FetchCompleted += ApplyRemoteSettings;
RemoteConfigService.Instance.SetEnvironmentID(ENVIRONMENT_ID);
RemoteConfigService.Instance.FetchConfigs(new UserAttributes(), new AppAttributes());
});
}
private void ApplyRemoteSettings (ConfigResponse configResponse)
{
if (configResponse.requestOrigin == ConfigOrigin.Default) Debug.Log("[Remote Config] No settings loaded, using default values.");
else if (configResponse.requestOrigin == ConfigOrigin.Cached) Debug.Log("[Remote Config] No settings loaded, using cached values from a previous session.");
else if (configResponse.requestOrigin == ConfigOrigin.Remote) Debug.Log("[Remote Config] New settings loaded, updating the cache.");
UpdateSettings();
}
Any idea why is this happening?
I am using Unity 2021.3.28f1 with Remote Config 3.3.2.