# Capture-only SDK Mode

Capture-only mode should be used in case you would just like to fetch captured ID and Selfie images, without doing any validations such as ID validation, Face recognition and Liveness detection.

Supported modules in this mode are: ID Scan, Selfie Scan, Document Scan, Video Selfie.

All the processing inside these modules is being done locally.

## 1. Initialize IncdOnboarding SDK

Add the following line of code to your `AppDelegate` class:

```undefined
IncdOnboardingManager.shared.initIncdOnboarding()
```

Optionally disable logs, by providing `false` for `loggingEnabled` parameter.

## 2. Enable Capture-only mode

```undefined
IncdOnboardingManager.shared.sdkMode = .captureOnly
```

## 3. Start capturing data

### ID Scan

To start the front ID Scan, use following function:

```undefined
IncdOnboardingManager.shared.presentingViewController = self
let flowConfig = IncdOnboardingFlowConfiguration()
flowConfig.addIdScan(idType: .id, scanStep: .front)
IncdOnboardingManager.shared.startOnboardingSection(flowConfig: flowConfig, sectionTag: "idFront", delegate: self)
```

Result will be returned via delegate method:

```undefined
func onIdFrontCompleted(_ result: IdScanResult)
```

`IdScanResult` will contain captured image and other data.

Note:

Adding ID Scan without specifying the specific side to be scanned will result in adding both front and back side.

In the Capture-only mode the ID Process module will not be added (otherwise in the Normal mode it would be added as well).

### Selfie Scan

To start the Selfie Scan, use following function:

```undefined
let flowConfig = IncdOnboardingFlowConfiguration()
flowConfig.addSelfieScan()
IncdOnboardingManager.shared.startOnboardingSection(flowConfig: flowConfig, sectionTag: "selfie", delegate: self)
```

The result will be returned via delegate method:

```undefined
func onSelfieScanCompleted(_ result: SelfieScanResult)
```

`SelfieScanResult` will contain captured selfie image.

### Document Scan

To start the Document Scan, use following function:

```undefined
let flowConfig = IncdOnboardingFlowConfiguration()
flowConfig.addDocumentScan(showTutorials: true, showDocumentProviderOptions: true, documentType: .addressStatement)
IncdOnboardingManager.shared.startOnboardingSection(flowConfig: flowConfig, sectionTag: "document",delegate: self)
```

The result will be returned via delegate method:

```undefined
func onDocumentScanCompleted(_ result: DocumentScanResult)
```

`DocumentScanResult` will contain captured document info.

### Video Selfie

To start the Video Selfie, use following function:

```undefined
let flowConfig = IncdOnboardingFlowConfiguration()
let videoSelfieConfiguration = VideoSelfieConfiguration()
videoselfieConfiguration.tutorials(enabled: true)
videoselfieConfiguration.selfieScan(performLivenessCheck: false, mode: .faceMatch)
videoselfieConfiguration.idScan(enabled: true, validateId: false)
videoselfieConfiguration.documentScan(enabled: true)
videoselfieConfiguration.minVideoLengthRequired = false
videoselfieConfiguration.setLogo(UIImage(named: "LogoName"))
videoselfieConfiguration.voiceConsent(enabled: true,
                                      questionsCount: 3,
                                      randomQuestions: ["What State do you live in?": "California",
                                                        "Which is your date of birth?": "First of October Nineteen hundred Ninety-Two",
                                                        "What State were you born in?": "Mexico"],
                                      consent: "I accept the terms.")
flowConfig.addVideoSelfie(videoSelfieConfiguration: videoSelfieConfiguration)
IncdOnboardingManager.shared.startOnboardingSection(flowConfig: flowConfig, sectionTag: "videoSelfie", delegate: self)
```

The result will be returned via delegate method:

```undefined
func onVideoSelfieCompleted(_ result: VideoSelfieResult)
```

`VideoSelfieResult` will contain all the data gathered in the Video Selfie step.
