Firebase Remote Config

Tested with Firebase version 12.2.0 (iOS)

We assume you already have Appfigurate Library and Firebase integrated into your app with the following example remote properties created in the Firebase Console:

Add remote properties into your Configuration subclass

Update your configuration subclass to include your remote configuration properties. Provide default values for the properties in the overridden reset method. See also Supported property types.

Swift Configuration example

Provide remote configuration values to Appfigurate Library when requested

Appfigurate Library needs to be able to read the current remote configuration values from Firebase. Copy and paste the following code into your app.

The defaultValue parameter in the callback is not used with Firebase. See the Apply default values for Firebase section below.

Swift example

Apply default values to Firebase

Apply default values to Firebase using the values you set in the reset method of your configuration subclass. The default values are used by Firebase when the remote configuration has not yet been received.

The APLConfiguration class has a method remoteDefaults which provides a Dictionary of all the remote configuration property default values that were set in your overridden reset method.

Swift example

Notify Appfigurate Library when Firebase has received remote configuration values

We need to tell Appfigurate Library that Firebase has received remote configuration, so that it can keep your Configuration subclass remote properties in sync.

Add a call to APLFlushRemoteConfiguration in any existing Firebase Remote Config activate(completion:) blocks (inside fetch(completionHandler:) and optionally addOnConfigUpdateListener(remoteConfigUpdateCompletion:).

Swift example

Complete initialisation example

Swift complete initialisation example

Best practice and usage

Replace all calls to Firebase Remote Config configValue(forKey:):

with the following:

Last updated