Complete the code to get an instance of Firebase Remote Config.
val remoteConfig = FirebaseRemoteConfig.[1]()The getInstance() method returns the singleton instance of Firebase Remote Config.
Complete the code to set default values from an XML resource file named 'remote_config_defaults'.
remoteConfig.[1](R.xml.remote_config_defaults)The setDefaults() method sets default parameter values from an XML resource.
Fix the error in the code to fetch Remote Config values with a 1-hour cache expiration.
remoteConfig.fetch([1]).addOnCompleteListener { task -> if (task.isSuccessful) { remoteConfig.activate() } }
The fetch() method expects cache expiration in seconds. 3600 seconds equals 1 hour.
Fill both blanks to get a Remote Config string value for the key 'welcome_message'.
val welcomeMessage = remoteConfig.[1]("[2]")
Use getString() to get the string value for the key "welcome_message".
Fill all three blanks to fetch, activate, and then print the Remote Config value for 'feature_enabled'.
remoteConfig.[1]().addOnCompleteListener { task -> if (task.isSuccessful) { remoteConfig.[2]() println(remoteConfig.[3]("feature_enabled")) } }
First, fetch() gets the latest values. Then activate() applies them. Finally, getString() retrieves the value for the key.