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.

Question Changing key values through script

Discussion in 'Unity Remote Config' started by RedTShirtGaming, May 3, 2022.

  1. RedTShirtGaming

    RedTShirtGaming

    Joined:
    Mar 10, 2021
    Posts:
    3
    Hi!
    Using remote config, is there a way of changing key values through a C# script?
    Thanks. :)
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm checking on this for you, and will follow up.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  4. RedTShirtGaming

    RedTShirtGaming

    Joined:
    Mar 10, 2021
    Posts:
    3
    Thank you. I'll try and add this to my project and see what it does. Are you able to suggest any videos that explain what to do? :)
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    A Google search for "rest api from c# video" should do the trick!
     
  6. RedTShirtGaming

    RedTShirtGaming

    Joined:
    Mar 10, 2021
    Posts:
    3
    Found some videos! Thank you for your help :)
     
  7. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    That isn't technically true, all the necessary tools to achieve it are there, someone just didn't bother to write any comments to any of the methods in the RemoteConfigWindowController.cs, RemoteConfigDataStore.cs, RemoteConfigWebApiClient.cs or in the RemoteConfig documentation, in any sense of the word.

    I figured out how to use it most of the way down, got the service to accept my custom JArray's formatting now, but the next hurdle is something that is pure greek to me, upon POSTing my custom keyvalue with RemoteConfigWebApiClient.PostConfig(params) i get this as a response:

    Code (CSharp):
    1. Failed to push remote config: HTTP/1.1 400 Bad Request
    2. Supplied config type already exists.
    3.  
    Would greatly appreciate if you could elucidate what the issue is with that.
     
    Last edited: Oct 1, 2022