Pular para o conteúdo principal

Referências

Este guia faz referência aos métodos e objetos de erro do SDK Web.

CÓDIGOS DE ERRO

Possíveis erros do prepareCamera

CódigoDescrição
73000Unknown and unexpected error. Unico SDK leverages a variety of APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.
73001<property> is required
73002<property> must be an instance of <class>
73003<class> with name <name> is not available to inject.
73004Class type must be a function or a class.
73005Could not find the <locale> locale.
73006Could not find text: <text>.
73100Unable to connect to internet.
73200Could not find the Unico SDK JSON file.
73201Could not load the Unico SDK JSON file.
73202Unico SDK JSON file is invalid.
73300Could not authenticate this application.
73301Could not authenticate this application.
73302Authentication token not found.
73303Current host is not registered.
73400Could not initialize camera.
73401Could not load ML models for this camera.
73402The Key could not be verified due to connectivity issues on the user's device.
73403This device/platform/browser/version combination is not supported by SDK.
73404Device is in landscape display orientation. The SDK can only be used in portrait display orientation.
73405Device blocked due to multiple failed attempts.
73406The Session was cancelled, the SDK was opened in an IFrame.
73407The SDK was not fully loaded.
73500Could not get session.
73501Could not get session.
73502Session token not found.
73600Could not find camera resource.
73601Could not start camera in production mode.
74000Invalid hexadecimal.
74001Object is not a UnicoTheme

Possíveis erros do openCamera (Liveness com interação)

CódigoDescrição
73700Could not parse camera response.
73704The user pressed the cancel button and did not complete the session.
73706The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to not allow access by a device policy.
73707The session was canceled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the background.
73708The session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor and thus portrait is required.
73710The session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set by the developer.
73715The session was cancelled because not all guidance images were configured.
73716The session was cancelled because SDK was unable to start the camera on this device.
73717The session was cancelled because the user was in a locked out state.
73718The session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera, storage, security, networking, and more. This return value is a catch-all for errors experienced during normal usage of these APIs.
73720The developer programmatically called the session cancel API.
73721The session was cancelled due to a device orientation change during the session.
73722The session was cancelled because the document is not ready.
73723The session was cancelled because there was another session in progress.
73724The session was cancelled because the camera was opened in an iFrame.
73728Connection error, please use HTTPS to connect.
73729Browser not supported, please open in another browser.
73730Unable to initialize an active liveness session because of an unknown and unexpected license error.
73731Unable to initialize an active liveness session because the license has expired.
73732Unable to initialize an active liveness session because Origin is not permitted.
73800Could not encrypt response.
73900Could not get system information.

Possíveis erros do openCamera (Liveness sem interação)

CódigoDescrição
100Ops! Algo inesperado aconteceu
101Usuário negou permissão de acesso a câmera
102Timeout, sessão expirada por tempo máximo para captura excedido
103Timeout, sessão expirada por inatividade
104Captura encerrada por estar com orientação no modo LANDSCAPE
105Captura encerrada por inatividade de tela
106Captura encerrada pelo usuário desligar o display
107O elemento com id #box-camera não foi encontrado
108Tipo de câmera inválido
109Modelos não foram carregados previamente
110Métodos de Callback não implementados corretamente
111Não foi possível baixar os modelos, pode ser erro de diretório
112Browser não suportado
113Não foi possível criptografar a sessão, tente novamente
114Câmera ocupada por outra aplicação
115Captura encerrada pelo usuário por cancelar a sessão
116A sessão foi cancelada por que a câmera não pode ser aberta em um iFrame

Declaração de tipos para uso em TypeScript

Caso esteja utilizando TypeScript em seu projeto dentro de src/ crie uma pasta @types, adicione o arquivo unico-webframe.d.ts com a seguinte declaração de tipos:

declare module 'unico-webframe' {
export interface UnicoTheme {
colorSilhouetteNeutral: string
colorSilhouetteSuccess: string
colorSilhouetteError: string
backgroundColor: string
colorText: string
backgroundColorComponents: string
colorTextComponents: string
backgroundColorBoxMessage: string
colorTextBoxMessage: string
backgroundColorButtons: string
colorTextButtons: string
htmlPopupLoading: string
colorCancelButton: string
colorProgressBar: string
}
export class UnicoConfig {
setProjectNumber(projectNumber: string): UnicoConfig

setProjectId(projectId: string): UnicoConfig

setMobileSdkAppId(mobileSdkAppId: string): UnicoConfig

setHostname(hostname: string): UnicoConfig

setHostInfo(hostInfo: string): UnicoConfig

setHostKey(hostKey: string): UnicoConfig
}
export class UnicoThemeBuilder {
setColorSilhouetteSuccess(color: string): UnicoThemeBuilder

setColorSilhouetteError(color: string): UnicoThemeBuilder

setColorSilhouetteNeutral(color: string): UnicoThemeBuilder

setBackgroundColor(color: string): UnicoThemeBuilder

setColorText(color: string): UnicoThemeBuilder

setBackgroundColorComponents(color: string): UnicoThemeBuilder

setColorTextComponents(color: string): UnicoThemeBuilder

setBackgroundColorButtons(color: string): UnicoThemeBuilder

setColorTextButtons(color: string): UnicoThemeBuilder

setBackgroundColorBoxMessage(color: string): UnicoThemeBuilder

setColorTextBoxMessage(color: string): UnicoThemeBuilder

setHtmlPopupLoading(content: string): UnicoThemeBuilder

setColorCancelButton(color: string): UnicoThemeBuilder

setColorProgressBar(color: string): UnicoThemeBuilder

build(): UnicoTheme
}
export class SelfieCameraType {
name: string

code: number

constructor(name: string, code: number)
}
export class DocumentCameraType {
name: string

code: number

description: string

constructor(name: string, code: number, description?: string)
}
export class SDKEnvironmentType {
name: string

constructor(name: string)
}
export const SelfieCameraTypes: {
NORMAL: SelfieCameraType
SMART: SelfieCameraType
}
export const DocumentCameraTypes: {
CNH: DocumentCameraType
CNH_FRENTE: DocumentCameraType
CNH_VERSO: DocumentCameraType
CPF: DocumentCameraType
OTHERS: (description: string) => DocumentCameraType
RG_FRENTE: DocumentCameraType
RG_VERSO: DocumentCameraType
RG_FRENTE_NOVO: DocumentCameraType
RG_VERSO_NOVO: DocumentCameraType
}
export const SDKEnvironmentTypes: {
PROD: SDKEnvironmentType
UAT: SDKEnvironmentType
}
export class LocaleType {
name: string

constructor(name: string)
}
export const LocaleTypes: {
PT_BR: LocaleType
EN_US: LocaleType
ES_MX: LocaleType
ES_ES: LocaleType
}
export type SuccessPictureResponse = {
encrypted: string
base64: string
}
export type ErrorPictureResponse = {
code: number
message: string
type: string
stack: any[]
}
export type CallbackCamera = {
on: {
success: (obj: SuccessPictureResponse) => void
error: (error: ErrorPictureResponse) => void
}
}
interface CameraOpener {
open: (callback: CallbackCamera) => void
}
export interface MainView {
prepareSelfieCamera: (
config: UnicoConfig | string,
cameraType: SelfieCameraType,
) => Promise<CameraOpener>
prepareSelfieCameraForIFrame: (
config: UnicoConfig | string,
cameraType: SelfieCameraType,
) => Promise<CameraOpener>
prepareDocumentCamera: (
config: UnicoConfig | string,
cameraType: DocumentCameraType,
) => Promise<CameraOpener>
}
export class UnicoCheckBuilder {
setTheme(theme: UnicoTheme): UnicoCheckBuilder

setModelsPath(path: string): UnicoCheckBuilder

setResourceDirectory(path: string): UnicoCheckBuilder

setEnvironment(environmentType: SDKEnvironmentType): UnicoCheckBuilder

setCustomFooterLogoDirectory(path: string): UnicoCheckBuilder

setLocale(localeType: LocaleType): UnicoCheckBuilder

build(): MainView
}

export class UnicoException extends Error {
constructor(message: string, public code?: number) {
super(message)
this.name = 'UnicoException'
}
}
}

Dúvidas?

Não encontrou algo ou ainda precisa de ajuda? Se já é um cliente ou parceiro, pode entrar em contato através da Central de Ajuda.