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.
Can you provide your steps to reproduce, you mention “seems to”, can you confirm?
public void Start()
{
ConfigManager.FetchCompleted += ApplyRemoteSettings;
ConfigManager.FetchConfigs(PlayerManager.Instance.userAttributes, PlayerManager.Instance.appAttributes);
}
public struct UserAttributes
{
public bool isStarter;
}
public struct AppAttributes
{
public string appVersion;
}
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?
Thank you for the information, I will test and follow up here.
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:
private static Text myText;
// Start is called before the first frame update
void Start()
{
myText = GameObject.Find("MyText").GetComponent<Text>();
...
and
private void MyDebug(string debug)
{
Debug.Log(debug);
myText.text += "\r\n" + debug;
}
also I’m presetting myFlag (your isStarter) here:
userAttributes myUserAttributes = new userAttributes();
myUserAttributes.myFlag = true;
// Fetch configuration setting from the remote service:
ConfigManager.FetchConfigs<userAttributes, appAttributes>(myUserAttributes, new appAttributes());
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.