Uploading and Analyzing Media

Please note: this method only works if your SDK version is below 3.0.0. If it is 3.0.0 or higher, please use the methods listed above.

Server-Based Analyzes

Data to be uploaded and analyzed are stored in object results (see above), obtained after capturing and recording video. Upload it to the server and initiate the necessary analyses with the help of Oz API.

A simple scenario of interaction with Oz API can be implemented with the OZSDK.analyse method as described below.

OZSDK.analyse(
  results: results,
    analyseStates: [.quality],
    fileUploadProgress: { (progress) in

    }
) { (resolution, error) in

}

The completion | resolution block will contain the result of the assigned analysis including status (status of the analysis), type (type of the analysis), and folderID (ID of the Oz API folder).

To perform a cross-functional analysis based on video and document photos, use the OZSDK.documentAnalyse method:

OZSDK.documentAnalyse(
  documentPhoto: DocumentPhoto(front: frontDocumentURL, back: backDocumentURL),
  results: results,
  scenarioState: { (state) in
  
  }, fileUploadProgress: { (progress) in

  }
) { (folderResolutionStatus, resolutions, error)

}

The completion | resolution block will contain the result of the assigned analysis (similar to OZSDK.analyse), where folderResolutionStatus is the general status of analyses for the folder.

For both documents and face check, you can use the OZSDK.uploadAndAnalyse method:

OZSDK.uploadAndAnalyse(results: results,
                    documentPhoto: DocumentPhoto(front: frontDocumentURL, back: backDocumentURL),
                    analysisTypes: [.quality],
                    metadata: nil,
                    scenarioState: { state in },
                    fileUploadProgress: { progress in }) { status, resolution, error in }) 

The resolution block will contain the result of the assigned analysis (similar to OZSDK.analyse and OZSDK.documentAnalyse).

On-Device Analyzes

The methods below are used to analyze media on the device.

Biometry:

OZSDK.runOnDeviceBiometryAnalysis(firstResult: firstResult, secondResult: secondResult, completion: { status, error in
//show result
})

Liveness:

OZSDK.runOnDeviceLivenessAnalysis(results: results, completion: {status, error in 
//show result
})

Last updated