Getting started
- Add Firebase to your iOS Project.
- Create a Remote Config project for the quickstart sample,
defining the parameter values and parameter keys used by the sample.
- Run the sample on a supported device or simulator. Like Remote Config, this
quickstart supports iOS and macOS (via MacCatalyst). Deploy to a supported
platform by choosing a destination in Xcode (
control
+ shift
+ 0
).
- Change one or more parameter values in the Firebase Console (the value of
topLabelKey
, typedRecipeKey
, and/or bottomLabelKey
). This is discussed in detail in the next section!
- Tap Fetch & Activate Config in the app to fetch new parameter values and see
the resulting change in the app.
Configuring the Quickstart with Remote Config
The Top Label - Configuring user-facing text
When you open the quickstart, you'll notice a label that greets you near the top of the display. Remote config is an excellent choice for configuring user-facing text so let's configure this label! Go to the Firebase Console and navigate to the remote config tab. Add a parameter with topLabelKey
for the Parameter Key. For the Default Value, enter whatever text you would like! Make these changes live by clicking Publish Changes in the top right corner of the console. Switch back to the quickstart app and tap Fetch & Activate Config. The top label should update with the new value you set in the console!
Recipe View - Configuring Complex entities using JSON
Imagine your are building an app where each day, you display a "Recipe of the Day" to your users. Rather than configure lots of individual config keys and values, we can group a recipe's data together in one JSON object.
In this quickstart, we provide you with a folder of JSON files called JSON Recipes. Copy one on the recipes and navigate to the Remote Config tab of the Firebase Console. Let's add a parameter for the recipe. For the Parameter Key, enter typedRecipeKey
and for the value, click the {} button on the right of the Default Value text box. Paste the JSON recipe you copied earlier into this box and click Save. To make these changes live so our app can fetch them, click Publish Changes in the top right corner of the console.
Now that there is a recipe on to be fetched. Tap Fetch & Activate Config and the recipe you entered on the Firebase console will display on the device!
The Bottom Label - Defining platform and locale-specific content
You can add remote config values that will take effect based on certain conditions. Let's experiment with this by adding another remote config parameter. For the Parameter Key, enter bottomLabelKey
and for the value, click the Add value for condition button. We encourage you to explore the remote config's capabilities by adding and publishing values that apply for certain conditions. For instance, maybe you want to display a special deal in specific regions of the world or at a certain date and time.
For more info on what you can do with remote config, checkout out this Firebase article.