react-native-zybanbifbio-module 0.2.2 → 0.4.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 +39 -10
- package/android/build.gradle +95 -83
- package/android/src/main/java/com/zybanbifbiomodule/ZyBioBanbifReactNativeModuleModule.kt +50 -13
- package/android/src/main/java/com/zybanbifbiomodule/bean/ErroresPantallaRN.kt +32 -0
- package/android/src/main/java/com/zybanbifbiomodule/bean/Opcional.kt +16 -0
- package/android/src/main/java/com/zybanbifbiomodule/bean/ScreenText.kt +27 -0
- package/android/src/main/java/com/zybanbifbiomodule/bean/StepperRN.kt +24 -0
- package/ios/ZyBanbifBioRn.m +41 -24
- package/package.json +1 -1
- package/react-native-zybanbifbio-module.podspec +1 -1
- package/android/gradle.properties +0 -5
- package/android/libs/device-environment-2.1.1.1.aar +0 -0
- package/android/libs/face-3.5.0.aar +0 -0
- package/android/libs/lkms-client-crypto-2.1.0-alpha2.jar +0 -0
- package/android/libs/lkms-core-4.1.0.aar +0 -0
- package/android/libs/lkms-shared-2.1.0-alpha2.jar +0 -0
- package/android/libs/metadata-crypto-1.0.2.jar +0 -0
- package/android/libs/plugin-algorithm-f6-0-idd80-4.32.1.aar +0 -0
- package/android/libs/plugin-core-4.32.1.aar +0 -0
- package/android/libs/plugin-face-4.32.1.aar +0 -0
- package/android/libs/plugin-face-normal-4.32.1.aar +0 -0
- package/android/libs/remote-logging-1.0.8.aar +0 -0
- package/android/libs/service_provider_local-1.2.5.aar +0 -0
- package/android/libs/smartFace-4.32.1.aar +0 -0
- package/android/libs/smartsdk-face-native-lkms-2.4.0-face.aar +0 -0
- package/android/libs/zy-banbif-validacionfacial-lib-android-debug-5.3.15.aar +0 -0
- package/android/libs/zyOFacial_v9-debug-1.8.10.aar +0 -0
- package/android/libs/zylibregulaocr-debug-1.2.3.aar +0 -0
- package/android/libs/zylibuiandroid-debug-0.1.12.aar +0 -0
package/README.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
Libreria la cual es encargada de verificación biométrica de personas peruanas.
|
|
4
4
|
Esta libreria esta diseñada especificamente para le empresa 11.
|
|
5
5
|
|
|
6
|
+
## Anotaciones
|
|
7
|
+
-iOS: version para iOS fue compilada con XCODE 16.0, es decir que el preoyecto debe utilizar XCODE 16.0 o superior , ademas el tarjet minimo es ios 13.0
|
|
8
|
+
-Android: version minima de android es 22, version compilada con compileSDK 34, se recomienda usar compileSDK 34 o superior
|
|
9
|
+
|
|
10
|
+
## NOTAS:
|
|
11
|
+
-La versión 0.4.0 o superior usa la nueva estructurá en el request -> opciones
|
|
12
|
+
ejm. NativeModules.ZyBanbifBioRn.validacionFacialOcr(opciones).then(result => {})
|
|
13
|
+
|
|
6
14
|
|
|
7
15
|
## Installation
|
|
8
16
|
|
|
@@ -12,21 +20,43 @@ npm install react-native-zybanbifbio-module
|
|
|
12
20
|
|
|
13
21
|
## Usage
|
|
14
22
|
|
|
23
|
+
### MÉTODO
|
|
15
24
|
```js
|
|
16
25
|
import { NativeModules } from 'react-native';
|
|
17
26
|
|
|
18
27
|
// ...
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const opciones = {
|
|
30
|
+
tiDocumento: "1", // tipo Documento : DNI: 1 nuDocumento: documentNumber, // Numero de documento
|
|
31
|
+
nuDocumento: "00112233", // Número de documento
|
|
32
|
+
accessToken: "abcdfghi12345", // Access token generado por ambiente
|
|
33
|
+
bioPais: "PE", //Pais de verificacion (siempre PE)
|
|
34
|
+
tiOperacion: "FULL", //Operacion puede ser FULL o FACIAL
|
|
35
|
+
urlSource: "SIGN", // Ambiente a la conexion DEV2 , POC , DEVX , SIGN (PRODUCCION)
|
|
36
|
+
stepper: {
|
|
37
|
+
nuPasos: 3, // cuando nuPasos es 0 desaparece || si número de pasos es 0 los steppers se ocultan
|
|
38
|
+
pasoActual: 2 // paso en el cual el circulo señalará
|
|
39
|
+
},
|
|
40
|
+
errores: {
|
|
41
|
+
reintentar: {
|
|
42
|
+
titulo: "Reintentar",
|
|
43
|
+
descripcion: "Ha ocurrido un error. Puedes intentar nuevamente presionando el botón a continuación.",
|
|
44
|
+
textoBoton: "Reintentar"
|
|
45
|
+
},
|
|
46
|
+
limite_tiempo_alcanzado: {
|
|
47
|
+
titulo: "Límite de tiempo alcanzado",
|
|
48
|
+
descripcion: "El tiempo máximo para realizar esta operación ha expirado. Por favor, intenta nuevamente.",
|
|
49
|
+
textoBoton: "Entendido"
|
|
50
|
+
},
|
|
51
|
+
limite_intentos_alcanzado: {
|
|
52
|
+
titulo: "Límite de intentos alcanzado",
|
|
53
|
+
descripcion: "Has alcanzado el número máximo de intentos permitidos. Por favor, inténtalo más tarde.",
|
|
54
|
+
textoBoton: "Entendido"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
NativeModules.ZyBanbifBioRn.validacionFacialOcr(opciones)
|
|
28
59
|
.then(result => {
|
|
29
|
-
|
|
30
60
|
})
|
|
31
61
|
|
|
32
62
|
//..
|
|
@@ -34,7 +64,6 @@ npm install react-native-zybanbifbio-module
|
|
|
34
64
|
//para mas información revisar el documento de especificación.
|
|
35
65
|
```
|
|
36
66
|
|
|
37
|
-
|
|
38
67
|
## Contributing
|
|
39
68
|
|
|
40
69
|
- Elaborado por Iván A. Cáceres Z.
|
package/android/build.gradle
CHANGED
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath "com.android.tools.build:gradle:8.1.1"
|
|
9
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
apply plugin: 'com.android.library'
|
|
14
14
|
apply plugin: 'kotlin-android'
|
|
15
15
|
|
|
16
16
|
android {
|
|
17
|
-
|
|
17
|
+
// Conditional for compatibility with AGP <4.2.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
compileSdk 34
|
|
20
|
+
|
|
21
|
+
defaultConfig {
|
|
22
|
+
minSdkVersion 21
|
|
23
|
+
targetSdk 34
|
|
24
|
+
versionCode 1
|
|
25
|
+
versionName "1.0"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
lint {
|
|
29
|
+
//disable 'MissingTranslation', 'TypographyFractions'
|
|
30
|
+
abortOnError false
|
|
31
|
+
checkReleaseBuilds false
|
|
32
|
+
}
|
|
33
|
+
packagingOptions {
|
|
34
|
+
exclude 'META-INF/DEPENDENCIES'
|
|
35
|
+
exclude 'META-INF/NOTICE'
|
|
36
|
+
exclude 'META-INF/LICENSE'
|
|
37
|
+
}
|
|
25
38
|
|
|
26
|
-
lint {
|
|
27
|
-
//disable 'MissingTranslation', 'TypographyFractions'
|
|
28
|
-
abortOnError false
|
|
29
|
-
checkReleaseBuilds false
|
|
30
|
-
}
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
rootProject.allprojects {
|
|
34
42
|
repositories {
|
|
43
|
+
mavenCentral()
|
|
44
|
+
maven {
|
|
45
|
+
url "https://repo.zytrust.com/artifactory/zy-mobile-maven"
|
|
46
|
+
}
|
|
35
47
|
maven {
|
|
36
48
|
url "https://maven.regulaforensics.com/RegulaDocumentReader"
|
|
37
49
|
}
|
|
@@ -39,74 +51,74 @@ rootProject.allprojects {
|
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
dependencies {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
54
|
+
//INICIO_ZY_ZYTRUST
|
|
55
|
+
implementation("com.facebook.react:react-android")
|
|
56
|
+
|
|
57
|
+
implementation 'androidx.appcompat:appcompat:1.4.0'
|
|
58
|
+
implementation 'com.google.android.material:material:1.5.0'
|
|
59
|
+
|
|
60
|
+
/************************gson***********************************/
|
|
61
|
+
implementation 'com.google.code.gson:gson:2.8.7'
|
|
62
|
+
|
|
63
|
+
/** * Retrofit ***/
|
|
64
|
+
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
|
|
65
|
+
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
|
|
66
|
+
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
67
|
+
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
|
68
|
+
/** * Retrofit ***/
|
|
69
|
+
|
|
70
|
+
implementation 'androidx.annotation:annotation:1.0.0'
|
|
71
|
+
|
|
72
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
|
73
|
+
//implementation 'com.airbnb.android:lottie:3.0.1'
|
|
74
|
+
|
|
75
|
+
implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.6"
|
|
76
|
+
|
|
77
|
+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
|
|
78
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
|
|
79
|
+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
|
|
80
|
+
|
|
81
|
+
implementation 'morpho.mph_bio_sdk.android:SmartFace:4.32.1@aar'//AGREGAR PRIMORDIAL INIT 0
|
|
82
|
+
implementation 'morpho.lkms-android:service_provider_local:1.2.5@aar'//3
|
|
83
|
+
implementation 'com.idemia.smartsdk:plugin-core:4.32.1@aar'//5
|
|
84
|
+
implementation 'com.idemia.logging:remote-logging:1.0.8@aar'//9
|
|
85
|
+
implementation 'com.idemia.smartsdk:smartsdk-face-native-lkms:2.4.0@aar'
|
|
86
|
+
//13 cuando se compile la cuenta de zytrust usar implementation 'com.idemia.smartsdk:smartsdk-face-native-lkms:2.4.0@aar'
|
|
87
|
+
implementation 'com.idemia.smartsdk:plugin-face:4.32.1@aar' //14
|
|
88
|
+
implementation 'com.idemia.lkms:lkms-core:4.1.0@aar'//4
|
|
89
|
+
implementation 'com.idemia.smartsdk:plugin-algorithm-f6-0-idd80:4.32.1@aar'//15
|
|
90
|
+
implementation 'com.idemia.smartsdk:plugin-face-normal:4.32.1@aar'//12
|
|
91
|
+
implementation 'com.morpho.lkms.android.sdk.deviceenvironment:device-environment:2.1.2@aar'//4
|
|
92
|
+
implementation 'morpho.lkms-server:lkms-shared:2.1.0-alpha2'//4
|
|
93
|
+
implementation 'com.idemia.smartsdk.remote:metadata-crypto:1.0.2'//11 es jar
|
|
94
|
+
implementation 'morpho.lkms-server:lkms-client-crypto:2.1.0-alpha2'//4
|
|
95
|
+
|
|
96
|
+
implementation(group: 'com.zy.android.lib.bio.facial.api', name: 'facial', version: '1.8.11', ext: 'aar')
|
|
97
|
+
implementation(group: 'com.zy.banbif.lib.zylibuiandroid.ui.pantallas', name: 'ui', version: '0.1.16', ext: 'aar')
|
|
98
|
+
|
|
99
|
+
/************OCR************/
|
|
100
|
+
implementation 'com.google.android.gms:play-services-vision:20.1.3'
|
|
101
|
+
implementation 'com.regula.documentreader.core:fullauth:7.4.11455'
|
|
102
|
+
implementation('com.regula.documentreader:api:7.4.10090') {
|
|
103
|
+
transitive = true;
|
|
104
|
+
}
|
|
105
|
+
implementation(group: 'com.zy.regula.sdk', name: 'capturaDocumento', version: '1.2.8', ext: 'aar')
|
|
93
106
|
|
|
94
|
-
|
|
95
|
-
implementation files('libs/zy-banbif-validacionfacial-lib-android-debug-5.3.15.aar')
|
|
107
|
+
implementation(group: 'com.zy.banbif.android.lib.sdk', name: 'validacionfacial', version: '5.4.0', ext: 'aar')
|
|
96
108
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
implementation 'net.zetetic:android-database-sqlcipher:4.5.3'
|
|
110
|
+
implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
|
|
111
|
+
implementation 'androidx.security:security-crypto:1.1.0-alpha01'
|
|
112
|
+
implementation 'androidx.activity:activity:1.9.1'
|
|
101
113
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
/*********************ENCRYPTACION SERVICIO**********************/
|
|
115
|
+
implementation 'commons-codec:commons-codec:1.10'
|
|
116
|
+
implementation 'com.auth0.android:jwtdecode:2.0.0'
|
|
105
117
|
|
|
106
|
-
|
|
118
|
+
/****************************************************************/
|
|
107
119
|
|
|
108
|
-
|
|
120
|
+
implementation 'com.airbnb.android:lottie:6.0.1'
|
|
109
121
|
|
|
110
|
-
|
|
122
|
+
//FIN_ZY_ZYTRUST
|
|
111
123
|
|
|
112
124
|
}
|
|
@@ -5,12 +5,17 @@ import com.facebook.react.bridge.Promise
|
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
7
7
|
import com.facebook.react.bridge.ReactMethod
|
|
8
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
9
|
import com.facebook.react.bridge.WritableMap
|
|
9
10
|
import com.facebook.react.bridge.WritableNativeMap
|
|
11
|
+
import com.google.gson.Gson
|
|
10
12
|
import com.zy.banbif.android.lib.sdk.validacionfacial.api.IZyApiCapturaFacial
|
|
11
13
|
import com.zy.banbif.android.lib.sdk.validacionfacial.api.ZyApiCapturaFacial
|
|
12
14
|
import com.zy.banbif.android.lib.sdk.validacionfacial.api.ZyRequest
|
|
13
15
|
import com.zy.banbif.android.lib.sdk.validacionfacial.api.ZyResponse
|
|
16
|
+
import com.zy.banbif.android.lib.sdk.validacionfacial.api.bean.visual.ScreenEnum
|
|
17
|
+
import com.zy.banbif.android.lib.sdk.validacionfacial.api.bean.visual.Stepper
|
|
18
|
+
import com.zy.banbif.android.lib.sdk.validacionfacial.api.bean.visual.VisualScreenError
|
|
14
19
|
|
|
15
20
|
|
|
16
21
|
class ZyBioBanbifReactNativeModuleModule(reactContext: ReactApplicationContext) :
|
|
@@ -24,19 +29,48 @@ class ZyBioBanbifReactNativeModuleModule(reactContext: ReactApplicationContext)
|
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
@ReactMethod
|
|
27
|
-
fun validacionFacialOcr(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
urlSource: String, promise: Promise) {
|
|
32
|
+
fun validacionFacialOcr(opcional: ReadableMap,
|
|
33
|
+
promise: Promise) {
|
|
34
|
+
val gson = Gson()
|
|
35
|
+
val opcionalJson = gson.toJson(opcional.toHashMap())
|
|
36
|
+
val opcionalData = gson.fromJson(opcionalJson, com.zybanbifbiomodule.bean.Opcional::class.java)
|
|
33
37
|
val zyRequestApi: ZyRequest = ZyRequest()
|
|
34
|
-
|
|
35
|
-
zyRequestApi.
|
|
36
|
-
zyRequestApi.
|
|
37
|
-
zyRequestApi.
|
|
38
|
-
zyRequestApi.
|
|
39
|
-
zyRequestApi.
|
|
38
|
+
|
|
39
|
+
zyRequestApi.bioTiDoc = opcionalData.tiDocumento
|
|
40
|
+
zyRequestApi.bioNuDoc = opcionalData.nuDocumento
|
|
41
|
+
zyRequestApi.token = opcionalData.accessToken
|
|
42
|
+
zyRequestApi.bioPais = opcionalData.bioPais
|
|
43
|
+
zyRequestApi.bioOperacion = opcionalData.tiOperacion
|
|
44
|
+
zyRequestApi.url = opcionalData.urlSource
|
|
45
|
+
zyRequestApi.stepper = Stepper(opcionalData.stepper.nuPasos,opcionalData.stepper.pasoActual)
|
|
46
|
+
|
|
47
|
+
val vsList: MutableList<VisualScreenError> = ArrayList()
|
|
48
|
+
vsList.add(
|
|
49
|
+
VisualScreenError(
|
|
50
|
+
opcionalData.errores.reintentar.titulo,
|
|
51
|
+
opcionalData.errores.reintentar.descripcion,
|
|
52
|
+
opcionalData.errores.reintentar.textoBoton,
|
|
53
|
+
ScreenEnum.REINTENTAR
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
vsList.add(
|
|
57
|
+
VisualScreenError(
|
|
58
|
+
opcionalData.errores.limite_tiempo_alcanzado.titulo,
|
|
59
|
+
opcionalData.errores.limite_tiempo_alcanzado.descripcion,
|
|
60
|
+
opcionalData.errores.limite_tiempo_alcanzado.textoBoton,
|
|
61
|
+
ScreenEnum.LIMITE_TIEMPO_ALZANZADO
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
vsList.add(
|
|
65
|
+
VisualScreenError(
|
|
66
|
+
opcionalData.errores.limite_intentos_alcanzado.titulo,
|
|
67
|
+
opcionalData.errores.limite_intentos_alcanzado.descripcion,
|
|
68
|
+
opcionalData.errores.limite_intentos_alcanzado.textoBoton,
|
|
69
|
+
ScreenEnum.LIMITE_INTENTOS_ALCANZADO
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
zyRequestApi.errores = vsList
|
|
40
74
|
|
|
41
75
|
Log.i(TAG, "calling validacionFacialOcr")
|
|
42
76
|
Log.i(TAG, "nuDocumento:" + zyRequestApi.bioTiDoc)
|
|
@@ -110,6 +144,9 @@ class ZyBioBanbifReactNativeModuleModule(reactContext: ReactApplicationContext)
|
|
|
110
144
|
zyRequest.bioOperacion = zyRequestApi?.bioOperacion ?: "FULL"
|
|
111
145
|
zyRequest.isDialogActivated = true
|
|
112
146
|
zyRequest.url = zyRequestApi?.url ?: "POC"
|
|
147
|
+
zyRequest.stepper = zyRequestApi?.stepper
|
|
148
|
+
zyRequest.errores = zyRequestApi?.errores
|
|
149
|
+
|
|
113
150
|
iZyApiCapturaFacial.zyCapturaFacial(zyRequest)
|
|
114
151
|
|
|
115
152
|
}
|
|
@@ -117,4 +154,4 @@ class ZyBioBanbifReactNativeModuleModule(reactContext: ReactApplicationContext)
|
|
|
117
154
|
companion object {
|
|
118
155
|
private const val TAG = "ZyTFacialModule"
|
|
119
156
|
}
|
|
120
|
-
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.zybanbifbiomodule.bean
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.bridge.WritableMap
|
|
5
|
+
|
|
6
|
+
class ErroresPantallaRN {
|
|
7
|
+
lateinit var reintentar: ScreenText
|
|
8
|
+
lateinit var limite_tiempo_alcanzado: ScreenText
|
|
9
|
+
lateinit var limite_intentos_alcanzado : ScreenText
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
reintentar: ScreenText,
|
|
13
|
+
limite_tiempo_alcanzado: ScreenText,
|
|
14
|
+
limite_intentos_alcanzado: ScreenText
|
|
15
|
+
) {
|
|
16
|
+
this.reintentar = reintentar
|
|
17
|
+
this.limite_tiempo_alcanzado = limite_tiempo_alcanzado
|
|
18
|
+
this.limite_intentos_alcanzado = limite_intentos_alcanzado
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Método para convertir a WritableMap
|
|
22
|
+
fun toWritableMap(): WritableMap {
|
|
23
|
+
val map = Arguments.createMap()
|
|
24
|
+
map.putMap("reintentar", reintentar.toWritableMap())
|
|
25
|
+
map.putMap("limite_tiempo_alcanzado", limite_tiempo_alcanzado.toWritableMap())
|
|
26
|
+
map.putMap("limite_intentos_alcanzado", limite_intentos_alcanzado.toWritableMap())
|
|
27
|
+
return map
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package com.zybanbifbiomodule.bean
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Keep
|
|
4
|
+
|
|
5
|
+
@Keep
|
|
6
|
+
internal class Opcional {
|
|
7
|
+
var tiDocumento: String = ""
|
|
8
|
+
var nuDocumento: String = ""
|
|
9
|
+
var accessToken: String = ""
|
|
10
|
+
var bioPais: String = ""
|
|
11
|
+
var tiOperacion: String = ""
|
|
12
|
+
var urlSource: String = ""
|
|
13
|
+
lateinit var stepper: StepperRN
|
|
14
|
+
lateinit var errores: ErroresPantallaRN
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package com.zybanbifbiomodule.bean
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.bridge.WritableMap
|
|
5
|
+
|
|
6
|
+
class ScreenText {
|
|
7
|
+
var titulo: String = ""
|
|
8
|
+
var descripcion: String = ""
|
|
9
|
+
var textoBoton: String = ""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
constructor(textoBoton: String, descripcion: String, titulo: String) {
|
|
13
|
+
this.textoBoton = textoBoton
|
|
14
|
+
this.descripcion = descripcion
|
|
15
|
+
this.titulo = titulo
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Método para convertir a WritableMap
|
|
19
|
+
fun toWritableMap(): WritableMap {
|
|
20
|
+
val map = Arguments.createMap()
|
|
21
|
+
map.putString("titulo", titulo)
|
|
22
|
+
map.putString("descripcion", descripcion)
|
|
23
|
+
map.putString("textoBoton", textoBoton)
|
|
24
|
+
return map
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.zybanbifbiomodule.bean
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.Keep
|
|
4
|
+
import com.facebook.react.bridge.Arguments
|
|
5
|
+
import com.facebook.react.bridge.WritableMap
|
|
6
|
+
|
|
7
|
+
@Keep
|
|
8
|
+
class StepperRN {
|
|
9
|
+
var nuPasos: Int = 4
|
|
10
|
+
var pasoActual: Int = 2
|
|
11
|
+
|
|
12
|
+
constructor(var1: Int, var2: Int) {
|
|
13
|
+
this.nuPasos = var1
|
|
14
|
+
this.pasoActual = var2
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Método para convertir a WritableMap
|
|
18
|
+
fun toWritableMap(): WritableMap {
|
|
19
|
+
val map = Arguments.createMap()
|
|
20
|
+
map.putInt("nuPasos", nuPasos)
|
|
21
|
+
map.putInt("pasoActual", pasoActual)
|
|
22
|
+
return map
|
|
23
|
+
}
|
|
24
|
+
}
|
package/ios/ZyBanbifBioRn.m
CHANGED
|
@@ -4,28 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
#import "ZyBanbifBioRn.h" // Here put the name of your module
|
|
6
6
|
|
|
7
|
-
//@interface RCT_EXTERN_MODULE(ZyBanbifBioRn, NSObject)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/*RCT_EXTERN_METHOD(validacionFacialOcr:
|
|
11
|
-
(NSString *) bioTiDoc
|
|
12
|
-
bioNuDoc: (NSString *)bioNuDoc
|
|
13
|
-
bioPais: (NSString *)bioPais
|
|
14
|
-
bmoNuOperacionEmps: (NSString *)bmoNuOperacionEmps
|
|
15
|
-
isDialogActivated: (BOOL *)isDialogActivated
|
|
16
|
-
token: (NSString *)token)*/
|
|
17
7
|
@implementation ZyBanbifBioRn
|
|
18
8
|
|
|
19
|
-
RCT_EXPORT_MODULE()
|
|
9
|
+
RCT_EXPORT_MODULE();
|
|
20
10
|
|
|
21
|
-
RCT_EXPORT_METHOD(validacionFacialOcr:
|
|
22
|
-
(NSString *) tiDocumento
|
|
23
|
-
nuDocumento: (NSString *)bioNuDoc
|
|
24
|
-
accessToken: (NSString *)token
|
|
25
|
-
bioPais: (NSString *)bioPais
|
|
26
|
-
tiOperacion: (NSString *)tiOperacion
|
|
27
|
-
urlSource: (NSString *)urlSource
|
|
28
11
|
|
|
12
|
+
RCT_EXPORT_METHOD(validacionFacialOcr:(NSDictionary *)opcional
|
|
29
13
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
30
14
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
31
15
|
{
|
|
@@ -35,12 +19,44 @@ RCT_EXPORT_METHOD(validacionFacialOcr:
|
|
|
35
19
|
UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
|
|
36
20
|
|
|
37
21
|
ReactRequest *request = [ReactRequest new];
|
|
38
|
-
request.token =
|
|
39
|
-
request.bioTiDoc = tiDocumento;
|
|
40
|
-
request.bioNuDoc =
|
|
41
|
-
request.bioPais = bioPais;
|
|
42
|
-
request.bioOperacion = tiOperacion;
|
|
43
|
-
request.url = urlSource;
|
|
22
|
+
request.token = opcional[@"accessToken"] ;
|
|
23
|
+
request.bioTiDoc = opcional[@"tiDocumento"];
|
|
24
|
+
request.bioNuDoc = opcional[@"nuDocumento"];
|
|
25
|
+
request.bioPais = opcional[@"bioPais"];
|
|
26
|
+
request.bioOperacion = opcional[@"tiOperacion"];
|
|
27
|
+
request.url = opcional[@"urlSource"];
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
NSDictionary *stepperDict = opcional[@"stepper"];
|
|
31
|
+
if (stepperDict && [stepperDict isKindOfClass:[NSDictionary class]]) {
|
|
32
|
+
Stepper *st = [Stepper new];
|
|
33
|
+
st.nuPasos = [stepperDict[@"nuPasos"] intValue];
|
|
34
|
+
st.pasoActual = [stepperDict[@"pasoActual"] intValue];
|
|
35
|
+
request.stepper = st;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
NSDictionary *erroresDict = opcional[@"errores"];
|
|
39
|
+
NSDictionary *reintentarDict = erroresDict[@"reintentar"];
|
|
40
|
+
NSDictionary *limite_tiempo_alcanzadoDict = erroresDict[@"limite_tiempo_alcanzado"];
|
|
41
|
+
NSDictionary *limite_intentos_alcanzadoDict = erroresDict[@"limite_intentos_alcanzado"];
|
|
42
|
+
|
|
43
|
+
VisualScreenError *error1 = [[VisualScreenError alloc] initWithTitulo:reintentarDict[@"titulo"]
|
|
44
|
+
descripcion:reintentarDict[@"descripcion"]
|
|
45
|
+
textBoton:reintentarDict[@"textoBoton"]
|
|
46
|
+
screenEnum:ScreenEnumREINTENTAR];
|
|
47
|
+
|
|
48
|
+
VisualScreenError *error2 = [[VisualScreenError alloc] initWithTitulo:limite_tiempo_alcanzadoDict[@"titulo"]
|
|
49
|
+
descripcion:limite_tiempo_alcanzadoDict[@"descripcion"]
|
|
50
|
+
textBoton:limite_tiempo_alcanzadoDict[@"textoBoton"]
|
|
51
|
+
screenEnum:ScreenEnumLIMITE_TIEMPO_ALZANZADO];
|
|
52
|
+
|
|
53
|
+
VisualScreenError *error3 = [[VisualScreenError alloc] initWithTitulo:limite_intentos_alcanzadoDict[@"titulo"]
|
|
54
|
+
descripcion:limite_intentos_alcanzadoDict[@"descripcion"]
|
|
55
|
+
textBoton:limite_intentos_alcanzadoDict[@"textoBoton"]
|
|
56
|
+
screenEnum:ScreenEnumLIMITE_INTENTOS_ALCANZADO];
|
|
57
|
+
|
|
58
|
+
NSArray<VisualScreenError *> *errores = @[error1, error2, error3];
|
|
59
|
+
request.errores = errores;
|
|
44
60
|
|
|
45
61
|
ZyReactComp *biomatch = [[ZyReactComp alloc] initOnView:ctrl];
|
|
46
62
|
|
|
@@ -67,6 +83,7 @@ RCT_EXPORT_METHOD(validacionFacialOcr:
|
|
|
67
83
|
});
|
|
68
84
|
}
|
|
69
85
|
|
|
86
|
+
|
|
70
87
|
@end
|
|
71
88
|
|
|
72
89
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { :git => "https://github.com/ZYTRUST/react-native-zybanbifbio-module.git", :tag => "#{s.version}" }
|
|
16
16
|
s.source_files = "ios/*.{h,m,mm}"
|
|
17
17
|
|
|
18
|
-
s.dependency 'zy_banbif_bio_lib_ios', '0.
|
|
18
|
+
s.dependency 'zy_banbif_bio_lib_ios', '1.0.5'
|
|
19
19
|
s.dependency 'React'
|
|
20
20
|
|
|
21
21
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|