Firebase Remote Config [Swift]

Firebase Remote Config is used to change the application behavior without publishing update of application.

Firebase Remote Config
Firebase Remote Config

Basic setup is to create project at firebase console.
Firebase Console
Firebase Console – Follow the steps to create a project

I am adding a video here to setup the firebase remote config.

Add core firebase to your project

Follow the steps available at : Add Firebase to your iOS Project

Steps to add remote config to your app

  1. Installation
    Update your project with required cocoapods

    Run pod install from terminal and open the created .xcworkspace file.
  2. Configure Firebase Module
    Just import firebase module and apply configure method. It will configure by itself by using GoogleService-Info.plist.
  3. Configure remote config
    Create Remote Config object, as shown in the following example:

    Create an plist file for default values of configuration and set it to remote config:

    FireSwiftRemoteConfigDefaults.plist with sampleURL key:

    Use current default key from your defaults set on plist file and send fetch request in remote config to get the configuration keys set on the firebase console:

    Note : If in developer mode cacheExpiration is set to 0 so each fetch will retrieve values from the server. The default expiration duration is 43200 (12 hours).
  4. All Done.
    Sample code available at Github. There are many other things with firebase, I will try give update in next tutorials.

    If you like then Buy me a coffee ☕️

    Happy Coding 🙂