Skip to content

JSON Configuration

Starting with the version of SDK 8.0.0 you now have full power to configure multiple aspects of SDK.

This document describes how to include JSON configuration file in your project.

Minimal required configuration can be found here Minimal JSON Configuration

For full description of JSON Configuration follow Full JSON Configuration and JSON Schema Documentation for documentation.


Configuration JSON is an optional file you can place into your app. If there is no need to change default configuration you can ignore the file and set your application credentials directly to [SYContext initWithAppKey:appSecret:onlineRoutingKey:completion] method.

For custom configuration, load the JSON file and pass its content as NSDictionary to [SYContext initWithConfiguration:completion] method:

do {
    if let configData = try String.init(contentsOfFile: Bundle.main.path(forResource: "your_config_file", ofType: "json")!).data(using: .utf8) {
        let dict:[AnyHashable: Any] = try JSONSerialization.jsonObject(with: configData, options: .mutableContainers) as! [AnyHashable: Any]
        SYContext.initWithConfiguration(dict) { [weak self] initResult in

} catch {

    // catch errors

NSData *configData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"settings_app" ofType:@"json"]];
NSError* error = nil;
NSMutableDictionary *dict = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:&error];

if(error) {
    // your error handling code
    NSLog(@"%@", [error localizedDescription]);

[SYContext initWithConfiguration:dict completion:^(SYContextInitResult result) {
    // your init completion code


By using the JSON configuration you can further expand the customization of our SDK. A "stringified" configuration (jsonConfig) is necessary for proper initialization of the SDK. You can either pass it as a string, or use the new SygicEngine.JsonConfigBuilder (available in SDK 17.1 or higher).

Example of how to use the JsonConfigBuilder

val config = SygicEngine.JsonConfigBuilder()
val path = applicationContext.getExternalFilesDir(null).toString()
val clientID = "your_client_id"


The .build() method parses the config object into a string.

If you would like to build the JSON yourself and pass it directly as a string, it has to have a proper JSON structure, for example:

    "Authentication": {
        "app_key": "<your app key>",
        "app_secret": ""