I understand that there is a configType parameter that you can send to the FetchConfigs method to be able to differentiate upon more configs.
In my software I want to create a form of structure that splits the big remote config file into more, granular configs using this config type.
So : How do I create more config types? I can not seem to find anything in the WebUI.
Also, additional question : I can not seem to find a way to add a JEXL condition for a Game Override for customUserId.
I am using RemoteConfigService.Instance.SetCustomUserID() to set a custom userId and then in the JEXL : app.customUserId == "1234". But it’s not working for me. It is not a game override issue as with any other condition it works.
I wanted to use config types to be able to fetch different subsets of settings, not all settings at once.
Yes, I am organizing my Remote Config into granular json, but when I call FetchConfigs I don’t want to fetch everything in remote. I want to only fetch the keys that are part of a specific config type, but now that you’re telling me that it was created for internal use only, I guess this method is not gonna work.
Regarding fetching a subset of keys within the client : do you have maybe an example code to get me started? Thanks.
And one more question : Is there any way on the client to know when a Game Override updated a key? An event to which I can subscribe and which is getting triggered when a GameOverride changes value.
Regarding the JEXL question above, it looks like you may need to change the JEXL expression in the Game Override to user.customUserId == "1234" instead of app.customUserId == "1234". The method sets that specific attribute under user.
Regarding Game Overrides, could you clarify if your question is about changes made to Game Overrides themselves or about configuration changes for keys?
Game Overrides modify the configuration returned to the game client on a dynamic, per request basis for players belonging to selected Audiences or matching the desired JEXL expressions. In that sense, there is not a precise moment where the keys in the base configuration are modified.
Great answer on the JEXL issue. Will test and come back to you!
Regarding Game Overrides : My question was about changes made to keys.
I tested it like this : I fetched configs when I started the scene. Then, whenever I pressed a test button I would be fetching the keys again. Between the initial fetch and the button press fetch I would change the key value in the Game Override and when I pressed the button, I could see that I am getting the newly updated value, so Game Override works as intended even in the game.
But the problem is that I need to fetch the configuration for it to work. So from what you are saying there is no way to dynamically know from the client whenever I made a change of keys in the Unity Dashboard, right? And if this is true, would this ever be counted as a feature?
Additional Question : It is also related to the fetching of a subset of keys. Let’s assume I am running some dynamic events that I configured also with the Remote Config. For these events, I would really need to know if the configuration changes on the server much more often than for regular settings, so that means I would need to do FetchConfigs each time I need it. But the problem is that if I run a FetchConfigs method it will also fetch me ALL the settings I have in RemoteConfig, even though I might only need one JSON key out of the hundreds I have.
Your colleague suggested I would use the ClientAPI to fetch a subset of keys. Is this the correct approach if I want to only get some specific keys? If it is, do you have any example code for this?
Hey @alex11paulescu
Regarding fetching the subset of keys, we do have filtering feature
mentioned in the docs , but it is buried under other information and probably hard to find.
In short, you can fetch configuration settings using filter attributes, something like this:
On top of your script declare filterAttributes struct
public struct filterAttributes {
// Optionally declare variables for attributes to filter on any of following parameters:
public string[] key;
public string[] type;
public string[] schemaId;
}
then add it to your FetchConfigs() or FetchConfigsAsync() call, depending on your implementation
var fAttributes = new filterAttributes();
fAttributes.key = new string[] { "sword","cannon" };
RemoteConfigService.Instance.FetchConfigsAsync(new userAttributes(), new appAttributes(), fAttributes);
Bear in mind you can filter on key, type or schemaId.