> 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/react-native/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:

```objectivec
#import <GizoSDK/GizoSDK-Swift.h>
```

```objectivec
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleName = @"main";

  // You can add your custom initial props in the dictionary below.
  // They will be passed down to the ViewController used by React Native.

  [self initializeGizoSDK:launchOptions];
  self.initialProps = @{};

  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
```

```objectivec
- (void) initializeGizoSDK:(nullable NSDictionary *)launchOptions {
  
  GizoOptions *options = [[GizoOptions alloc] init];

  GizoInitializationResult *result = [[Gizo shared] initializeWithOptions:options launchOptions:launchOptions];

  if (result.isSuccessful) {
      NSLog(@"[SDK]: Initialization successful");
  } else {
      NSLog(@"[SDK]: 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.
