Configuration - Specifying Configuration Sources

Alternate Configuration Location

The SDK’s start method expects to find a configuration file in your project named foresee_configuration.json, by default, but it is possible to specify an alternate location using the following method:

+ (void)startWithConfigurationFile:(NSString *)configFileName;

This is especially useful when debugging. Specify a custom config file when running locally like this:

#ifdef DEBUG
  [ForeSee startWithConfigurationFile:@"foresee_configuration_debug.json"];
#else
  [ForeSee start]; // default config
#endif

Remote Configuration

It’s also possible to specify a JSON string directly:

NSString *jsonConfig = @"{\"clientId\":\"your_client_id\",\"customLogoName\":\"custom_logo.png\",\"notificationType\":\"IMMEDIATE\",\"sessionReplayEnabled\":true,\"measures\":[{\"surveyId\":\"app_test_2\",\"launchCount\": 0}]}";
[ForeSee startWithConfigurationJson:jsonConfig];

This JSON string could originate anywhere (including one of your own servers), so this method can be used to load a remote configuration.

Other articles in this section:

  1. Configuration Options
  2. Configuration Structure
  3. Specifying Configuration Sources (current article)