@ha_tecno/live-id-sdk 1.0.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.
Files changed (217) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +323 -0
  3. package/android/build.gradle +94 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/liveidsdk/LiveIdSdkModule.kt +25 -0
  8. package/android/src/main/java/com/liveidsdk/LiveIdSdkPackage.kt +17 -0
  9. package/ios/LiveIdSdk-Bridging-Header.h +2 -0
  10. package/ios/LiveIdSdk.mm +14 -0
  11. package/ios/LiveIdSdk.swift +8 -0
  12. package/lib/commonjs/assets/arrow.png +0 -0
  13. package/lib/commonjs/assets/exampleInstructionWithBorder.jpeg +0 -0
  14. package/lib/commonjs/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  15. package/lib/commonjs/assets/ic_redness_capture_tip.png +0 -0
  16. package/lib/commonjs/assets/logo.png +0 -0
  17. package/lib/commonjs/components/CameraConfigInfos/index.js +21 -0
  18. package/lib/commonjs/components/CameraConfigInfos/index.js.map +1 -0
  19. package/lib/commonjs/components/CameraConfigInfos/styles.js +19 -0
  20. package/lib/commonjs/components/CameraConfigInfos/styles.js.map +1 -0
  21. package/lib/commonjs/components/DeviceNullDisplay/index.js +59 -0
  22. package/lib/commonjs/components/DeviceNullDisplay/index.js.map +1 -0
  23. package/lib/commonjs/components/ErrorDisplay/index.js +59 -0
  24. package/lib/commonjs/components/ErrorDisplay/index.js.map +1 -0
  25. package/lib/commonjs/components/Gabarito/index.js +19 -0
  26. package/lib/commonjs/components/Gabarito/index.js.map +1 -0
  27. package/lib/commonjs/components/Gabarito/styles.js +30 -0
  28. package/lib/commonjs/components/Gabarito/styles.js.map +1 -0
  29. package/lib/commonjs/components/Toast/Toast.js +66 -0
  30. package/lib/commonjs/components/Toast/Toast.js.map +1 -0
  31. package/lib/commonjs/components/WaitingForResult/index.js +24 -0
  32. package/lib/commonjs/components/WaitingForResult/index.js.map +1 -0
  33. package/lib/commonjs/components/WaitingForResult/styles.js +32 -0
  34. package/lib/commonjs/components/WaitingForResult/styles.js.map +1 -0
  35. package/lib/commonjs/index.js +34 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js +49 -0
  38. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/index.js.map +1 -0
  39. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js +62 -0
  40. package/lib/commonjs/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +1 -0
  41. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js +298 -0
  42. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/index.js.map +1 -0
  43. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js +54 -0
  44. package/lib/commonjs/screens/CadastroFinger/components/CameraCadastro/styles.js.map +1 -0
  45. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js +44 -0
  46. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +1 -0
  47. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +65 -0
  48. package/lib/commonjs/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +1 -0
  49. package/lib/commonjs/screens/CadastroFinger/index.js +50 -0
  50. package/lib/commonjs/screens/CadastroFinger/index.js.map +1 -0
  51. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js +186 -0
  52. package/lib/commonjs/screens/CadastroScreen/CadastroScreen.js.map +1 -0
  53. package/lib/commonjs/screens/ProvaVidas/index.js +246 -0
  54. package/lib/commonjs/screens/ProvaVidas/index.js.map +1 -0
  55. package/lib/commonjs/screens/ProvaVidas/styles.js +93 -0
  56. package/lib/commonjs/screens/ProvaVidas/styles.js.map +1 -0
  57. package/lib/commonjs/screens/ValidadeFinger/index.js +216 -0
  58. package/lib/commonjs/screens/ValidadeFinger/index.js.map +1 -0
  59. package/lib/commonjs/screens/ValidadeFinger/styles.js +54 -0
  60. package/lib/commonjs/screens/ValidadeFinger/styles.js.map +1 -0
  61. package/lib/commonjs/services/index.js +145 -0
  62. package/lib/commonjs/services/index.js.map +1 -0
  63. package/lib/commonjs/types/screen.js +2 -0
  64. package/lib/commonjs/types/screen.js.map +1 -0
  65. package/lib/commonjs/utils/file.js +38 -0
  66. package/lib/commonjs/utils/file.js.map +1 -0
  67. package/lib/commonjs/utils/getConfigCamera.js +25 -0
  68. package/lib/commonjs/utils/getConfigCamera.js.map +1 -0
  69. package/lib/commonjs/utils/index.js +14 -0
  70. package/lib/commonjs/utils/index.js.map +1 -0
  71. package/lib/module/assets/arrow.png +0 -0
  72. package/lib/module/assets/exampleInstructionWithBorder.jpeg +0 -0
  73. package/lib/module/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  74. package/lib/module/assets/ic_redness_capture_tip.png +0 -0
  75. package/lib/module/assets/logo.png +0 -0
  76. package/lib/module/components/CameraConfigInfos/index.js +13 -0
  77. package/lib/module/components/CameraConfigInfos/index.js.map +1 -0
  78. package/lib/module/components/CameraConfigInfos/styles.js +13 -0
  79. package/lib/module/components/CameraConfigInfos/styles.js.map +1 -0
  80. package/lib/module/components/DeviceNullDisplay/index.js +51 -0
  81. package/lib/module/components/DeviceNullDisplay/index.js.map +1 -0
  82. package/lib/module/components/ErrorDisplay/index.js +51 -0
  83. package/lib/module/components/ErrorDisplay/index.js.map +1 -0
  84. package/lib/module/components/Gabarito/index.js +11 -0
  85. package/lib/module/components/Gabarito/index.js.map +1 -0
  86. package/lib/module/components/Gabarito/styles.js +24 -0
  87. package/lib/module/components/Gabarito/styles.js.map +1 -0
  88. package/lib/module/components/Toast/Toast.js +58 -0
  89. package/lib/module/components/Toast/Toast.js.map +1 -0
  90. package/lib/module/components/WaitingForResult/index.js +17 -0
  91. package/lib/module/components/WaitingForResult/index.js.map +1 -0
  92. package/lib/module/components/WaitingForResult/styles.js +26 -0
  93. package/lib/module/components/WaitingForResult/styles.js.map +1 -0
  94. package/lib/module/index.js +7 -0
  95. package/lib/module/index.js.map +1 -0
  96. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js +41 -0
  97. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/index.js.map +1 -0
  98. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js +56 -0
  99. package/lib/module/screens/CadastroFinger/components/AjudaCadastro/styles.js.map +1 -0
  100. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js +288 -0
  101. package/lib/module/screens/CadastroFinger/components/CameraCadastro/index.js.map +1 -0
  102. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js +48 -0
  103. package/lib/module/screens/CadastroFinger/components/CameraCadastro/styles.js.map +1 -0
  104. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js +36 -0
  105. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/index.js.map +1 -0
  106. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js +59 -0
  107. package/lib/module/screens/CadastroFinger/components/ImageDisplayScreen/styles.js.map +1 -0
  108. package/lib/module/screens/CadastroFinger/index.js +42 -0
  109. package/lib/module/screens/CadastroFinger/index.js.map +1 -0
  110. package/lib/module/screens/CadastroScreen/CadastroScreen.js +177 -0
  111. package/lib/module/screens/CadastroScreen/CadastroScreen.js.map +1 -0
  112. package/lib/module/screens/ProvaVidas/index.js +239 -0
  113. package/lib/module/screens/ProvaVidas/index.js.map +1 -0
  114. package/lib/module/screens/ProvaVidas/styles.js +87 -0
  115. package/lib/module/screens/ProvaVidas/styles.js.map +1 -0
  116. package/lib/module/screens/ValidadeFinger/index.js +206 -0
  117. package/lib/module/screens/ValidadeFinger/index.js.map +1 -0
  118. package/lib/module/screens/ValidadeFinger/styles.js +48 -0
  119. package/lib/module/screens/ValidadeFinger/styles.js.map +1 -0
  120. package/lib/module/services/index.js +131 -0
  121. package/lib/module/services/index.js.map +1 -0
  122. package/lib/module/types/screen.js +2 -0
  123. package/lib/module/types/screen.js.map +1 -0
  124. package/lib/module/utils/file.js +29 -0
  125. package/lib/module/utils/file.js.map +1 -0
  126. package/lib/module/utils/getConfigCamera.js +19 -0
  127. package/lib/module/utils/getConfigCamera.js.map +1 -0
  128. package/lib/module/utils/index.js +3 -0
  129. package/lib/module/utils/index.js.map +1 -0
  130. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts +9 -0
  131. package/lib/typescript/src/components/CameraConfigInfos/index.d.ts.map +1 -0
  132. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts +11 -0
  133. package/lib/typescript/src/components/CameraConfigInfos/styles.d.ts.map +1 -0
  134. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts +11 -0
  135. package/lib/typescript/src/components/DeviceNullDisplay/index.d.ts.map +1 -0
  136. package/lib/typescript/src/components/ErrorDisplay/index.d.ts +11 -0
  137. package/lib/typescript/src/components/ErrorDisplay/index.d.ts.map +1 -0
  138. package/lib/typescript/src/components/Gabarito/index.d.ts +3 -0
  139. package/lib/typescript/src/components/Gabarito/index.d.ts.map +1 -0
  140. package/lib/typescript/src/components/Gabarito/styles.d.ts +21 -0
  141. package/lib/typescript/src/components/Gabarito/styles.d.ts.map +1 -0
  142. package/lib/typescript/src/components/Toast/Toast.d.ts +42 -0
  143. package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -0
  144. package/lib/typescript/src/components/WaitingForResult/index.d.ts +7 -0
  145. package/lib/typescript/src/components/WaitingForResult/index.d.ts.map +1 -0
  146. package/lib/typescript/src/components/WaitingForResult/styles.d.ts +24 -0
  147. package/lib/typescript/src/components/WaitingForResult/styles.d.ts.map +1 -0
  148. package/lib/typescript/src/index.d.ts +5 -0
  149. package/lib/typescript/src/index.d.ts.map +1 -0
  150. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts +7 -0
  151. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/index.d.ts.map +1 -0
  152. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts +55 -0
  153. package/lib/typescript/src/screens/CadastroFinger/components/AjudaCadastro/styles.d.ts.map +1 -0
  154. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts +16 -0
  155. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/index.d.ts.map +1 -0
  156. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts +44 -0
  157. package/lib/typescript/src/screens/CadastroFinger/components/CameraCadastro/styles.d.ts.map +1 -0
  158. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts +12 -0
  159. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/index.d.ts.map +1 -0
  160. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts +54 -0
  161. package/lib/typescript/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.d.ts.map +1 -0
  162. package/lib/typescript/src/screens/CadastroFinger/index.d.ts +16 -0
  163. package/lib/typescript/src/screens/CadastroFinger/index.d.ts.map +1 -0
  164. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts +14 -0
  165. package/lib/typescript/src/screens/CadastroScreen/CadastroScreen.d.ts.map +1 -0
  166. package/lib/typescript/src/screens/ProvaVidas/index.d.ts +14 -0
  167. package/lib/typescript/src/screens/ProvaVidas/index.d.ts.map +1 -0
  168. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts +85 -0
  169. package/lib/typescript/src/screens/ProvaVidas/styles.d.ts.map +1 -0
  170. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts +14 -0
  171. package/lib/typescript/src/screens/ValidadeFinger/index.d.ts.map +1 -0
  172. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts +44 -0
  173. package/lib/typescript/src/screens/ValidadeFinger/styles.d.ts.map +1 -0
  174. package/lib/typescript/src/services/index.d.ts +21 -0
  175. package/lib/typescript/src/services/index.d.ts.map +1 -0
  176. package/lib/typescript/src/types/screen.d.ts +6 -0
  177. package/lib/typescript/src/types/screen.d.ts.map +1 -0
  178. package/lib/typescript/src/utils/file.d.ts +3 -0
  179. package/lib/typescript/src/utils/file.d.ts.map +1 -0
  180. package/lib/typescript/src/utils/getConfigCamera.d.ts +14 -0
  181. package/lib/typescript/src/utils/getConfigCamera.d.ts.map +1 -0
  182. package/lib/typescript/src/utils/index.d.ts +3 -0
  183. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  184. package/live-id-sdk.podspec +41 -0
  185. package/package.json +184 -0
  186. package/src/assets/arrow.png +0 -0
  187. package/src/assets/exampleInstructionWithBorder.jpeg +0 -0
  188. package/src/assets/exampleInstructionWithoutFinger.jpeg +0 -0
  189. package/src/assets/ic_redness_capture_tip.png +0 -0
  190. package/src/assets/logo.png +0 -0
  191. package/src/components/CameraConfigInfos/index.tsx +25 -0
  192. package/src/components/CameraConfigInfos/styles.ts +13 -0
  193. package/src/components/DeviceNullDisplay/index.tsx +59 -0
  194. package/src/components/ErrorDisplay/index.tsx +60 -0
  195. package/src/components/Gabarito/index.tsx +11 -0
  196. package/src/components/Gabarito/styles.ts +23 -0
  197. package/src/components/Toast/Toast.tsx +61 -0
  198. package/src/components/WaitingForResult/index.tsx +22 -0
  199. package/src/components/WaitingForResult/styles.ts +27 -0
  200. package/src/index.tsx +6 -0
  201. package/src/screens/CadastroFinger/components/AjudaCadastro/index.tsx +49 -0
  202. package/src/screens/CadastroFinger/components/AjudaCadastro/styles.ts +56 -0
  203. package/src/screens/CadastroFinger/components/CameraCadastro/index.tsx +356 -0
  204. package/src/screens/CadastroFinger/components/CameraCadastro/styles.ts +47 -0
  205. package/src/screens/CadastroFinger/components/ImageDisplayScreen/index.tsx +45 -0
  206. package/src/screens/CadastroFinger/components/ImageDisplayScreen/styles.ts +55 -0
  207. package/src/screens/CadastroFinger/index.tsx +56 -0
  208. package/src/screens/CadastroScreen/CadastroScreen.tsx +212 -0
  209. package/src/screens/ProvaVidas/index.tsx +308 -0
  210. package/src/screens/ProvaVidas/styles.ts +99 -0
  211. package/src/screens/ValidadeFinger/index.tsx +263 -0
  212. package/src/screens/ValidadeFinger/styles.ts +47 -0
  213. package/src/services/index.ts +143 -0
  214. package/src/types/screen.ts +5 -0
  215. package/src/utils/file.ts +30 -0
  216. package/src/utils/getConfigCamera.ts +45 -0
  217. package/src/utils/index.ts +3 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,323 @@
1
+ # react-native-live-id-sdk
2
+
3
+ uma lib para o live id sdk
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-live-id-sdk
9
+ ```
10
+
11
+ ou
12
+
13
+ ```sh
14
+ yarn add react-native-live-id-sdk
15
+ ```
16
+
17
+ Adicione outras libs que serão utilizadas pelo sdk
18
+
19
+ ```sh
20
+ yarn add react-native-vision-camera react-native-fs
21
+
22
+
23
+ cd ios && pod install
24
+ ```
25
+
26
+ Se tiver erro com o react-native-modal ou react-native-responsive-fontsize, instale as libs abaixo
27
+
28
+ ```sh
29
+ yarn add react-native-responsive-fontsize
30
+ ```
31
+
32
+ ```sh
33
+ yarn add react-native-modal
34
+ ```
35
+
36
+ ```sh
37
+ yarn add react-native-orientation-locker
38
+ ```
39
+
40
+ obs: no Windows, você pode precisar instalar worklets-core
41
+
42
+ ```sh
43
+ yarn add react-native-worklets-core
44
+
45
+ ```
46
+
47
+ ### Android
48
+
49
+ Open your project's AndroidManifest.xml and add the following lines inside the "manifest" tag:
50
+
51
+ ```xml
52
+ <uses-permission android:name="android.permission.CAMERA" />
53
+
54
+ <!-- optionally, if you want to record audio: -->
55
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
56
+ ```
57
+
58
+ ### iOS
59
+
60
+ Open your project's Info.plist and add the following lines inside the outermost "dict" tag:
61
+
62
+ ```xml
63
+ <key>NSCameraUsageDescription</key>
64
+ <string>$(PRODUCT_NAME) needs access to your Camera.</string>
65
+
66
+ <!-- optionally, if you want to record audio: -->
67
+ <key>NSMicrophoneUsageDescription</key>
68
+ <string>$(PRODUCT_NAME) needs access to your Microphone.</string>
69
+
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ here is an example of how to use the library in your project
75
+
76
+ ```js
77
+ /* eslint-disable react-native/no-inline-styles */
78
+ import React, { useState } from 'react';
79
+ import {
80
+ ScrollView,
81
+ StyleSheet,
82
+ Text,
83
+ TouchableOpacity,
84
+ View,
85
+ } from 'react-native';
86
+ import {
87
+ ValidaFinger,
88
+ CameraProvaVidas,
89
+ CadastroFinger,
90
+ CadastroScreen,
91
+ } from 'react-native-live-id-sdk';
92
+
93
+ export default function App() {
94
+ const [person, setPerson] = useState<{
95
+ cpf: string;
96
+ finger: boolean;
97
+ person_id: string;
98
+ status: string;
99
+ } | null>({
100
+ cpf: '11111111111',
101
+ finger: false,
102
+ person_id: '321',
103
+ status: 'Ativo',
104
+ });
105
+
106
+ // estados para abrir e fechar os modais do sdk
107
+ const [showModalValidaFinger, setShowModalValidaFinger] = useState(false);
108
+ const [showModalProvaVidas, setShowModalProvaVidas] = useState(false);
109
+ const [showModalCadastroFinger, setShowModalCadastroFinger] = useState(false);
110
+ const [showModalCadastroScreen, setShowModalCadastroScreen] = useState(false);
111
+
112
+ return (
113
+ <ScrollView
114
+ contentContainerStyle={{
115
+ paddingBottom: 100,
116
+ }}
117
+ >
118
+ <View style={styles.container}>
119
+ <Text style={styles.textExplicativoTitle}>
120
+ Logo abaixo temos alguns exemplos de como utilizar o SDK.
121
+ </Text>
122
+ <Text style={styles.textExplicativo}>
123
+ <Text style={styles.textBold}> 1 - </Text>Aqui abaixo temos
124
+ informacoes do usuario que foi cadastrado, caso ainda nao tenha,
125
+ clique em CadastroScreen para cadastrar e depois testar as outras
126
+ funcionalidades.
127
+ </Text>
128
+ {person ? (
129
+ <View style={styles.containerPerson}>
130
+ <Text style={styles.personText}>ID: {person?.person_id}</Text>
131
+ <Text style={styles.personText}>CPF:{person?.cpf}</Text>
132
+ <Text style={styles.personText}>STATUS: {person?.status}</Text>
133
+ <Text style={styles.personText}>
134
+ DIGITAL:{' '}
135
+ {person?.finger ? 'Possui digital' : 'Não possui digital'}
136
+ </Text>
137
+ </View>
138
+ ) : (
139
+ <View style={styles.containerPerson}>
140
+ <Text style={styles.textNoperson}>
141
+ Clique em "Cadastrar usuário teste" para cadastrar e depois testar
142
+ as outras funcionalidades.
143
+ </Text>
144
+ </View>
145
+ )}
146
+ <TouchableOpacity
147
+ // disabled={person ? true : false}
148
+ style={[
149
+ styles.containerButton,
150
+ {
151
+ // backgroundColor: person ? 'gray' : 'lightblue',
152
+ },
153
+ ]}
154
+ onPress={() => setShowModalCadastroScreen(true)}
155
+ >
156
+ <Text style={styles.personText}>Cadastrar usuário teste</Text>
157
+ </TouchableOpacity>
158
+
159
+ <TouchableOpacity
160
+ style={[
161
+ styles.containerButton,
162
+ {
163
+ backgroundColor: !person ? 'gray' : 'lightblue',
164
+ },
165
+ ]}
166
+ onPress={() => setShowModalCadastroFinger(true)}
167
+ >
168
+ <Text style={styles.personText}>Cadastrar digital</Text>
169
+ </TouchableOpacity>
170
+
171
+ <TouchableOpacity
172
+ style={[
173
+ styles.containerButton,
174
+ {
175
+ backgroundColor: !person ? 'gray' : 'lightblue',
176
+ },
177
+ ]}
178
+ onPress={() => setShowModalValidaFinger(true)}
179
+ >
180
+ <Text style={styles.personText}>Validar digital</Text>
181
+ </TouchableOpacity>
182
+
183
+ <TouchableOpacity
184
+ style={[
185
+ styles.containerButton,
186
+ {
187
+ backgroundColor: !person ? 'gray' : 'lightblue',
188
+ },
189
+ ]}
190
+ onPress={() => setShowModalProvaVidas(true)}
191
+ >
192
+ <Text style={styles.personText}>Prova de vida</Text>
193
+ </TouchableOpacity>
194
+
195
+ <CadastroScreen
196
+ screenProps={{ id: '321' }}
197
+ isVisible={showModalCadastroScreen}
198
+ onCloseModal={() => setShowModalCadastroScreen(false)}
199
+ onError={(response) => console.log('onError --> ', response)}
200
+ onSuccess={response => {
201
+ setPerson({
202
+ cpf: response?.cpf,
203
+ finger: response?.finger,
204
+ person_id: response?.person_id,
205
+ status: response?.status,
206
+ });
207
+ console.log('onSuccess --> ', response);
208
+ }}
209
+ />
210
+
211
+ <CadastroFinger
212
+ screenProps={{ id: '321' }}
213
+ isVisible={showModalCadastroFinger}
214
+ onCloseModal={() => setShowModalCadastroFinger(false)}
215
+ onError={(response) => console.log('onError --> ', response)}
216
+ onSuccess={(response) => console.log('onSuccess --> ', response)}
217
+ />
218
+
219
+ <ValidaFinger
220
+ screenProps={{ id: '321' }}
221
+ isVisible={showModalValidaFinger}
222
+ onCloseModal={() => setShowModalValidaFinger(false)}
223
+ onError={(response) => console.log('onError --> ', response)}
224
+ onSuccess={(response) => console.log('onSuccess --> ', response)}
225
+ />
226
+
227
+ <CameraProvaVidas
228
+ screenProps={{ id: '321' }}
229
+ isVisible={showModalProvaVidas}
230
+ onCloseModal={() => setShowModalProvaVidas(false)}
231
+ onError={(response) => console.log('onError --> ', response)}
232
+ onSuccess={(response) => {
233
+ console.log('onSuccess --> ', response);
234
+ }}
235
+ />
236
+ </View>
237
+ </ScrollView>
238
+ );
239
+ }
240
+
241
+ const styles = StyleSheet.create({
242
+ container: {
243
+ flex: 1,
244
+ padding: 10,
245
+ },
246
+
247
+ containerButton: {
248
+ width: '100%',
249
+ height: 50,
250
+ backgroundColor: 'lightblue',
251
+ borderRadius: 8,
252
+ alignItems: 'center',
253
+ justifyContent: 'center',
254
+ marginTop: 30,
255
+ },
256
+
257
+ containerPerson: {
258
+ width: '100%',
259
+ height: 100,
260
+ backgroundColor: '#ccc',
261
+ borderRadius: 4,
262
+ alignItems: 'flex-start',
263
+ justifyContent: 'center',
264
+ padding: 10,
265
+ marginBottom: 20,
266
+ },
267
+
268
+ button: {
269
+ width: '100%',
270
+ height: 50,
271
+ backgroundColor: 'lightblue',
272
+ borderRadius: 4,
273
+ alignItems: 'center',
274
+ justifyContent: 'center',
275
+ marginTop: 10,
276
+ },
277
+
278
+ personText: {
279
+ fontSize: 16,
280
+ color: '#000',
281
+ },
282
+
283
+ textBold: {
284
+ fontWeight: 'bold',
285
+ fontSize: 18,
286
+ },
287
+
288
+ textExplicativoTitle: {
289
+ fontSize: 20,
290
+ fontWeight: 'bold',
291
+ color: '#000',
292
+ margin: 10,
293
+ },
294
+
295
+ textExplicativo: {
296
+ fontSize: 16,
297
+ color: '#000',
298
+ margin: 10,
299
+ fontStyle: 'italic',
300
+ },
301
+
302
+ textNoperson: {
303
+ fontSize: 16,
304
+ color: '#000',
305
+ margin: 10,
306
+ fontWeight: 'bold',
307
+ },
308
+
309
+ textError: {
310
+ fontSize: 12,
311
+ color: 'red',
312
+ margin: 10,
313
+ fontWeight: 'bold',
314
+ },
315
+ });
316
+
317
+
318
+
319
+ ```
320
+
321
+ ## License
322
+
323
+ MIT
@@ -0,0 +1,94 @@
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["LiveIdSdk_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ def isNewArchitectureEnabled() {
18
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
+ }
20
+
21
+ apply plugin: "com.android.library"
22
+ apply plugin: "kotlin-android"
23
+
24
+ if (isNewArchitectureEnabled()) {
25
+ apply plugin: "com.facebook.react"
26
+ }
27
+
28
+ def getExtOrDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["LiveIdSdk_" + name]
30
+ }
31
+
32
+ def getExtOrIntegerDefault(name) {
33
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["LiveIdSdk_" + name]).toInteger()
34
+ }
35
+
36
+ def supportsNamespace() {
37
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38
+ def major = parsed[0].toInteger()
39
+ def minor = parsed[1].toInteger()
40
+
41
+ // Namespace support was added in 7.3.0
42
+ return (major == 7 && minor >= 3) || major >= 8
43
+ }
44
+
45
+ android {
46
+ if (supportsNamespace()) {
47
+ namespace "com.liveidsdk"
48
+
49
+ sourceSets {
50
+ main {
51
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
52
+ }
53
+ }
54
+ }
55
+
56
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
57
+
58
+ defaultConfig {
59
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
60
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
61
+
62
+ }
63
+
64
+ buildTypes {
65
+ release {
66
+ minifyEnabled false
67
+ }
68
+ }
69
+
70
+ lintOptions {
71
+ disable "GradleCompatible"
72
+ }
73
+
74
+ compileOptions {
75
+ sourceCompatibility JavaVersion.VERSION_1_8
76
+ targetCompatibility JavaVersion.VERSION_1_8
77
+ }
78
+ }
79
+
80
+ repositories {
81
+ mavenCentral()
82
+ google()
83
+ }
84
+
85
+ def kotlin_version = getExtOrDefault("kotlinVersion")
86
+
87
+ dependencies {
88
+ // For < 0.71, this will be from the local maven repo
89
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
90
+ //noinspection GradleDynamicVersion
91
+ implementation "com.facebook.react:react-native:+"
92
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
93
+ }
94
+
@@ -0,0 +1,5 @@
1
+ LiveIdSdk_kotlinVersion=1.7.0
2
+ LiveIdSdk_minSdkVersion=21
3
+ LiveIdSdk_targetSdkVersion=31
4
+ LiveIdSdk_compileSdkVersion=31
5
+ LiveIdSdk_ndkversion=21.4.7075529
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.liveidsdk">
3
+ <uses-permission android:name="android.permission.CAMERA" />
4
+ </manifest>
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,25 @@
1
+ package com.liveidsdk
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
5
+ import com.facebook.react.bridge.ReactMethod
6
+ import com.facebook.react.bridge.Promise
7
+
8
+ class LiveIdSdkModule(reactContext: ReactApplicationContext) :
9
+ ReactContextBaseJavaModule(reactContext) {
10
+
11
+ override fun getName(): String {
12
+ return NAME
13
+ }
14
+
15
+ // Example method
16
+ // See https://reactnative.dev/docs/native-modules-android
17
+ @ReactMethod
18
+ fun multiply(a: Double, b: Double, promise: Promise) {
19
+ promise.resolve(a * b)
20
+ }
21
+
22
+ companion object {
23
+ const val NAME = "LiveIdSdk"
24
+ }
25
+ }
@@ -0,0 +1,17 @@
1
+ package com.liveidsdk
2
+
3
+ import com.facebook.react.ReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.uimanager.ViewManager
7
+
8
+
9
+ class LiveIdSdkPackage : ReactPackage {
10
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11
+ return listOf(LiveIdSdkModule(reactContext))
12
+ }
13
+
14
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15
+ return emptyList()
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,14 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(LiveIdSdk, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
6
+ withResolver:(RCTPromiseResolveBlock)resolve
7
+ withRejecter:(RCTPromiseRejectBlock)reject)
8
+
9
+ + (BOOL)requiresMainQueueSetup
10
+ {
11
+ return NO;
12
+ }
13
+
14
+ @end
@@ -0,0 +1,8 @@
1
+ @objc(LiveIdSdk)
2
+ class LiveIdSdk: NSObject {
3
+
4
+ @objc(multiply:withB:withResolver:withRejecter:)
5
+ func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
6
+ resolve(a*b)
7
+ }
8
+ }
Binary file
Binary file
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CameraConfigInfos = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _styles = require("./styles");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const CameraConfigInfos = ({
12
+ exposure,
13
+ zoom,
14
+ showButtonInfo
15
+ }) => {
16
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showButtonInfo ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
17
+ style: _styles.styles.text
18
+ }, "Exposi\xE7\xE3o: ", exposure, " | Zoom: ", zoom) : null);
19
+ };
20
+ exports.CameraConfigInfos = CameraConfigInfos;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_styles","obj","__esModule","default","CameraConfigInfos","exposure","zoom","showButtonInfo","createElement","Fragment","Text","style","styles","text","exports"],"sourceRoot":"../../../../src","sources":["components/CameraConfigInfos/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAkC,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAQ3B,MAAMG,iBAAiB,GAAGA,CAAC;EAChCC,QAAQ;EACRC,IAAI;EACJC;AACK,CAAC,KAAK;EACX,oBACEX,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAAAZ,MAAA,CAAAO,OAAA,CAAAM,QAAA,QACGF,cAAc,gBACbX,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAW,IAAI;IAACC,KAAK,EAAEC,cAAM,CAACC;EAAK,GAAC,mBACb,EAACR,QAAQ,EAAC,WAAS,EAACC,IAC3B,CAAC,GACL,IACJ,CAAC;AAEP,CAAC;AAACQ,OAAA,CAAAV,iBAAA,GAAAA,iBAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.styles = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _reactNativeResponsiveFontsize = require("react-native-responsive-fontsize");
9
+ const styles = exports.styles = _reactNative.StyleSheet.create({
10
+ text: {
11
+ fontSize: 18,
12
+ fontWeight: '500',
13
+ color: '#fff',
14
+ textAlign: 'center',
15
+ width: (0, _reactNativeResponsiveFontsize.RFValue)(300),
16
+ marginBottom: (0, _reactNativeResponsiveFontsize.RFValue)(20)
17
+ }
18
+ });
19
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNativeResponsiveFontsize","styles","exports","StyleSheet","create","text","fontSize","fontWeight","color","textAlign","width","RFValue","marginBottom"],"sourceRoot":"../../../../src","sources":["components/CameraConfigInfos/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAD,OAAA;AAEO,MAAME,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,uBAAU,CAACC,MAAM,CAAC;EACtCC,IAAI,EAAE;IACJC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAE,IAAAC,sCAAO,EAAC,GAAG,CAAC;IACnBC,YAAY,EAAE,IAAAD,sCAAO,EAAC,EAAE;EAC1B;AACF,CAAC,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DeviceNullDisplay = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeModal = _interopRequireDefault(require("react-native-modal"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
+ const DeviceNullDisplay = ({
13
+ isVisible,
14
+ onCloseModalHandler,
15
+ requestCameraPermission,
16
+ ...modalParams
17
+ }) => {
18
+ return /*#__PURE__*/_react.default.createElement(_reactNativeModal.default, _extends({
19
+ style: styles.modal,
20
+ isVisible: isVisible,
21
+ swipeDirection: "down",
22
+ propagateSwipe: true,
23
+ onSwipeComplete: onCloseModalHandler
24
+ }, modalParams), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
25
+ style: styles.container
26
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
27
+ style: styles.errorText
28
+ }, "O dispositivo n\xE3o possui camera ou n\xE3o foi possivel acessar a camera !"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
29
+ style: styles.buttonContainer
30
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Button, {
31
+ title: "Fechar Camera",
32
+ onPress: onCloseModalHandler
33
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.Button, {
34
+ title: "Tentar novamente",
35
+ onPress: requestCameraPermission
36
+ })));
37
+ };
38
+ exports.DeviceNullDisplay = DeviceNullDisplay;
39
+ const styles = _reactNative.StyleSheet.create({
40
+ modal: {
41
+ margin: 0
42
+ },
43
+ container: {
44
+ flex: 1,
45
+ alignItems: 'center',
46
+ justifyContent: 'center',
47
+ backgroundColor: 'white'
48
+ },
49
+ errorText: {
50
+ color: 'black',
51
+ fontWeight: 'bold',
52
+ fontSize: 20,
53
+ marginBottom: 16
54
+ },
55
+ buttonContainer: {
56
+ marginBottom: 16
57
+ }
58
+ });
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeModal","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","DeviceNullDisplay","isVisible","onCloseModalHandler","requestCameraPermission","modalParams","createElement","style","styles","modal","swipeDirection","propagateSwipe","onSwipeComplete","View","container","Text","errorText","buttonContainer","Button","title","onPress","exports","StyleSheet","create","margin","flex","alignItems","justifyContent","backgroundColor","color","fontWeight","fontSize","marginBottom"],"sourceRoot":"../../../../src","sources":["components/DeviceNullDisplay/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA4D,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AASrD,MAAMQ,iBAAmD,GAAGA,CAAC;EAClEC,SAAS;EACTC,mBAAmB;EACnBC,uBAAuB;EACvB,GAAGC;AACL,CAAC,KAAK;EACJ,oBACE1B,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACvB,iBAAA,CAAAG,OAAK,EAAAC,QAAA;IACJoB,KAAK,EAAEC,MAAM,CAACC,KAAM;IACpBP,SAAS,EAAEA,SAAU;IACrBQ,cAAc,EAAC,MAAM;IACrBC,cAAc,EAAE,IAAK;IACrBC,eAAe,EAAET;EAAoB,GACjCE,WAAW,gBAEf1B,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACxB,YAAA,CAAA+B,IAAI;IAACN,KAAK,EAAEC,MAAM,CAACM;EAAU,gBAC5BnC,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACxB,YAAA,CAAAiC,IAAI;IAACR,KAAK,EAAEC,MAAM,CAACQ;EAAU,GAAC,8EAEzB,CAAC,eACPrC,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACxB,YAAA,CAAA+B,IAAI;IAACN,KAAK,EAAEC,MAAM,CAACS;EAAgB,gBAClCtC,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACxB,YAAA,CAAAoC,MAAM;IAACC,KAAK,EAAC,eAAe;IAACC,OAAO,EAAEjB;EAAoB,CAAE,CACzD,CAAC,eACPxB,MAAA,CAAAO,OAAA,CAAAoB,aAAA,CAACxB,YAAA,CAAAoC,MAAM;IAACC,KAAK,EAAC,kBAAkB;IAACC,OAAO,EAAEhB;EAAwB,CAAE,CAChE,CACD,CAAC;AAEZ,CAAC;AAACiB,OAAA,CAAApB,iBAAA,GAAAA,iBAAA;AAEF,MAAMO,MAAM,GAAGc,uBAAU,CAACC,MAAM,CAAC;EAC/Bd,KAAK,EAAE;IACLe,MAAM,EAAE;EACV,CAAC;EACDV,SAAS,EAAE;IACTW,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,eAAe,EAAE;EACnB,CAAC;EACDZ,SAAS,EAAE;IACTa,KAAK,EAAE,OAAO;IACdC,UAAU,EAAE,MAAM;IAClBC,QAAQ,EAAE,EAAE;IACZC,YAAY,EAAE;EAChB,CAAC;EACDf,eAAe,EAAE;IACfe,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}