What is Firebase Remote Config and what are its use cases
Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update.
Firebase remote config is generally used for:
- Remotely enabling/disabling features
- A/B Testing on certain group of users
- Conditional settings for a defined set of users
Apart from above mentioned use cases, Firebase Remote Config can even help in preventing crashes in certain situations. When making frequent releases in fast growing startups, apps are prone to crashes and as developers, we are expected to maintain crash free numbers.
Most basic usage is for enabling/disabling features remotely by storing boolean values. Something like:
{ feature_name: false }
When releasing builds frequently, we may run into following scenarios:
- There’s a crash happening only on a certain app version.
- There’s a crash happening only on certain Android/iOS version.
- There’s a crash happening only for a particular user.
- Some feature controlled by remote config is sent live incomplete and on enabling the feature in future builds it gets enabled in older builds as well. This leads to wrong state visible to the user.
Extending the basic approach to cover above mentioned situations, we can create remote config flags something like:
{ feature_name: { is_enabled: false, app_version: xxxxxx, android_version: xx, blocked_user_ids: ...., .... } }
Instead of keeping boolean values, we add some more optional conditions for enabling/disabling features remotely. Here’s how:
- is_enabled — This is your basic boolean key — non-optional
- app_version — Depending on how you create your version numbers, it can be long/int value which you can compare with current app version and decide to enable a feature only above the given app_version — optional
- android_version — This is minimum API level you want the feature to be enabled for. This comes handy with some third-party/open source SDKs that might behave weird on certain android versions — optional
- blocked_user_ids — This comes in handy at small scale only when you have limited set of users. Sometimes, a situation occur when a particular user increase crash numbers by performing certain action again and again — optional
Conclusion
We saw how Firebase remote config can even help to reduce crash numbers in some cases.
Happy Coding!
This article was originally published on proandroiddev.com on August 27, 2022