Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Is that possible to fetch only one key value pair?

Discussion in 'Unity Remote Config' started by albertdzh, Oct 11, 2021.

  1. albertdzh

    albertdzh

    Joined:
    Apr 3, 2020
    Posts:
    5
    In my project, for example, i have two keys with values (in the remote config dashboard):
    1. "foo" - 123
    2. "bar" - 456

    When i call

    Code (CSharp):
    1. ConfigManager.FetchConfigs<userAttributes, appAttributes>(new userAttributes(), new appAttributes());
    Can i somehow specify wich exact key i'm intrested in? (for example i want to get only "foo" - 123 key value pair). Is that possible?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    It will retrieve all RC values. Can you describe your use case?
     
  3. albertdzh

    albertdzh

    Joined:
    Apr 3, 2020
    Posts:
    5
    My use case:

    I have multiple configs such as events.csv, rewards.csv, etc...
    I also have loaders for each of them.

    Instead of having RemoteConfig class which woud load all RC values at once, i want to load each RC value independently in the corresponding loader

    I'm doing so to eliminate any code dependencies, such as you must run fetchConfigs in RemoteConfig class before loading any other config files via loaders.

    But if you say, there is no way to fetch single RC values, okay, it will still do, thanks.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You could have one environment that only has the single value, then subsequently fetch from a separate environmentID for the remainder of the values.
     
  5. albertdzh

    albertdzh

    Joined:
    Apr 3, 2020
    Posts:
    5
    Wow, great idea! thanks, i will try that out.

    Btw, i tried to create environment, but could not find any button "Create Environment" or something. Even from unity Editor it's not working.
    https://gyazo.com/8c29f415a0e07eac16e6012d539a0307
    https://gyazo.com/164823fd55ad2d2166e12a78f8ab6e19

    I read forum post from the link in dashbord, it seems like remote config environment creation was sometimes unavaliable, thogh not shure if it's unavaliable now or i just doing something wrong.
    Any ideas how to properly create environment?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please ensure to be using Remote Config 2.1.2 or later