Development Guide (Face Capture)

Face Capture

  1. Instantiate the configuration object. You must pass a reference to your navigation controller.

let config = OkaySelfieConfig(navigationController: nav)
  1. Start the process by calling start on OkayCamSelfie class. Similarly, you can handle the result in the completion handler.

OkayCamSelfie.start(
    okaySelfieConfig: config,
    license: yourLicense,
    { filePath, error in
        // handle
    }
)

You will only either receieve the filePath or an error. One will be valid and the other will be nil.

Configuration

Modifying the configuration object:

        let config = OkaySelfieConfig(navigationController: nav)
        config.topLabel.text = "top label text"
        config.topLabel.color = .green
        config.topLabel.size = 14
        config.bottomFrameColor = .darkGray
        config.captureBtnColor = .white
        config.swichBtnConfig.show = true
        config.swichBtnConfig.color = .magenta
        config.confirmBtnConfig.backgroundColor = .blue
        config.confirmBtnConfig.contentColor = .black
        config.retakeBtnConfig.backgroundColor = .orange
        config.retakeBtnConfig.contentColor = .black
        config.width = 250
        config.imageQuality = 1.0
        config.defaultCameraFacing = .back
        config.outputPath = myCustomFilePath

Properties on OkaySelfieConfig:

Property
Default
Type

topLabel

OkaySelfieLabelConfig(text: "Please align your face within the frame", color: UIColor.white, size: CGFloat(18))

OkaySelfieLabelConfig

bottomFrameColor

UIColor(red: 0.92, green: 0.40, blue: 0.04, alpha: 1.0)

UIColor

captureBtnColor

UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0)

UIColor

swichBtnConfig

SwitchBtnConfig(color: UIColor.white, show: false)

SwitchBtnConfig

confirmBtnConfig

OkayCamBtnConfig(backgroundColor: UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0), contentColor: UIColor.white)

OkayCamBtnConfig

retakeBtnConfig

OkayCamBtnConfig(backgroundColor: UIColor(red: 0.92, green: 0.08, blue: 0.30, alpha: 1.0), contentColor: UIColor.white)

OkayCamBtnConfig

defaultCameraFacing

OkayCam.CameraDevice.front

OkayCam.CameraDevice

frameColor

UIColor.black

UIColor

outputPath

nil

URL?

width

nil

Int?

imageQuality

1.0 (range 0 - 1.0)

OkayCamPlus Face Capture

  1. Start the process by calling start on OkayCamPlus class. You can handle the result in the completion handler.

You will only either receive JSONString or an error. One will be valid and the other will be nil.

JSONString will return 2 values:

Result
Description

selfie

selfie_image_URLPath

bundle

base64String

FaceCapture Plus UI

  1. FaceCapture Plus Screen

  1. FaceCapure API Result (UI is for demo purposes only)

Last updated