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. You need at least the Authentication and License keys for a proper initialization, but you can do much more. If you want to add more configuration items, you can simply build the JSON and pass its content as NSDictionary to the configuration argument of the SYContextInitRequest object:

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]
        let initRequest = SYContextInitRequest(configuration: dict)
        SYContext.initWithRequest(initRequest) { (result, description) 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];

SYContextInitRequest* initRequest = [[SYContextInitRequest alloc] initWithConfiguration:dict];

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

[SYContext initWithRequest:initRequest completion:^(SYContextInitResult result, NSString * _Nonnull description) {
    // 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 SygicEngine.JsonConfigBuilder.

Example of how to use the JsonConfigBuilder

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


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>"
    "License": {
        "license_key": "<your license key>"