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.
Files changed (29) hide show
  1. package/README.md +39 -10
  2. package/android/build.gradle +95 -83
  3. package/android/src/main/java/com/zybanbifbiomodule/ZyBioBanbifReactNativeModuleModule.kt +50 -13
  4. package/android/src/main/java/com/zybanbifbiomodule/bean/ErroresPantallaRN.kt +32 -0
  5. package/android/src/main/java/com/zybanbifbiomodule/bean/Opcional.kt +16 -0
  6. package/android/src/main/java/com/zybanbifbiomodule/bean/ScreenText.kt +27 -0
  7. package/android/src/main/java/com/zybanbifbiomodule/bean/StepperRN.kt +24 -0
  8. package/ios/ZyBanbifBioRn.m +41 -24
  9. package/package.json +1 -1
  10. package/react-native-zybanbifbio-module.podspec +1 -1
  11. package/android/gradle.properties +0 -5
  12. package/android/libs/device-environment-2.1.1.1.aar +0 -0
  13. package/android/libs/face-3.5.0.aar +0 -0
  14. package/android/libs/lkms-client-crypto-2.1.0-alpha2.jar +0 -0
  15. package/android/libs/lkms-core-4.1.0.aar +0 -0
  16. package/android/libs/lkms-shared-2.1.0-alpha2.jar +0 -0
  17. package/android/libs/metadata-crypto-1.0.2.jar +0 -0
  18. package/android/libs/plugin-algorithm-f6-0-idd80-4.32.1.aar +0 -0
  19. package/android/libs/plugin-core-4.32.1.aar +0 -0
  20. package/android/libs/plugin-face-4.32.1.aar +0 -0
  21. package/android/libs/plugin-face-normal-4.32.1.aar +0 -0
  22. package/android/libs/remote-logging-1.0.8.aar +0 -0
  23. package/android/libs/service_provider_local-1.2.5.aar +0 -0
  24. package/android/libs/smartFace-4.32.1.aar +0 -0
  25. package/android/libs/smartsdk-face-native-lkms-2.4.0-face.aar +0 -0
  26. package/android/libs/zy-banbif-validacionfacial-lib-android-debug-5.3.15.aar +0 -0
  27. package/android/libs/zyOFacial_v9-debug-1.8.10.aar +0 -0
  28. package/android/libs/zylibregulaocr-debug-1.2.3.aar +0 -0
  29. 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
- NativeModules.ZyBanbifBioRn.validacionFacialOcr(
21
- "1", // tipo Documento : DNI: 1
22
- "0000000", // Numero de documento
23
- "abcdef123456", // token
24
- "PE", // Pais
25
- "FULL", // tipo operacion "FULL" o "FACIAL"
26
- "POC" //URL - POC , DEVX , SIGN
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.
@@ -1,37 +1,49 @@
1
1
  buildscript {
2
- repositories {
3
- google()
4
- mavenCentral()
5
- }
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ }
6
6
 
7
- dependencies {
8
- classpath "com.android.tools.build:gradle:8.1.1"
9
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
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
- compileSdk 34
17
+ // Conditional for compatibility with AGP <4.2.
18
18
 
19
- defaultConfig {
20
- minSdkVersion 21
21
- targetSdk 34
22
- versionCode 1
23
- versionName "1.0"
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
- //INICIO_ZY_ZYTRUST
43
- implementation("com.facebook.react:react-android")
44
-
45
- implementation 'com.regula.documentreader.core:fullauth:7.4.11455'
46
- implementation('com.regula.documentreader:api:7.4.10090') {
47
- transitive = true;
48
- }
49
- implementation 'androidx.appcompat:appcompat:1.4.0'
50
- implementation 'com.google.android.material:material:1.5.0'
51
-
52
- /************************gson***********************************/
53
- implementation 'com.google.code.gson:gson:2.8.7'
54
-
55
- /** * Retrofit ***/
56
- implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
57
- implementation 'com.squareup.okhttp3:okhttp:4.7.2'
58
- implementation 'com.squareup.retrofit2:retrofit:2.9.0'
59
- implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
60
- /** * Retrofit ***/
61
-
62
- implementation 'androidx.annotation:annotation:1.0.0'
63
-
64
- implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
65
- //implementation 'com.airbnb.android:lottie:3.0.1'
66
-
67
- implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.6"
68
-
69
- implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
70
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
71
- implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
72
-
73
- implementation files('libs/smartFace-4.32.1.aar')
74
- implementation files('libs/service_provider_local-1.2.5.aar')
75
- implementation files('libs/plugin-core-4.32.1.aar')
76
- implementation files('libs/remote-logging-1.0.8.aar')
77
- implementation files('libs/smartsdk-face-native-lkms-2.4.0-face.aar')
78
- implementation files('libs/plugin-face-4.32.1.aar')
79
- implementation files('libs/lkms-core-4.1.0.aar')
80
- implementation files('libs/plugin-algorithm-f6-0-idd80-4.32.1.aar')
81
- implementation files('libs/plugin-face-normal-4.32.1.aar')
82
- implementation files('libs/zyOFacial_v9-debug-1.8.10.aar')
83
- implementation files('libs/device-environment-2.1.1.1.aar')
84
-
85
- implementation files('libs/lkms-shared-2.1.0-alpha2.jar')
86
- implementation files('libs/lkms-client-crypto-2.1.0-alpha2.jar')
87
- implementation files('libs/metadata-crypto-1.0.2.jar')
88
-
89
- implementation files('libs/zylibuiandroid-debug-0.1.12.aar')
90
-
91
- /************OCR************/
92
- implementation 'com.google.android.gms:play-services-vision:20.1.3'
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
- implementation files('libs/zylibregulaocr-debug-1.2.3.aar')
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
- implementation 'net.zetetic:android-database-sqlcipher:4.5.3'
98
- implementation 'org.apache.commons:commons-imaging:1.0-alpha2'
99
- implementation 'androidx.security:security-crypto:1.1.0-alpha01'
100
- implementation 'androidx.activity:activity:1.9.1'
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
- /*********************ENCRYPTACION SERVICIO**********************/
103
- implementation 'commons-codec:commons-codec:1.10'
104
- implementation 'com.auth0.android:jwtdecode:2.0.0'
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
- implementation 'com.airbnb.android:lottie:6.0.1'
120
+ implementation 'com.airbnb.android:lottie:6.0.1'
109
121
 
110
- //FIN_ZY_ZYTRUST
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(tiDocumento: String,
28
- nuDocumento: String,
29
- accessToken: String,
30
- bioPais: String,
31
- tiOperacion: String,
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
- zyRequestApi.bioTiDoc = tiDocumento
35
- zyRequestApi.bioNuDoc = nuDocumento
36
- zyRequestApi.token = accessToken
37
- zyRequestApi.bioPais = bioPais
38
- zyRequestApi.bioOperacion = tiOperacion
39
- zyRequestApi.url = urlSource
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
+ }
@@ -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 = token ;
39
- request.bioTiDoc = tiDocumento;
40
- request.bioNuDoc = 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-zybanbifbio-module",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "bio banbif",
5
5
  "scripts":
6
6
  {
@@ -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.2.5'
18
+ s.dependency 'zy_banbif_bio_lib_ios', '1.0.5'
19
19
  s.dependency 'React'
20
20
 
21
21
  end
@@ -1,5 +0,0 @@
1
- ZybanbifbioModule_kotlinVersion=1.7.0
2
- ZybanbifbioModule_minSdkVersion=21
3
- ZybanbifbioModule_targetSdkVersion=31
4
- ZybanbifbioModule_compileSdkVersion=31
5
- ZybanbifbioModule_ndkversion=21.4.7075529
Binary file
Binary file
Binary file
Binary file
Binary file