Development Guide (Face Capture)

OkayCam Selfie

Configuration

-
Property Name
Description
Default Value

-

width

width to resize the image

null

-

imageQuality

quality of image

1.0 (range from 0.0 to 1.0)

topLabel

text

text of the top label

Please align your face within the frame

topLabel

color

color of the top label

#FFFFFF

topLabel

size

text size of the top label

24

-

bottomFrameColor

color of the bottom frame

#EB6709

switchBtnConfig

color

color of the switch button

#FFFFFFswitchBtnConfig

switchBtnConfig

show

show or hide the camera switch button

true

confirmBtnConfig

backgroundColor

background color of the confirm button

#ffa500

confirmBtnConfig

contentColor

content color of the confirm button

#ffffff

retakeBtnConfig

backgroundColor

background color of the retake button

#ffa500

retakeBtnConfig

contentColor

content color of the retake button

#ffffff

-

captureBtnColor

color of the capture button

#FFFFFF

-

defaultCameraFacing

initial camera facing when the selfie cam is launched

CameraFacing.FRONT

Usage

/import { captureSelfie } from "react-native-okaycamplus"

captureSelfie(
	license,
	false,
	{
		topLabel: {
			text: "Align you face within the frame",
			color: "#4287f5",
			size: 20
		},
		bottomFrameColor: "#4287f5",
		captureBtnColor: "#ffffff",
		switchBtnConfig: {
			color: "#ffffff",
			show: true
		},
        confirmBtnConfig: {
            backgroundColor: "#4287f5",
            contentColor: "#000000"
        },
        retakeBtnConfig: {
            backgroundColor: "#4287f5",
            contentColor: "#000000"
        },
		defaultCameraFacing: "front",
		width: 1000,
        imageQuality: 1.0
	}
)
	.then(result => {
		console.log(result)
	})
	.catch(error => {
		console.log(error)
	})

Results

Result
Description

selfieImage

Captured selfie image


OkayCam Selfie Plus

Usage

import { captureSelfiePlus } from "react-native-okaycam"

captureSelfiePlus(
	license,
	false
)
	.then(result => {
		console.log(result)
	})
	.catch(error => {
		console.log(error)
	})

Result

Result
Description

{ selfie: selfie_image_path, bundle: base64String }

Captured selfie image path and encrypted bundle to pass to OkayFacePlus API

Last updated

Was this helpful?