@oiti/rn-liveness3d 1.1.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -237
- package/android/build.gradle +4 -18
- package/android/settings.gradle +2 -2
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/br/com/oiti/rnliveness3d/RnLiveness3dModule.kt +198 -132
- package/android/src/main/java/br/com/oiti/rnliveness3d/theme/Liveness3DFonts.kt +44 -0
- package/android/src/main/java/br/com/oiti/rnliveness3d/theme/Liveness3DText.kt +68 -0
- package/android/src/main/java/br/com/oiti/rnliveness3d/theme/Liveness3DTheme.kt +147 -0
- package/ios/Podfile +2 -1
- package/ios/Pods/Manifest.lock +23 -19
- package/ios/RnLiveness3d.m +8 -3
- package/ios/RnLiveness3d.swift +198 -114
- package/lib/commonjs/@types/ArgsType.js +4 -0
- package/lib/commonjs/@types/FontsType.js +2 -0
- package/lib/commonjs/@types/FontsType.js.map +1 -0
- package/lib/commonjs/@types/ResultType.js +2 -0
- package/lib/commonjs/@types/ResultType.js.map +1 -0
- package/lib/commonjs/@types/ResultTypes.js +6 -0
- package/lib/commonjs/@types/ResultTypes.js.map +1 -0
- package/lib/commonjs/@types/TextsType.js +2 -0
- package/lib/commonjs/@types/TextsType.js.map +1 -0
- package/lib/commonjs/@types/ThemeType.js +2 -0
- package/lib/commonjs/@types/ThemeType.js.map +1 -0
- package/lib/commonjs/actions/BackButton.js +35 -0
- package/lib/commonjs/actions/BackButton.js.map +1 -0
- package/lib/commonjs/actions/ContinueButton.js +43 -0
- package/lib/commonjs/actions/ContinueButton.js.map +1 -0
- package/lib/commonjs/actions/PermissionButton.js +35 -0
- package/lib/commonjs/actions/PermissionButton.js.map +1 -0
- package/lib/commonjs/context/Liveness3DContext.js +104 -0
- package/lib/commonjs/context/Liveness3DContext.js.map +1 -0
- package/lib/commonjs/helpers/Liveness3DHelper.js +34 -0
- package/lib/commonjs/helpers/Liveness3DHelper.js.map +1 -0
- package/lib/commonjs/index.js +121 -78
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/Liveness3DHelper.js +6 -0
- package/lib/commonjs/interfaces/Liveness3DHelper.js.map +1 -0
- package/lib/commonjs/interfaces/OitiBackButtonInterface.js +6 -0
- package/lib/commonjs/interfaces/OitiBackButtonInterface.js.map +1 -0
- package/lib/commonjs/interfaces/OitiContinueButton.js +6 -0
- package/lib/commonjs/interfaces/OitiContinueButton.js.map +1 -0
- package/lib/commonjs/interfaces/OitiPermissionButtonInterface.js +6 -0
- package/lib/commonjs/interfaces/OitiPermissionButtonInterface.js.map +1 -0
- package/lib/commonjs/screens/Liveness3D/InstructionsView.js +4 -4
- package/lib/commonjs/screens/Liveness3D/InstructionsView.js.map +1 -1
- package/lib/commonjs/utils/continueButton.js +17 -0
- package/lib/commonjs/utils/continueButton.js.map +1 -0
- package/lib/commonjs/utils/permissions.js +30 -0
- package/lib/commonjs/utils/permissions.js.map +1 -0
- package/lib/commonjs/utils/screenStore.js +12 -0
- package/lib/commonjs/utils/screenStore.js.map +1 -0
- package/lib/module/@types/ArgsType.js +1 -1
- package/lib/module/@types/FontsType.js +2 -0
- package/lib/module/@types/FontsType.js.map +1 -0
- package/lib/module/@types/ResultType.js +2 -0
- package/lib/module/@types/ResultType.js.map +1 -0
- package/lib/module/@types/ResultTypes.js +2 -0
- package/lib/module/@types/ResultTypes.js.map +1 -0
- package/lib/module/@types/TextsType.js +2 -0
- package/lib/module/@types/TextsType.js.map +1 -0
- package/lib/module/@types/ThemeType.js +2 -0
- package/lib/module/@types/ThemeType.js.map +1 -0
- package/lib/module/actions/BackButton.js +26 -0
- package/lib/module/actions/BackButton.js.map +1 -0
- package/lib/module/actions/ContinueButton.js +34 -0
- package/lib/module/actions/ContinueButton.js.map +1 -0
- package/lib/module/actions/PermissionButton.js +26 -0
- package/lib/module/actions/PermissionButton.js.map +1 -0
- package/lib/module/context/Liveness3DContext.js +92 -0
- package/lib/module/context/Liveness3DContext.js.map +1 -0
- package/lib/module/helpers/Liveness3DHelper.js +25 -0
- package/lib/module/helpers/Liveness3DHelper.js.map +1 -0
- package/lib/module/index.js +97 -75
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/Liveness3DHelper.js +2 -0
- package/lib/module/interfaces/Liveness3DHelper.js.map +1 -0
- package/lib/module/interfaces/OitiBackButtonInterface.js +2 -0
- package/lib/module/interfaces/OitiBackButtonInterface.js.map +1 -0
- package/lib/module/interfaces/OitiContinueButton.js +2 -0
- package/lib/module/interfaces/OitiContinueButton.js.map +1 -0
- package/lib/module/interfaces/OitiPermissionButtonInterface.js +2 -0
- package/lib/module/interfaces/OitiPermissionButtonInterface.js.map +1 -0
- package/lib/module/screens/Liveness3D/InstructionsView.js +4 -4
- package/lib/module/screens/Liveness3D/InstructionsView.js.map +1 -1
- package/lib/module/utils/continueButton.js +10 -0
- package/lib/module/utils/continueButton.js.map +1 -0
- package/lib/module/utils/permissions.js +21 -0
- package/lib/module/utils/permissions.js.map +1 -0
- package/lib/module/utils/screenStore.js +5 -0
- package/lib/module/utils/screenStore.js.map +1 -0
- package/lib/typescript/@types/ArgsType.d.ts +9 -9
- package/lib/typescript/@types/ArgsType.d.ts.map +1 -1
- package/lib/typescript/@types/FontsType.d.ts +12 -0
- package/lib/typescript/@types/FontsType.d.ts.map +1 -0
- package/lib/typescript/@types/ResultType.d.ts +13 -0
- package/lib/typescript/@types/ResultType.d.ts.map +1 -0
- package/lib/typescript/@types/ResultTypes.d.ts +6 -0
- package/lib/typescript/@types/ResultTypes.d.ts.map +1 -0
- package/lib/typescript/@types/TextsType.d.ts +36 -0
- package/lib/typescript/@types/TextsType.d.ts.map +1 -0
- package/lib/typescript/@types/ThemeType.d.ts +48 -0
- package/lib/typescript/@types/ThemeType.d.ts.map +1 -0
- package/lib/typescript/actions/BackButton.d.ts +4 -0
- package/lib/typescript/actions/BackButton.d.ts.map +1 -0
- package/lib/typescript/actions/ContinueButton.d.ts +4 -0
- package/lib/typescript/actions/ContinueButton.d.ts.map +1 -0
- package/lib/typescript/actions/PermissionButton.d.ts +4 -0
- package/lib/typescript/actions/PermissionButton.d.ts.map +1 -0
- package/lib/typescript/context/Liveness3DContext.d.ts +28 -0
- package/lib/typescript/context/Liveness3DContext.d.ts.map +1 -0
- package/lib/typescript/helpers/Liveness3DHelper.d.ts +4 -0
- package/lib/typescript/helpers/Liveness3DHelper.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +21 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interfaces/Liveness3DHelper.d.ts +7 -0
- package/lib/typescript/interfaces/Liveness3DHelper.d.ts.map +1 -0
- package/lib/typescript/interfaces/OitiBackButtonInterface.d.ts +6 -0
- package/lib/typescript/interfaces/OitiBackButtonInterface.d.ts.map +1 -0
- package/lib/typescript/interfaces/OitiContinueButton.d.ts +6 -0
- package/lib/typescript/interfaces/OitiContinueButton.d.ts.map +1 -0
- package/lib/typescript/interfaces/OitiPermissionButtonInterface.d.ts +6 -0
- package/lib/typescript/interfaces/OitiPermissionButtonInterface.d.ts.map +1 -0
- package/lib/typescript/screens/Liveness3D/InstructionsView.d.ts +1 -0
- package/lib/typescript/screens/Liveness3D/InstructionsView.d.ts.map +1 -1
- package/lib/typescript/screens/PermissionView.d.ts +1 -0
- package/lib/typescript/screens/PermissionView.d.ts.map +1 -1
- package/lib/typescript/utils/continueButton.d.ts +2 -0
- package/lib/typescript/utils/continueButton.d.ts.map +1 -0
- package/lib/typescript/utils/permissions.d.ts +4 -0
- package/lib/typescript/utils/permissions.d.ts.map +1 -0
- package/lib/typescript/utils/screenStore.d.ts +5 -0
- package/lib/typescript/utils/screenStore.d.ts.map +1 -0
- package/oiti-rn-liveness3d.podspec +2 -1
- package/package.json +3 -6
- package/src/@types/ArgsType.ts +10 -10
- package/src/@types/FontsType.ts +22 -0
- package/src/@types/ResultType.ts +13 -0
- package/src/@types/ResultTypes.ts +6 -0
- package/src/@types/TextsType.ts +41 -0
- package/src/@types/ThemeType.ts +64 -0
- package/src/actions/BackButton.tsx +27 -0
- package/src/actions/ContinueButton.tsx +35 -0
- package/src/actions/PermissionButton.tsx +27 -0
- package/src/context/Liveness3DContext.tsx +122 -0
- package/src/helpers/Liveness3DHelper.tsx +24 -0
- package/src/index.tsx +120 -87
- package/src/interfaces/Liveness3DHelper.tsx +7 -0
- package/src/interfaces/OitiBackButtonInterface.tsx +6 -0
- package/src/interfaces/OitiContinueButton.tsx +6 -0
- package/src/interfaces/OitiPermissionButtonInterface.tsx +6 -0
- package/src/screens/Liveness3D/InstructionsView.tsx +8 -8
- package/src/utils/continueButton.tsx +12 -0
- package/src/utils/permissions.tsx +30 -0
- package/src/utils/screenStore.tsx +4 -0
package/README.md
CHANGED
|
@@ -1,248 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
<IMG src="https://github.com/oititec/liveness-android-sdk/blob/main/Documentation/Images/OitiHeader.png?raw=true" alt="OitiHeader.png"/>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Oiti - Liveness 3D para React Native
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Neste repositório, encontramos a **biblioteca NPM do Liveness 3D da Oiti**.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
| ----------- | ------- |
|
|
9
|
-
| Gradle: 6.8 | iOS: 11 |
|
|
7
|
+
O NPM (Node Package Manager) é uma ferramenta para gerenciar pacotes no Node.js, a plataforma de execução para JavaScript. Com o NPM, você tem controle total sobre as dependências do seu projeto, permitindo acesso a um repositório de bibliotecas e frameworks JavaScript.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Aqui, você pode instalar e utilizar funções como `startLiveness3d()`, além de incorporar a View como `<Liveness3dView />` em seus aplicativos híbridos desenvolvidos em React Native.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Requisitos mínimos**
|
|
12
|
+
| Android | iOS|
|
|
13
|
+
|--|--|
|
|
14
|
+
|Gradle: 6.8 | iOS: 11|
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
## Summary
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Simplificamos nossos guias de integração e de customização do React Native:
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
- [Guias de Instalação](https://devcenter.certiface.io/docs/guia-de-instalacao-react-native)
|
|
21
|
+
- [Guia de Uso e Integração](https://devcenter.certiface.io/docs/guia-de-uso-e-integracao-react-native)
|
|
22
|
+
- [Guia de Tratamento de Retorno](https://devcenter.certiface.io/docs/guia-de-tratamento-de-retornos-react-native)
|
|
23
|
+
- [Guias de Customização](https://devcenter.certiface.io/docs/customizacao-rn)
|
|
20
24
|
|
|
21
|
-
##
|
|
25
|
+
## Changelog
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
- As novidades das versões podem ser acessadas [neste link](https://www.npmjs.com/package/@oiti/rn-liveness3d?activeTab=versions).
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
npm install @oiti/rn-liveness3d
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
ou usando YARN
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
yarn add @oiti/rn-liveness3d
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## 3.2. iOS Configuração
|
|
36
|
-
|
|
37
|
-
Adicionar o Pod do FaceCaptcha no seu Podfile que está dentro da pasta `ios`
|
|
38
|
-
|
|
39
|
-
```objectivec
|
|
40
|
-
pod 'FaceCaptcha', '~> 4.10.0', :source => '<https://github.com/oititec/liveness-ios-specs.git>'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
# 4. Uso no Javascript (PASSO 2)
|
|
44
|
-
|
|
45
|
-
Primeiro devemos chamar a função desejada da biblioteca '@oiti/rn-liveness3d'
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
import { FUNÇÕES DESEJADAS } from '@oiti/rn-liveness3d';
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## 4.1. Funções
|
|
52
|
-
|
|
53
|
-
### Diagrama E2E startLiveness3d
|
|
54
|
-
|
|
55
|
-

|
|
56
|
-
|
|
57
|
-
### 4.1.1. Funções Existentes
|
|
58
|
-
|
|
59
|
-
| Função | Parâmetros | Retorno |
|
|
60
|
-
| ---------------------- | ---------- | -------------------------- |
|
|
61
|
-
| startLiveness3d(JSON); | options | RESULT_OK, RESULT_CANCELED |
|
|
62
|
-
|
|
63
|
-
> AppKey: gerada na etapa 2 da [documentação CertifaceID](https://certifaceid.readme.io/docs/integra%C3%A7%C3%A3o-atualizada)
|
|
64
|
-
|
|
65
|
-
### 4.1.2. Exemplo de uso (Funções)
|
|
66
|
-
|
|
67
|
-
Após efetuar a importação da biblioteca, deve ser aplicada a app Key gerada dentro do parâmetro da função desejada, no exemplo abaixo chamamos a função quando clicamos no botão "Liveness 3D"
|
|
68
|
-
|
|
69
|
-
```jsx
|
|
70
|
-
export default function App() {
|
|
71
|
-
const [result, setResult] = React.useState<string | undefined>();
|
|
72
|
-
const appKey = 'APP KEY';
|
|
73
|
-
|
|
74
|
-
const options = {
|
|
75
|
-
appkey: appKey,
|
|
76
|
-
environment: '.HML',
|
|
77
|
-
baseUrl: 'https://comercial.certiface.com.br:8443/',
|
|
78
|
-
apparence: {
|
|
79
|
-
backgroundColor: '#025951',
|
|
80
|
-
loadingColor: '#0CF25D',
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<View>
|
|
86
|
-
//Liveness3D
|
|
87
|
-
<Button
|
|
88
|
-
onPress={() => {
|
|
89
|
-
startLiveness3d(options).then(setResult);
|
|
90
|
-
}}
|
|
91
|
-
title="Liveness 3D"
|
|
92
|
-
/>
|
|
93
|
-
</View>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## 4.2. View Customizadas
|
|
100
|
-
|
|
101
|
-
Na biblioteca é possível aplicar uma view/componente para customizar as telas de `instruções` e a tela de `permissão` de uso da câmera.
|
|
102
|
-
|
|
103
|
-
| View | Propriedades | Descrição |
|
|
104
|
-
| ------------------ | ------------ | --------- |
|
|
105
|
-
| <Liveness3dView /> | options |
|
|
106
|
-
|
|
107
|
-
navigation
|
|
108
|
-
callbackView
|
|
109
|
-
texts
|
|
110
|
-
CustomInstructionView
|
|
111
|
-
CustomPermissionView | View do Liveness 3d para carregar as telas customizadas. |
|
|
29
|
+
## Flash tutorials
|
|
112
30
|
|
|
113
|
-
###
|
|
114
|
-
|
|
115
|
-
| Propriedade | Obrigatoriedade | Tipo | Descrição |
|
|
116
|
-
| --------------------- | --------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
117
|
-
| options | SIM | JSON | JSON de configurações da View |
|
|
118
|
-
| navigation | SIM | React navigation prop | Ambiente que deseja estar rodando a aplicação |
|
|
119
|
-
| callbackView | SIM | string | Endereço de endpoint da certiface, você pode usar uma string vazia caso deseje que a biblioteca defina um automático. |
|
|
120
|
-
| texts | NÃO | JSON | Textos personalizados da tela de captura tridimensional . |
|
|
121
|
-
| CustomInstructionView | NÃO | Component | Aplica as propriedades de customização do carregamento antes de começar o Liveness3d. |
|
|
122
|
-
| CustomPermissionView | NÃO | Component | Aplica as propriedades de customização do carregamento antes de começar o Liveness3d. |
|
|
123
|
-
|
|
124
|
-
### 4.2.2. JSON `options`
|
|
125
|
-
|
|
126
|
-
Para aplicar as configurações na View você deve aplicar as seguintes propriedades em formato JSON no Javascript:
|
|
127
|
-
|
|
128
|
-
```jsx
|
|
129
|
-
const options = {
|
|
130
|
-
appkey: appKey,
|
|
131
|
-
environment: '.HML',
|
|
132
|
-
baseUrl: 'https://comercial.certiface.com.br:8443/',
|
|
133
|
-
};
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 4.2.3. JSON `texts`
|
|
137
|
-
|
|
138
|
-
```jsx
|
|
139
|
-
const texts = {
|
|
140
|
-
READY_HEADER_1: 'Prepare-se para seu',
|
|
141
|
-
READY_HEADER_2: 'reconhecimento facial.',
|
|
142
|
-
READY_MESSAGE_1: 'Posicione o seu rosto na moldura, aproxime-se',
|
|
143
|
-
READY_MESSAGE_2: 'e toque em começar.',
|
|
144
|
-
READY_BUTTON: 'Começar',
|
|
145
|
-
|
|
146
|
-
RETRY_HEADER: 'Vamos tentar novamente?',
|
|
147
|
-
RETRY_SUBHEADER: 'Siga o exemplo de foto ideal abaixo:',
|
|
148
|
-
RETRY_MESSAGE_SMILE: 'Expressão Neutra, Sem Sorrir',
|
|
149
|
-
RETRY_MESSAGE_LIGHTING: 'Evite reflexos e iluminação extrema.',
|
|
150
|
-
RETRY_MESSAGE_CONTRAST: 'Limpe Sua Câmera',
|
|
151
|
-
RETRY_YOUR_PICTURE: 'Sua foto',
|
|
152
|
-
RETRY_IDEAL_PICTURE: 'Foto ideal',
|
|
153
|
-
RETRY_BUTTON: 'Tentar novamente',
|
|
154
|
-
|
|
155
|
-
RESULT_UPLOAD_MESSAGE: 'Enviando...',
|
|
156
|
-
RESULT_SUCCESS_MESSAGE: 'Sucesso',
|
|
157
|
-
|
|
158
|
-
FEEDBACK_CENTER_FACE: 'Centralize Seu Rosto',
|
|
159
|
-
FEEDBACK_FACE_NOT_FOUND: 'Enquadre o Seu Rosto',
|
|
160
|
-
FEEDBACK_FACE_NOT_LOOKING_STRAIGHT_AHEAD: 'Olhe Para Frente',
|
|
161
|
-
FEEDBACK_FACE_NOT_UPRIGHT: 'Mantenha a Cabeça Reta',
|
|
162
|
-
FEEDBACK_HOLD_STEADY: 'Segure Firme',
|
|
163
|
-
FEEDBACK_MOVE_PHONE_AWAY: 'Afaste-se',
|
|
164
|
-
FEEDBACK_MOVE_PHONE_CLOSER: 'Aproxime-se',
|
|
165
|
-
FEEDBACK_MOVE_PHONE_TO_EYE_LEVEL: 'Telefone ao Nível dos Olhos',
|
|
166
|
-
FEEDBACK_USE_EVEN_LIGHTING: 'Ilumine Seu Rosto Uniformemente',
|
|
167
|
-
|
|
168
|
-
FEEDBACK_FRAME_YOUR_FACE: 'Encaixe Seu Rosto no Espaço Oval',
|
|
169
|
-
FEEDBACK_HOLD_STEADY_1: 'Aguente Firme: 1',
|
|
170
|
-
FEEDBACK_HOLD_STEADY_2: 'Aguente Firme: 2',
|
|
171
|
-
FEEDBACK_HOLD_STEADY_3: 'Aguente Firme: 3',
|
|
172
|
-
FEEDBACK_REMOVE_DARK_GLASSES: 'Tire Seus Óculos de Sol',
|
|
173
|
-
FEEDBACK_NEUTRAL_EXPRESSION: 'Fique Neutro, Não Sorria',
|
|
174
|
-
FEEDBACK_CONDITIONS_TOO_BRIGHT: 'Ambiente Muito Iluminado',
|
|
175
|
-
FEEDBACK_BRIGHTEN_YOUR_ENVIRONMENT: 'Ambiente Muito Escuro',
|
|
176
|
-
};
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### 4.2.3. JSON `Loading`
|
|
180
|
-
|
|
181
|
-
```jsx
|
|
182
|
-
const loading = {
|
|
183
|
-
type: 'default' | 'spinner',
|
|
184
|
-
size: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10,
|
|
185
|
-
backgroundColor: string | undefined,
|
|
186
|
-
loadingColor: string | undefined,
|
|
187
|
-
};
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### 4.2.4. Chaves do `options`
|
|
191
|
-
|
|
192
|
-
| View | Valores | Descrição |
|
|
193
|
-
| ----------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
194
|
-
| appkey | appKey | App Key gerada no backend da aplicação e retornada para uso da biblioteca. |
|
|
195
|
-
| environment | '.HML', '.PRD' | Ambiente que deseja estar rodando a aplicação |
|
|
196
|
-
| baseUrl | https://comercial.certiface.com.br:8443/ | Endereço de endpoint da certiface, você pode usar uma string vazia caso deseje que a biblioteca defina um automático. |
|
|
197
|
-
| loading | Objeto de customização | Aplica as propriedades de customização do loading antes de começar o Liveness3d. |
|
|
198
|
-
|
|
199
|
-
### 4.2.5. Exemplo de uso (View Customizada)
|
|
200
|
-
|
|
201
|
-
Para utilizar uma view customizada você pode aplicar o seguinte código em sua biblioteca React Native.
|
|
202
|
-
|
|
203
|
-
```jsx
|
|
204
|
-
import * as React from 'react';
|
|
205
|
-
|
|
206
|
-
import { Liveness3dView } from '@oiti/rn-liveness3d';
|
|
207
|
-
|
|
208
|
-
export default function Documentscopy({ navigation }: { navigation: any }) {
|
|
209
|
-
const appKey = 'SUA_APP_KEY_AQUI';
|
|
210
|
-
const options = {
|
|
211
|
-
appkey: appKey,
|
|
212
|
-
environment: '.HML',
|
|
213
|
-
baseUrl: 'https://comercial.certiface.com.br:8443/',
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const loading = {
|
|
217
|
-
type: 'spinner',
|
|
218
|
-
size: 5,
|
|
219
|
-
backgroundColor: '#000000',
|
|
220
|
-
loadingColor: '#0CF25D',
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
const texts = {
|
|
224
|
-
READY_HEADER_1: 'Prepare-se para seu',
|
|
225
|
-
READY_HEADER_2: 'reconhecimento facial.',
|
|
226
|
-
READY_MESSAGE_1: 'Posicione o seu rosto na moldura, aproxime-se',
|
|
227
|
-
READY_MESSAGE_2: 'e toque em começar.',
|
|
228
|
-
READY_BUTTON: 'Começar',
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
return (
|
|
232
|
-
<Liveness3dView
|
|
233
|
-
options={options}
|
|
234
|
-
navigation={navigation}
|
|
235
|
-
texts={texts}
|
|
236
|
-
loading={loading}
|
|
237
|
-
callbackView="Home"
|
|
238
|
-
CustomInstructionView={CustomInstructionView}
|
|
239
|
-
CustomPermissionView={CustomPermissionView}
|
|
240
|
-
/>
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
# 5. Como executar o clone do Repositório?
|
|
31
|
+
### Como executar o clone do repositório?
|
|
246
32
|
|
|
247
33
|
Execute o código abaixo em seu terminal para clonar o código:
|
|
248
34
|
|
|
@@ -250,21 +36,21 @@ Execute o código abaixo em seu terminal para clonar o código:
|
|
|
250
36
|
git clone https://github.com/oititec/rn-liveness3d
|
|
251
37
|
```
|
|
252
38
|
|
|
253
|
-
|
|
39
|
+
### Como rodar o script?
|
|
254
40
|
|
|
255
41
|
Para rodar o script desse repositório você deve instalar as dependências do projeto, então na pasta root do projeto clonado rodar o comando.
|
|
256
42
|
|
|
257
|
-
|
|
43
|
+
**Yarn**
|
|
258
44
|
|
|
259
45
|
```bash
|
|
260
46
|
yarn
|
|
261
47
|
```
|
|
262
48
|
|
|
263
|
-
|
|
49
|
+
**Executar Projeto**
|
|
264
50
|
|
|
265
51
|
> Executar sempre em dispositivos físicos e não no simulador do iOS e Android
|
|
266
52
|
|
|
267
|
-
Yarn
|
|
53
|
+
**Yarn**
|
|
268
54
|
|
|
269
55
|
```bash
|
|
270
56
|
yarn example android
|
|
@@ -273,3 +59,13 @@ yarn example android
|
|
|
273
59
|
```bash
|
|
274
60
|
yarn example ios
|
|
275
61
|
```
|
|
62
|
+
|
|
63
|
+
## Saiba mais
|
|
64
|
+
|
|
65
|
+
- Conhecer as **ferramentas de prevenção à fraude** e suas funcionalidades: [consulte este link](https://devcenter.certiface.io/docs/certiface-funcionalidades).
|
|
66
|
+
|
|
67
|
+
- Acessar quadro de **compatibilidade de sistemas e drivers**: [consulte este link](https://devcenter.certiface.io/docs/compatibilidade-dos-servicos).
|
|
68
|
+
|
|
69
|
+
- Entrar em contato com o **atendimento Oiti**: [consulte este link](https://devcenter.certiface.io/docs/portal-de-atendimento).
|
|
70
|
+
|
|
71
|
+
---
|
package/android/build.gradle
CHANGED
|
@@ -14,7 +14,6 @@ buildscript {
|
|
|
14
14
|
classpath 'com.android.tools.build:gradle:3.5.3'
|
|
15
15
|
// noinspection DifferentKotlinGradleVersion
|
|
16
16
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
17
|
-
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -24,7 +23,6 @@ def isNewArchitectureEnabled() {
|
|
|
24
23
|
|
|
25
24
|
apply plugin: 'com.android.library'
|
|
26
25
|
apply plugin: 'kotlin-android'
|
|
27
|
-
apply plugin: 'kotlinx-serialization'
|
|
28
26
|
|
|
29
27
|
if (isNewArchitectureEnabled()) {
|
|
30
28
|
apply plugin: 'com.facebook.react'
|
|
@@ -64,8 +62,9 @@ android {
|
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
repositories {
|
|
67
|
-
mavenCentral()
|
|
68
65
|
google()
|
|
66
|
+
mavenCentral()
|
|
67
|
+
maven { url "https://raw.githubusercontent.com/oititec/android-oiti-versions/master" }
|
|
69
68
|
|
|
70
69
|
def found = false
|
|
71
70
|
def defaultDir = null
|
|
@@ -140,21 +139,8 @@ dependencies {
|
|
|
140
139
|
implementation "com.facebook.react:react-native:+"
|
|
141
140
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
142
141
|
|
|
143
|
-
implementation '
|
|
144
|
-
|
|
145
|
-
implementation 'com.google.android.material:material:1.6.1'
|
|
146
|
-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
147
|
-
implementation "org.bouncycastle:bcprov-jdk16:1.46"
|
|
148
|
-
implementation "com.squareup.okhttp3:logging-interceptor:4.9.3"
|
|
149
|
-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
|
150
|
-
implementation 'androidx.fragment:fragment-ktx:1.3.6'
|
|
151
|
-
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
|
|
152
|
-
implementation group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.9.0'
|
|
153
|
-
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
|
154
|
-
implementation 'androidx.databinding:databinding-runtime:4.2.2'
|
|
155
|
-
|
|
156
|
-
implementation 'br.com.oiti:liveness3d-sdk:8.1.4'
|
|
157
|
-
implementation 'br.com.oiti:security:1.2'
|
|
142
|
+
implementation 'br.com.oiti:liveness3d-sdk:9.2.6'
|
|
143
|
+
|
|
158
144
|
|
|
159
145
|
// From node_modules
|
|
160
146
|
}
|
package/android/settings.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dependencyResolutionManagement {
|
|
2
|
-
//
|
|
2
|
+
//repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
3
3
|
repositories {
|
|
4
|
-
|
|
4
|
+
maven { url "https://raw.githubusercontent.com/oititec/android-oiti-versions/master" }
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
2
|
package="br.com.oiti.rnliveness3d">
|
|
3
3
|
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
4
6
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
7
|
+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
|
5
8
|
|
|
6
9
|
</manifest>
|