Remote Config Appliance

πŸ“˜

Remote Config

Remote config controls the behavior and settings of an application in real-time by replacing the values or properties controlled in application with the parameters defined in the hackle dashboard. The parameter can be set to a target value for all properties of the client/server side app (ex. button color, external link).

First, set parameter information and values according to user identifier rules in Hackle's dashboard. In order to apply the remote config, you need to use the following functions provided by the Hackle SDK.

After applying the values ​​to be applied to the code provided by the Hacker SDK, you can simply change the values ​​and rules on the remote config to apply the changes immediately without republishing.

remoteConfig

Call remoteConfig() method to obtain HackleRemoteConfig instance which contains the remote config information (about parameter settings and rules)

You can access the desired parameters through the HackleRemoteConfig instance and receive values.

import "package:hackle/hackle.dart";

// Returns an instance containing remote config information.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

Remote config parameter inquiry

  • HackleRemoteConfiginstance passed through the remoteConfig() method has full parameter setting information set by Remote Config.
  • Parameter values you've set on the dashboard exists in the form of key and value, therefore you can use the method below to set the parameter values.
  • You can change rules and values flexibly on the Remote Config > Parameter Settings.

🚧

Remove code related to the Remote Config after archiving the parameter key

If the code related to Remote Config is left unattended after your parameter key has been archived and you've long forgotten about it, service stability problems such as latency issues may occur.

  • There may be high dependency when writing code related to the different versions of the Remote Config.
  • Unnecessary server traffic may occur.

Therefore, make sure to clean up the related code after archiving the parameter key.

  • The parameterKey of the get() method is the key information set in parameter setting of remote config.
  • You can refer parameterKey from the dashboard, defaultValue is the value returned when a state decision fails or when an invalid parameter type is entered
    • A. Entered a different parameter type and defaultValue in the dashboard
    • B. Calling unset parameter key
    • C. Hackle SDK initialization failure
    • D. When identifier information is entered incorrectly or does not exist
    • E. ETC
  • In order to properly receive the information you set in the dashboard, you must enter a value corresponding to the parameter type you set in the dashboard.
  • The parameter types supported by SDK are string, number, and boolean. JSON types set in the dashboard can be received in the form of String. The default value of the JSON type must be entered as a string type.

getString

  • Returns the parameter value set to STRING, JSON type.
  • Returns the default value or the value set in the rule based on the status determination.
import "package:hackle/hackle.dart";

// Returns an instance containing remote config information.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

String strValue = await remoteConfig.getString("parameter_key_string_type", "defaultValue");

// JSON Type
String jsonValue = await remoteConfig.getString("parameter_key_json_type", "defaultValue");

getInt

  • Returns the parameter value set to Number type as Int type.
  • Returns the default value or the value set in the rule based on the status determination.
import "package:hackle/hackle.dart";

// Returns an instance containing remote config information.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

int intValue = await remoteConfig.getInt("parameter_key_int_type", 0);

getDouble

  • Returns the parameter value set to Number type as Double type.
  • Returns the default value or the value set in the rule based on the status determination.
import "package:hackle/hackle.dart";

// Returns an instance containing remote config information.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

double doubleValue = await remoteConfig.getDouble("parameter_key_double_type", 0.0);

getBool

  • Returns the parameter value set to Boolean type.
  • Returns the default value or the value set in the rule based on the status determination.
import "package:hackle/hackle.dart";

// Returns an instance containing remote config information.
RemoteConfig remoteConfig = HackleApp.getRemoteConfig();

bool boolValue = await remoteConfig.getBool("parameter_key_bool_type", false);