Interaction with OZ Mobile SDK in iOS
OZ Mobile SDK for IOS stands for the Software Developer’s Kit of the Oz Forensics Platform providing seamless integration with customers’ mobile apps for login and biometric identification.
Demo App
Download the demo app latest build:
https://ozforensics.com/try_for_free/quick_start_guide
A sample app source code using the Oz Liveness SDK is located in the GitHub repository:
https://gitlab.com/oz-forensics/oz-liveness-ios/-/tree/develop/OZLivenessDemo
Adding SDK functionalities to client’s mobile app
Install SDK
ДDependency manager CocoaPods is used to install OZLivenessSDK. To integrate OZLivenessSDK into an Xcode project add to Podfile:
pod 'OZLivenessSDK', :git => 'https://gitlab.com/oz-forensics/oz-liveness-ios.git', :branch => 'develop'
Project setup
Following parameter settings should be added to the project:
OZSDK.authToken = "" // valid access token for Oz API
FirebaseApp.configure()
Authorization
To authorize Oz Api and obtain authToken use method “OZSDK.login”:
OZSDK.login(login, password: password) { (token, error) in
if let token = token {
OZSDK.authToken = token
}
}
Capturing videos
You can create a controller that will capture videos as follows:
let actions: [OZVerificationMovement] = [.scanning, .smile, .far]
let ozLivenessVC: UIViewController = OZSDK.createVerificationVCWithDelegate(self, actions: actions)
self.present(ozLivenessVC, animated: true)
action - list of the user’s actions while capturing the video. Possible actions:
- .far
- .close
- .smile
- .eyes
- .up
- .down
- .left
- .right
- .scanning
- .selfie
Method onOZVerificationResult(results:) for OZVerificationDelegate retrieves shooting results containing video status and URL.
Upoading media files to be analyzed
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 necessary analyses with the help of Oz API. See methods Folder ADD, Folder Media ADD, Analyse ADD , etc.
Analyses are performed asynchronously, their statuses and results can be retrieved with the use of methods Folder SINGLE and Analyse LIST
A simple scenario of interaction with Oz API can be implemented with method OZSDK.analyse as described below.
OZSDK.analyse(
results: results,
analyseStates: [.quality],
fileUploadProgress: { (progress) in
}) { (resolution, error) in
}
Block «completion» | «resolution» will contain the result of the assigned analysis including status (status of the analysis), type (type of the analysis) и «folderID» (ID of Oz API folder).
To perform a cross-functional analysis based on video and document photos the following method is used «OZSDK.documentAnalyse»:
OZSDK.documentAnalyse(
documentPhoto: DocumentPhoto(front: frontDocumentURL, back: backDocumentURL),
results: results,
scenarioState: { (state) in
}, fileUploadProgress: { (progress) in
}) { (folderResolutionStatus, resolutions, error)
}
Block «completion» | «resolution» will contain the result of the assigned analysis (similarly to OZSDK.analyse), whereas folderResolutionStatus – will contain the general status of analyses for the folder.