Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Any scenarios when configResponse.requestOrigin is NOT ConfigOrigin.Remote?

Discussion in 'Unity Remote Config' started by krisventure, May 23, 2021.

  1. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    We've just noticed that in our released app we haven't even implemented the cases ConfigOrigin.Default and ConfigOrigin.Cached in our FetchCompleted callback.

    In our code you can only proceed to start the game if remote config returns ConfigOrigin.Remote. This was unintended and we're worried if this would block some users from playing but so far, surprisingly, even in flight mode without network we always reach the ConfigOrigin.Remote case and the game starts fine.

    So we've probably misunderstood this, we thought it would used cached values if, for example due to no internet, it cannot reach the remote server. But this is not true apparently.

    So under what circumstances would it happen, if ever, that case ConfigOrigin.Remote is not true?

    Here is the snippet from the Remote Config sample code that I'm referring to:

    Code (CSharp):
    1. void ApplyRemoteSettings (ConfigResponse configResponse) {
    2.        // Conditionally update settings, depending on the response's origin:
    3.        switch (configResponse.requestOrigin) {
    4.            case ConfigOrigin.Default:
    5.                Debug.Log ("No settings loaded this session; using default values.");
    6.                break;
    7.            case ConfigOrigin.Cached:
    8.                Debug.Log ("No settings loaded this session; using cached values from a previous session.");
    9.                break;
    10.            case ConfigOrigin.Remote:
    11.                Debug.Log ("New settings loaded this session; update values accordingly.");

    @JeffDUnity3D
    @markychoi
     
    Last edited: May 23, 2021
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Known issue. Cached goes to the Remote case, and is why your game is working. Why would you require Remote? If they have played before, they will have cached values that should allow them to play the game.
     
  3. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    Thank you for your reply. No we didn't mean to require remote we just forgot to implement the other two cases and released a version like that but seeing that it'll route it to the remote case either way we won't even have to push a fix so great then. And the cached value is a great thing!
    Everything alright than.