Initialization

To initialize the GIZO SDK in your project, you need to add the following code snippets to the appDelegate file of your project:

import GizoSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
    initializeGizoSDK(launchOptions: launchOptions)
    return true
}
    
    
func initializeGizoSDK(launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
        
    let result = Gizo.shared.initialize(options: GizoOptions(), launchOptions: launchOptions)
    Gizo.shared.setToken(clientId: "<clientId>", clientSecret: "<clientSecret>")
        
    if result.isSuccessful {
        print("[GizoSDK]: Initialization successful")
    } 
    else {
        print("[GizoSDK]: Initialization failed, reason: \(result.failure.debugDescription)")
    }
}

The table below describes the available options of GIZO SDK.

GIZO Options
Type
Default Value
Description

useGizoScoring

Boolean

true

true if the recorded data are intended to be processed on the GIZO platform.

logToConsole

Boolean

true

Set to true if you want to see the logs in the console.

logToFile

Boolean

true

Set to true if you want to see the logs in the log file.

autoStart

Boolean

true

Set to true to enable automatic trip recording when a new trip is detected.

autoStop

Boolean

true

Set to true to stop recording trips automatically when the trip finishes.

clientId

String

empty

Use the client ID provided by AMI.

clientSecret

String

empty

Use the client secret provided by AMI.

GizoUploadSetting

-

-

GizoCrashSetting

-

-

Upload Settings

To prevent unexpected costs from excessive mobile data usage, the table below outlines the available configurations for the upload manager in the GIZO SDK:

GIZO Upload Setting
Type
Default Value
Description

isMobileDataEnabled

Boolean

true

Set to true if you want to allow upload through mobile data.

isRomingDataEnabled

Boolean

false

Set to true if you want to allow uploads while roaming on a cellular network.

mobileDataUsageLimit

Number

100.0

The trip data size threshold in MB, above which the data will not be uploaded, even if uploading through mobile data is enabled.

romingDataUsageLimit

Number

100.0

The trip data size threshold in MB, above which data will not be uploaded, even if mobile data uploading while roaming is enabled.

Crash Settings

To enable and configure the functionality of crash detection feature, the following parameters can be adjusted:

GIZO Crash Setting
Type
Default Value
Description

detectCrash

Boolean

false

Set to true if you want to enable crash detection.

logToFile

Boolean

false

Set to true if you want to see the crash-related logs in the crash log file.

mode

Enum

Prod

Set to Still_Test when you what to test the functionality of crash detection. To perform a crash test at lower speeds (>=15kph), use Low_Speed_Test. Otherwise, set to Prod.

Initialization typically succeeds unless an unforeseen error or exception occurs. If it fails, you can review the returned result to identify the cause.

Last updated