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.

FetchConfigs Problem

Discussion in 'Unity Remote Config' started by jvt619, Oct 6, 2019.

  1. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    Using fetchconfigs seems to be fine on development but on release it doesn't seem to get the user attributes/app attributes which makes the rules useless.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you provide your steps to reproduce, you mention "seems to", can you confirm?
     
  3. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    Code (CSharp):
    1. public void Start()
    2. {
    3.      ConfigManager.FetchCompleted += ApplyRemoteSettings;
    4.      ConfigManager.FetchConfigs(PlayerManager.Instance.userAttributes, PlayerManager.Instance.appAttributes);
    5. }
    Code (CSharp):
    1. public struct UserAttributes
    2. {
    3.     public bool isStarter;
    4. }
    5. public struct AppAttributes
    6. {
    7.     public string appVersion;
    8. }
    The condition of one of the release rules which is user.isStarter=="true" always returns a false even though the default value of isStarter is true. However, removing the condition of the rule works perfectly fine. What errors did I make that on Development it works fine but on release it doesn't?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for the information, I will test and follow up here.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    The Release settings worked for me with my isStarter rule. Could you post a screenshot of your Release settings? Also, please show your ApplyRemoteSettings code. I am building with Unity 2019 to PC Standalone, and checking/unchecking Development build to compare my builds. I write debug info to a Text UI element with this code:
    Code (CSharp):
    1. private static Text myText;
    2.  
    3.     // Start is called before the first frame update
    4.     void Start()
    5.     {
    6.         myText = GameObject.Find("MyText").GetComponent<Text>();
    7. ...
    and
    Code (CSharp):
    1. private void MyDebug(string debug)
    2.     {
    3.         Debug.Log(debug);
    4.         myText.text += "\r\n" + debug;
    5.     }
    also I'm presetting myFlag (your isStarter) here:

    Code (CSharp):
    1. userAttributes myUserAttributes = new userAttributes();
    2.  
    3.         myUserAttributes.myFlag = true;
    4.  
    5.         // Fetch configuration setting from the remote service:
    6.         ConfigManager.FetchConfigs<userAttributes, appAttributes>(myUserAttributes, new appAttributes());
     
  6. jvt619

    jvt619

    Joined:
    Jul 4, 2013
    Posts:
    53
    Okay. Upon further testing and adding a debugger on the APK, I finally found the culprit. The 'Odin' plugin was causing the serialization error because I didn't build a DLL to include it on their AOT and also the struct was not serialized or didn't have a [System.Serializable].

    Remote config is working now.
     
    rambod and JeffDUnity3D like this.