Search Unity

Remote Settings does not change values on device

Discussion in 'Unity Analytics' started by boorch, Oct 11, 2018.

  1. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    Hi!
    I've been experimenting with Remote Settings and (even though it worked flawlessly at some point, maybe a month ago) now it fails to update any values I've changed on the web interface.

    It seems to work flawlessly on Editor with Development values, but it does not work with iOS builds (of course with "Release" values)

    RemoteSettingsUpdateCompleted(Boolean, Boolean, Int32) gives this output on my Debug.Log:

    [Log] Was updated from server: True - Settings changed: False - Server response: 200

    Since it confirms the remote settings are updated from the server and they're unchanged (I suppose it outputs "false" if the values are the same, without any changes to the most recent settings) I suspect it does not even get the new values.

    In Editor, after I change a value and "sync" the Development values, RemoteSettingsUpdateCompleted outputs true, true, 200 and naturally I can see all the changes I made are there.

    It seems the problem is only on the build I run in the device.

    Any ideas?

    Cheers,
    Burç.

    Unity version: 2018.2.10f1
     
  2. josha_unity

    josha_unity

    Unity Technologies

    Joined:
    May 24, 2016
    Posts:
    1
    Hi Burç,

    I work on Remote Settings at Unity.

    It seems you caught us during a data migration we were doing behind the scenes. During this migration a percentage of devices may have been served older settings, assuming the developer made changes during the migration time (which is sounds like you were subject to).

    Please test again when you have an opportunity. If problems persist, please reach out to Unity Support, so we can get more details to investigate further.

    Thanks,
    Josh
     
  3. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    Hi Josh!
    I suspected this was something server-side as well. I can confirm the the settings are at least "received" now.
     
    Last edited: Oct 11, 2018
  4. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    Oh, even though the RemoteSettingsUpdateCompleted outputs (true, true, 200) the values do not seem to be changed/updated in the build (on device).

    Strangely, everything works perfectly in Editor.



    Further details of the project, in case you need:
    - There's a prefab called MainVariables that stores some variables tied to gameplay.
    - The prefab is present on multiple scenes
    - Project Settings/Serialization: Force text
    - The first scene is an intro/splash scene (without the MainVariables gameobject) I've setup RemoteSettings to ForceUpdate in this scene. I can confirm/output the settings are updated from server and changed (if anything is different from the local values, naturally) in this scene
    - After the intro, the main scene is loaded (which has the MainVariables gameobject) and I can see the settings get updated when I "play" the project (starting from the first scene) in Editor. I can confirm the settings don't get updated in the build tho.

    I setup the project thinking like this: Update values of MainVariables prefab in the intro scene, then when another scene that has the MainVariable object (not instanced at runtime, it's already included in the scene), the "instance" of MainVariable should have updated settings, since I've successfully updated the values stored in the prefab at the "intro" scene. I chose to do things this way since I've read that Scriptable Gameobjects are not compatible with Remote Settings, so I decided to store the values on a prefab (which is used in multiple scenes)

    Am I approaching this in the wrong way? (I think I don't since everything seems to work fine in the Editor, but I still suspect there may be something I'm not aware of, related to serialization of the MainVariables gameobject, specifically in builds)

    Edit: I can confirm the problem goes on with "Development Build" on device with Development category Remote Settings (outputting true, true). It seems like Remote Settings was able to retrieve changes on both Development or Release builds but cannot apply them to the prefab. It's like the settings have the default values of the MainVariables gameobjects on respective scenes.
     
    Last edited: Oct 11, 2018
  5. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    40
    Solved: It seems like the issue was using remote settings to change values on a prefab.

    We tried using a gameobject with DontDestroyOnLoad so it's persistent across scenes and sync the values at the first "intro" scene. Everything works as expected now. I still think it's strange that it all worked in Editor previously (when using a prefab).
     
    Last edited: Oct 12, 2018