![]() ![]() This is useful if the values might drastically change the UI or show/hide essential features. This is only suitable if there are no big UI changes involved that could confuse users while they are using the app.ĭisplay a loading screen and download the values in the background. ![]() The Firebase docs recommend 3 different loading strategies.ĭownload the values and update the relevant app parts immediately. Just make sure to only use it in development mode. The default value is 12 hours but it makes sense to use lower values like 1 minute during development. There is a server-side limit, so setting the value too low might result in reaching that limit very quickly with many users. The minimumFetchInterval property of the RemoteConfigSettings object defines the period in which follow-up calls to Firebase Remote Config will be ignored. Screenshot of Android output (left) and Web output (right) in a demo application using Firebase Remote Config by authorĬongratulations, your Firebase Remote Config setup is completed and working! □ Fetch intervals You should see results like in the image below. Let’s verify the correct functionality by running our app. Screenshot of unsaved changes hint banner in Firebase by author But users will have to wait until their fetch interval is reset until they receive new values (see the section about fetch intervals). When confirming the changes, they will be available immediately. On any other platform, the in-app default value will be used (we set it to “Hello!” in the previous section). Screenshot of parameter overview for Remote Config in Firebase by authorĪn app using this parameter will output “Hello from Android!” on Android phones, “Hello from iOS!” on iPhones, and “Hello from Web!” on the web platform. Screenshot of parameter creation for Remote Config in Firebase by authorĪfter a click on Save, you should see something like this in your overview. Have a look at the following image about how to create a parameter. You can define output values or rely on in-app defaults if they are set. Add 3 conditional values and assign the previously created conditions to them. ![]() The key is platformString and it will be used by our app code to fetch the value. Click on Add parameter to create a new one. Let’s move on to the Parameters tab to create a parameter with our conditions. Screenshot of created conditions for Remote Config in Firebase by author In total, I created 3 conditions for Android, iOS, and web. Screenshot of the dialog to add or edit a condition for Remote Config in Firebase by author In this example, I created a condition that applies to all Android users. Go to the Conditions tab and click on Add condition. Follow these steps to create a parameter with conditions. iOS users might get a grey app background while Android users will have a blue background, for example. You can provide different values to different groups based on conditions. Conditions are a mechanism to identify groups of app users with common properties. Now, you can create parameters and conditions. Screenshot of Remote Config menu in Firebase by author Screenshot by author.Ĭlick in Create Configuration next. To enable it, click the link and follow the instructions. Firebase notification in case Google Analytics is not activated for the current Firebase project. The Firebase Console will notify you in case it is not activated yet (see image below). Make sure to enable Google Analytics for your Firebase project if you haven’t done it already during the initial setup. Create parameters with conditions in Firebase In the next section, we’ll define the values that are to be downloaded to your app in the Firebase Console. To get the value, the following code can be used (use a StatefulWidget and its initState function). We will later define a string with the key platformString in Firebase. Use these values to trigger a special behavior in your app. To get remote values, use the provided functions getBool(), getDouble(), getInt(), or getString(). Always make sure your app runs in such error cases, too. device is not connected to the internet), these values will be used instead. If the Firebase backend is not reachable (e. A good starting point is the main function after Firebase is initialized. You can then define the connection settings with the backend. ![]() This requires Firebase Analytics to be installed, too ( flutter pub add firebase_analytics). In a later section, we’ll talk about conditions and targeting of specific user groups and app instances. Do not store any secrets or confidential data in Firebase Remote Config!įirst, install the Firebase Remote Config package into your application with flutter pub add firebase_remote_config. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |