[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-16 UTC。"],[],[],null,["\u003cbr /\u003e\n\nFirebase Remote Config provides lots of flexibility for how and when to\nfetch new values from the server and activate them in your app, allowing you to\nensure a quality end user experience by controlling the timing of any visible\nconfiguration changes. You can fetch new values on application launch using\n`fetchAndActivate()`, and use\n[real-time Remote Config](/docs/remote-config#how_it_works)\nas a complementary method to automatically fetch the latest parameter values\nafter a new version of your Remote Config is published.\n\nThis guide looks at a few loading strategies and\ndiscusses key considerations for picking the best option for your app.\n\nStrategy 1: Fetch and activate on load\n\nIn this strategy, your app would call `fetchAndActivate()` when your app first\nstarts up to fetch new values from Remote Config and activate them as soon\nas they are done loading. This simple approach works well for configuration\nchanges that don't cause\nany dramatic visual changes in your UI. It should be\navoided in any situation where your UI could change noticeably\nwhile users are in the middle of using it.\n\nAfter your app calls `fetchAndActivate()`, it can start listening for parameter\nvalue updates in real time by calling `addOnConfigUpdateListener`. This method\nstarts listening for any server-side updates to parameter values, fetches them\nautomatically, then calls the listener. A simple strategy is to activate the new\nvalues in the listener. However, as mentioned for `fetchAndActivate()`,\nactivating immediately should be avoided for sensitive UIs.\n\nStrategy 2: Activate behind loading screen\n\nAs a remedy to the potential UI issue encountered in strategy 1, you could rely\non a loading screen. Instead of starting up your app right away, show a loading\nscreen and call `fetchAndActivate` in your completion handler.\nThen right after that --- again using a callback or a notification\n--- dismiss the loading screen and allow the user to start interacting with\nyour app.\n\nIf you use this strategy, it's recommended to add a timeout to the loading\nscreen. Remote Config's\none-minute timeout may be too long for a quality app startup experience for\nusers.\n\nListening for real-time Remote Config updates by calling\n`addOnConfigUpdateListener` works well with this strategy. Add the listener when\nthe loading screen is displayed, then use `activate()` at one or more points in\nyour app where Remote Config values won't cause dramatic visual changes.\n| **Note:** If you are loading values for an [A/B Testing](/docs/ab-testing/abtest-config) experiment, this strategy is very strongly recommended. With A/B Testing, additional time is required as the user is placed into an experiment and the experimental values are applied.\n\nStrategy 3: Load new values for next startup\n\nAn effective strategy is to load new configuration values to\nactivate on your app's *next* startup. In this strategy, your app activates\nfetched values on startup before attempting to fetch new ones, operating on the\nassumption that it may have already fetched --- but not yet activated\n--- new configuration values. The order of operations for this strategy is:\n\n1. On startup, immediately activate previously fetched values. This applies any values you've downloaded from the server in a previous session, and is nearly instantaneous.\n2. While the user interacts with your app, kick off an asynchronous call to fetch new values according to the default minimum fetch interval and add a real-time config update listener. The real-time listener will automatically fetch any values that are published on the server while your app is running. Real-time updates bypass the minimum fetch interval setting.\n3. In the completion handler or callback for the fetch call, do nothing. Your app will keep the downloaded values until you activate them the next time the app starts.\n\nWith this strategy, user wait time is greatly minimized. Combining the fetch\nand real-time listener strategies with `activate()` calls as needed in the app lifecycle makes sure users\nhave the latest values from Remote Config as they interact with your app.\n| **Tip:** Use `fetch()` and `addOnConfigUpdateListener()` as complementary methods. It's recommended to call fetch once per app launch, then start listening for updates in real time and activate them as needed. Listening for real-time updates makes it possible to get the latest parameter values without calling fetch frequently.\n\nLoading anti-strategies\n\nAs you may have understood from the above discussion of loading pros and cons,\nthere are a couple of usage patterns to avoid.\n\n- **Don't** update or switch aspects of the UI while the user is viewing or interacting with it --- *unless* you have strong app or business reasons for doing so, like removing options related to a promotion that has just ended.\n- **Don't** send mass numbers of simultaneous fetch requests, which could result in the server throttling your app. If you need to fetch updates frequently, use [real-time Remote Config](/docs/remote-config#how_does_it_work). While the risk of throttling is low in most production scenarios, it can be an issue during active development---and real-time Remote Config is designed for this use case. Check out the [throttling\n guidance](/docs/remote-config/get-started#throttling).\n- **Don't** rely on network connectivity to obtain Remote Config values. **Do** set in-app default parameter values so that your app always behaves as expected. You can periodically keep app and Remote Config backend default values in sync using [downloaded template\n defaults](/docs/remote-config/templates#download_template_defaults).\n\nNext steps\n\nThese three basic strategies do not by any means comprise a complete list of the\nways to load configuration values. Depending on your needs, you could devise\nmuch more sophisticated strategies.\n\nCheck out the API reference for your platform to learn more about the specific\ncalls for fetching and activating configuration values."]]