Real-time Remote Config best practices

Real-time Remote Config lets you attach listeners and receive configuration updates in real time. This is ideal for features or user flows that require frequent updating such as instantly toggling a feature flag when testing a new feature, or promoting limited-time flash sales.

Use real-time Remote Config strategically

To maximize the value of real-time Remote Config, focus on key areas in your application that require instant updates—such as feature flag toggles—and carefully manage listener lifecycle events around those specific components.

This targeted strategy helps ensure that fetch requests for configuration updates occur only when users navigate relevant sections of your app.

Consider a longer fetch interval for updates that don't require immediate delivery, and pair this with real-time listeners for immediate updates for critical parameters. This ensures that inactive users still receive the latest configurations over time, while reducing overall fetch volume and allowing app instances to load fresh values even before navigating to real-time features.

Things to keep in mind when using real-time Remote Config

When using real-time Remote Config, keep the following considerations in mind to keep your fetches and battery consumption optimal:

  • Fetch limits: Whenever a parameter is updated in the console, an invalidation signal is sent to listening client apps, triggering fetches that count toward your fetch limits.
  • Battery consumption: Maintaining an open HTTP connection to listen for updates increases battery usage on user devices.

You can use addOnConfigUpdateListener to add a listener. If you add multiple listeners in different sections of your app, Remote Config maintains and reuses a single HTTP connection for all listeners. To clean up added listeners, call remove on each ConfigUpdateListenerRegistration object. To close the open network connection, make sure all added listeners have been removed.

Next steps