Seven remote config mistakes mobile teams make
Missing fallbacks, reads in hot loops, secrets in config, publishing too early, calling tests too soon, stale flags and stale data, and how to avoid each.
Most remote config problems come from seven habits: no fallback value, reading values in a hot loop, putting secrets in config, publishing before the app version that reads the value is live, judging tests too early, never removing old flags, and targeting on stale data. Each has a simple fix, and most of the fixes are a line or two of code.
Here they are in one place, with code taken from the AppFig SDK guides.
1. No fallback value
A remote value can be missing. The rules may not have loaded yet on a first launch with no connection, the key may be misspelled, or the user may not match any rule. In AppFig, when no rule matches, the SDK returns null, not an empty string.
Code that assumes a value is always there will crash or misbehave for exactly the users you were not thinking about. On the web, the docs show how quietly it goes wrong:
// ❌ Bad: No fallback
const maxRetries = parseInt(AppFig.getConfig('max_retries'), 10);
// NaN if feature returns null!
// ✅ Good: Provide fallback
const maxRetries = parseInt(
AppFig.getConfig('max_retries') || '3',
10
);
On Android it is one line:
val maxLives = AppFig.getFeatureValue("max_lives")?.toIntOrNull() ?: 5 // fallback
The fix: every read has a default in code, and the default is the value the app shipped with. Then a missing value means the app behaves as it did before, which is always safe. The pull request from AppFig's guided setup writes every read this way, with today's value as the default.
2. Reading values in a hot loop
Reading a value in AppFig makes no network call, and results are cached, so a check is cheap. It is still work you do not need to do sixty times a second, and reading mid-frame means a value can change halfway through something that assumed it was fixed.
// ❌ Bad: Checks every frame
void Update() {
if (AppFig.IsFeatureEnabled("double_xp")) {
// ...
}
}
// ✅ Good: Check once, store result
private bool hasDoubleXP;
void Start() {
hasDoubleXP = AppFig.IsFeatureEnabled("double_xp");
}
void Update() {
if (hasDoubleXP) {
// ...
}
}
The fix: read at a natural boundary, such as when a level loads, a screen opens or a session starts, and hold the result for that unit of work. The Unity integration guide calls this evaluating when you need the value: right before LoadLevel, not inside Update.
3. Putting secrets in config
Remote config is delivered to the app, and anything delivered to an app can be read by someone who wants to. With AppFig this is plain from the design: the rule set is downloaded to the device and evaluated there, so the rules and every value in them are on the device.
That rules out API keys, signing secrets and private endpoints as config values. It also rules out using a flag as the only gate on something a user should pay for.
The fix: treat every remote value as public. Keep secrets on your server, and use config for behavior: limits, timings, difficulty, layout, which offer to show.
4. Changing values before the app version that reads them is live
A value only does something in builds that read it. If you publish a change, or start an experiment, while the release that reads the value is still in review or rolling out, almost nobody receives it. For a test, the first days are empty, and the early numbers come only from the users who update fastest.
The AppFig docs are direct about it: publish only after the app release that reads these values is live in the stores (experiments). Users on older versions do not read the value at all, so nothing changes for them.
The fix: keep the change as a draft until the release is out. In AppFig every change and experiment is a draft until you publish. If you need a rule to apply only from a certain build onwards, set the app version at start-up and add it to the rule's device conditions:
AppFig.SetAppVersion("1.2.3");
5. Judging tests too early
Two days into a test, one variant is ahead by 30%. It is tempting to ship it. With a few dozen users per group, a gap that size appears by chance all the time, and it often reverses by the end of the week.
AppFig will not call a winner before a result is solid. A conversion test needs at least 100 users and 10 conversions per group and a difference unlikely to be chance (p < 0.05). A revenue test needs at least 100 users per group and at least 7 days with revenue in every group, because a few large spenders can move a total on any single day.
The fix: decide the metric and a maximum duration before you start, then leave the test alone until a winner is called or the time is up. More on setting this up in choosing your first A/B test.
6. Never removing old flags
Every flag you add is a branch in your code and a row in your dashboard. A flag that has been "on for everyone" for a year is still a branch: someone can switch it off by accident, new code has to handle both sides, and nobody remembers whether the old path still works.
The fix: give every flag an ending when you create it.
- For a finished test, roll out the winning variant, then make that value the default in code in your next release and delete the losing branch.
- Once no supported app version reads the key, remove it from the dashboard.
- Keep the ones that are real configuration, such as limits and prices you expect to tune again. Those are settings, not leftovers.
7. Targeting on stale data
A rule is only as good as the data it reads. Three versions of this mistake come up.
Properties that are set once and never updated. If subscription_tier is set at sign-up and not when the user upgrades, your "free users" rule keeps matching a paying customer. Set a property whenever the fact changes, and again at start-up from your source of truth:
AppFig.SetUserProperty("subscription_tier", "premium");
Rules that look further back than the device remembers. AppFig rules read events held on the device, and the SDKs keep up to 5,000 events for 7 days by default. A rule with "within_last_days": 30 needs the history to exist, so raise maxEventAgeDays to match when you initialize the SDK.
Values cached past their moment. Mistake 2 says to read once and store the result. Take that too far, by reading everything at launch and never again, and a rule that should react to what the user just did never gets the chance. Read at the boundary where the value is used, and re-read when new rules arrive. In Flutter:
// Re-read values when new rules arrive
AppFig.onRulesUpdated.listen((_) => refreshLimits());
The fix: log events when the action happens, update properties when the fact changes, and check with the debug tools that the device holds what your rule expects. The testing guide shows how to inspect event history and properties on a device.
FAQ
What should a remote config fallback value be?
The value the app shipped with before the config existed. Then a missing or unloaded value makes the app behave exactly as it did before, which is the safest possible failure.
Is it safe to store API keys in remote config?
No. Remote config is delivered to the app, and anything on a device can be read. Keep secrets on your server and use remote config for behavior such as limits, timings and which screen to show.
When should I publish a remote config change?
After the app release that reads the value is live in the stores. Before that, almost no users can receive it, and a test started early collects misleading data from the first users to update.