> For the complete documentation index, see [llms.txt](https://docs.artificient.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artificient.de/usage/ios/initialization.md).

# Initialization

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

```swift
import GizoSDK
```

```objectivec
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.

<table><thead><tr><th width="176">GIZO Options</th><th width="171">Type</th><th width="134">Default Value</th><th>Description</th></tr></thead><tbody><tr><td>useGizoScoring</td><td>Boolean</td><td>true</td><td><code>true</code> if the recorded data are intended to be processed on the GIZO platform.</td></tr><tr><td>logToConsole</td><td>Boolean</td><td>true</td><td>Set to <code>true</code> if you want to see the logs in the console.</td></tr><tr><td>logToFile</td><td>Boolean</td><td>true</td><td>Set to <code>true</code> if you want to see the logs in the log file.</td></tr><tr><td>autoStart</td><td>Boolean</td><td>true</td><td>Set to <code>true</code> to enable automatic trip recording when a new trip is detected.</td></tr><tr><td>autoStop</td><td>Boolean</td><td>true</td><td>Set to <code>true</code> to stop recording trips automatically when the trip finishes.</td></tr><tr><td>clientId</td><td>String</td><td>empty</td><td>Use the client ID provided by <a href="/pages/YYuHwzUmlTKve46CFyuk">AMI</a>.</td></tr><tr><td>clientSecret</td><td>String</td><td>empty</td><td>Use the client secret provided by <a href="/pages/YYuHwzUmlTKve46CFyuk">AMI</a>.</td></tr><tr><td><a href="#upload-settings">uploadSetting</a></td><td>GizoUploadSetting</td><td>-</td><td>-</td></tr><tr><td><a href="#crash-settings">crashSetting</a></td><td>GizoCrashSetting</td><td>-</td><td>-</td></tr></tbody></table>

## 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:

<table><thead><tr><th width="221">GIZO Upload Setting</th><th width="104">Type</th><th width="134">Default Value</th><th>Description</th></tr></thead><tbody><tr><td>isMobileDataEnabled</td><td>Boolean</td><td>true</td><td>Set to <code>true</code> if you want to allow upload through mobile data.</td></tr><tr><td>isRomingDataEnabled</td><td>Boolean</td><td>false</td><td>Set to <code>true</code> if you want to allow uploads while roaming on a cellular network.</td></tr><tr><td>mobileDataUsageLimit</td><td>Number</td><td>100.0</td><td>The trip data size threshold in MB, above which the data will not be uploaded, even if uploading through mobile data is enabled.</td></tr><tr><td>romingDataUsageLimit</td><td>Number</td><td>100.0</td><td>The trip data size threshold in MB, above which data will not be uploaded, even if mobile data uploading while roaming is enabled.</td></tr></tbody></table>

## Crash Settings

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

<table><thead><tr><th width="221">GIZO Crash Setting</th><th width="104">Type</th><th width="134">Default Value</th><th>Description</th></tr></thead><tbody><tr><td>detectCrash</td><td>Boolean</td><td>false</td><td>Set to <code>true</code> if you want to enable crash detection.</td></tr><tr><td>logToFile</td><td>Boolean</td><td>false</td><td>Set to <code>true</code> if you want to see the crash-related logs in the crash log file.</td></tr><tr><td>mode</td><td>Enum</td><td>Prod</td><td>Set to <code>Still_Test</code> when you what to test the functionality of crash detection. To perform a crash test at lower speeds (>=15kph), use <code>Low_Speed_Test</code>. Otherwise, set to <code>Prod</code>. </td></tr></tbody></table>

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