react-native-zyprotectabio-module 0.1.0 → 0.1.7

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 (56) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +7 -158
  3. package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
  4. package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  7. package/android/.gradle/config.properties +1 -1
  8. package/android/.idea/caches/deviceStreaming.xml +1 -1
  9. package/android/.idea/gradle.xml +0 -1
  10. package/android/.idea/misc.xml +1 -0
  11. package/android/.project +17 -0
  12. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  13. package/android/build.gradle +111 -32
  14. package/android/gradle.properties +4 -5
  15. package/android/local.properties +1 -1
  16. package/android/src/main/AndroidManifest.xml +1 -4
  17. package/android/src/main/java/com/{zyprotectabiomodule/ZyBioProtectaReactNativeModuleModule.kt → reactnativezybanbifbiomodule/ZybanbifbioModuleModule.kt} +30 -15
  18. package/android/src/main/java/com/reactnativezybanbifbiomodule/ZybanbifbioModulePackage.kt +17 -0
  19. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/ErroresPantallaRN.kt +1 -1
  20. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/Opcional.kt +1 -1
  21. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/ScreenText.kt +1 -1
  22. package/android/src/main/java/com/{zyprotectabiomodule → reactnativezybanbifbiomodule}/bean/StepperRN.kt +1 -1
  23. package/ios/ZybanbifbioModule-Bridging-Header.h +2 -0
  24. package/ios/ZybanbifbioModule.m +9 -0
  25. package/ios/ZybanbifbioModule.swift +8 -0
  26. package/ios/ZybanbifbioModule.xcodeproj/project.pbxproj +293 -0
  27. package/ios/ZybanbifbioModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  28. package/lib/commonjs/index.js +12 -0
  29. package/lib/commonjs/index.js.map +1 -0
  30. package/lib/module/index.js +6 -0
  31. package/lib/module/index.js.map +1 -0
  32. package/lib/typescript/index.d.ts +5 -0
  33. package/package.json +122 -29
  34. package/src/index.tsx +6 -19
  35. package/.gitattributes +0 -2
  36. package/CODE_OF_CONDUCT.md +0 -133
  37. package/CONTRIBUTING.md +0 -122
  38. package/android/.gradle/8.8/checksums/checksums.lock +0 -0
  39. package/android/.gradle/8.8/dependencies-accessors/gc.properties +0 -0
  40. package/android/.gradle/8.8/fileChanges/last-build.bin +0 -0
  41. package/android/.gradle/8.8/fileHashes/fileHashes.lock +0 -0
  42. package/android/.gradle/8.8/gc.properties +0 -0
  43. package/android/.idea/android.iml +0 -9
  44. package/android/.idea/modules.xml +0 -8
  45. package/android/src/main/AndroidManifestNew.xml +0 -2
  46. package/android/src/main/java/com/zyprotectabiomodule/ZyBioProtectaReactNativeModulePackage.kt +0 -26
  47. package/babel.config.js +0 -5
  48. package/ios/ZyBanbifBioRn.h +0 -12
  49. package/ios/ZyBanbifBioRn.m +0 -90
  50. package/lefthook.yml +0 -14
  51. package/react-native-zyprotectabio-module.podspec +0 -23
  52. package/scripts/postinstall.js +0 -50
  53. package/src/__tests__/index.test.tsx +0 -1
  54. package/tsconfig.build.json +0 -4
  55. package/tsconfig.json +0 -29
  56. package/turbo.json +0 -36
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Iván Cáceres
3
+ Copyright (c) 2020 jorgeSaenzUgaz
4
+
4
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
6
  of this software and associated documentation files (the "Software"), to deal
6
7
  in the Software without restriction, including without limitation the rights
package/README.md CHANGED
@@ -1,178 +1,27 @@
1
- # react-native-zyprotectabio-module
1
+ # react-native-zybanbifbio-module
2
2
 
3
- Libreria la cual es encargada de verificación biométrica de personas peruanas.
4
- Esta libreria esta diseñada especificamente para le empresa 11 poc.
5
-
6
- ## Anotaciones
7
-
8
- ### iOS: version para iOS fue compilada con XCODE 15.4, es decir que el preoyecto debe utilizar XCODE 15.3 o superior , ademas el tarjet minimo es ios 13.0
9
- ### Android: version minima de android es 24, version compilada con compileSDK 34, se recomienda usar compileSDK 34 o superior
10
- ### MOVIL: Libreria solo será valida apartir de la version 0.10.9 .
11
-
12
-
13
- ## NOTAS:
14
- ```
15
-
16
- ```
17
- ```
18
-
19
- ```
3
+ react-native-zybanbifbio-module
20
4
 
21
5
  ## Installation
22
6
 
23
7
  ```sh
24
- npm install react-native-zyprotectabio-module
8
+ npm install react-native-zybanbifbio-module
25
9
  ```
26
10
 
27
11
  ## Usage
28
12
 
29
- ### MÉTODO
30
13
  ```js
31
- import { NativeModules } from 'react-native';
14
+ import ZybanbifbioModule from "react-native-zybanbifbio-module";
32
15
 
33
16
  // ...
34
17
 
35
- const opciones = {
36
- tiDocumento: "1", // tipo Documento : DNI: 1 nuDocumento: documentNumber, // Numero de documento
37
- nuDocumento: "00112233", // Número de documento
38
- accessToken: "abcdfghi12345", // Access token generado por ambiente
39
- bioPais: "PE", //Pais de verificacion (siempre PE)
40
- tiOperacion: "FULL", //Operacion puede ser FULL o FACIAL
41
- urlSource: "DEV2", // Ambiente a la conexion DEV2 , POC , DEVX , SIGN (PRODUCCION)
42
- };
43
- NativeModules.ZyProtectaBioRn.validacionFacialOcr(opciones)
44
- .then(result => {
45
- })
46
-
47
- //..
48
-
49
- //para mas información revisar el documento de especificación.
50
- ```
51
- ## ANDROID FIRMA
52
- - Para su funcionamiento es necesario correr el app con la firma(SHA-1) compartida a ZyTrust, tanto en debug/release porque la licensia esta vinculada al applicationId y SHA-1 de la firma
53
-
54
- - EJEMPLO:
55
- A nivel del build.gradle(App)
18
+ const result = await ZybanbifbioModule.multiply(3, 7);
56
19
  ```
57
- android {
58
- ...
59
-
60
- signingConfigs {
61
- debug {
62
- keyAlias 'miFirma'
63
- keyPassword 'miFirma'
64
- storeFile file('../miFirma.jks')
65
- storePassword 'miFirma'
66
- }
67
- release {
68
- keyAlias 'miFirma'
69
- keyPassword 'miFirma'
70
- storeFile file('../miFirma.jks')
71
- storePassword 'miFirma'
72
- }
73
- }
74
- defaultConfig {
75
- ...
76
- }
77
- ...
78
- }
79
-
80
- ```
81
- ## ANDROID REGLAS OFUSCAMIENTO
82
- ```
83
-
84
- ####################### INICIO Zy Lib #################################
85
- -dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider
86
- -dontwarn com.google.gson.**
87
- -dontwarn com.facebook.jni.**
88
- -dontwarn com.facebook.react.**
89
-
90
- # Mantener Zytrust
91
- -keep class com.zy.protecta.android.lib.sdk.validacionfacial.** { *; }
92
- -keep interface com.zy.protecta.android.lib.sdk.validacionfacial.** { *; }
93
-
94
- # Mantener auth0
95
- -keep class com.auth0.** { *; }
96
-
97
- # Mantener FACE IDENTY
98
- -keep class com.identy.face.** { *; }
99
- -keep enum * {*;}
100
-
101
- # Mantener Regula OCR
102
- -keep class com.regula.documentreader.** { *; }
103
- -keep class com.regula.common.** { *; }
104
- -keep class androidx.appcompat.widget.FitWindowsLinearLayout { *; }
105
-
106
-
107
- # Mantener todo React Native
108
- -keep class com.facebook.react.** { *; }
109
- -keep class com.zyprotectabiomodule.** { *; }
110
- -keep class com.testprotecta_new.** { *; } # es del app test no es necesario incluirlo
111
-
112
- # Mantener todos los managers y eventos nativos
113
- -keep class com.facebook.react.uimanager.** { *; }
114
- -keep class com.facebook.react.bridge.** { *; }
115
20
 
116
- # Mantener componentes que usan reflexión (ViewManagers, NativeModules)
117
- -keepclassmembers class * {
118
- @com.facebook.react.uimanager.annotations.ReactProp <methods>;
119
- }
120
-
121
- # Mantener clases usadas por JavaScriptCore
122
- -keep class com.facebook.jni.** { *; }
123
-
124
- # Mantener atributos de anotaciones (ReactProp, ReactModule, etc.)
125
- -keepattributes *Annotation*
126
-
127
-
128
- # Mantener Retrofit interfaces y métodos
129
- -keep interface retrofit2.** { *; }
130
- -keep class retrofit2.** { *; }
131
- -dontwarn retrofit2.**
132
-
133
- # Mantener métodos anotados de Retrofit
134
- -keepclassmembers class * {
135
- @retrofit2.http.* <methods>;
136
- }
137
-
138
- # Mantener OkHttp
139
- -keep class okhttp3.** { *; }
140
- -dontwarn okhttp3.**
141
-
142
- # Mantener Okio (usado por OkHttp)
143
- -keep class okio.** { *; }
144
- -dontwarn okio.**
145
-
146
- # Mantener adaptadores de conversión (si usas Gson, Moshi, etc.)
147
- -keep class com.google.gson.** { *; }
148
-
149
-
150
- ####################### FIN Zy Lib #################################
151
-
152
- ```
153
21
  ## Contributing
154
22
 
155
- - Elaborado por Zytrust S.A.
156
-
157
- - Compañia ZyTrust S.A. Perú
158
-
23
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
159
24
 
160
25
  ## License
161
26
 
162
- ZyTrust S.A. Perú
163
-
164
-
165
- ## Contact
166
-
167
- - Webpage: https://www.zytrust.com/
168
-
169
- - Oficina: Av. República de Panamá 3609, San Isidro. Lima, Perú.
170
-
171
- - Teléfono: +51 1 321 4444 || (+51) 974 260 111
172
-
173
- - Email: info@zytrust.com || support@zytrust.com || ztmobile@zytrust.com
174
-
175
-
176
- ---
177
-
178
- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
27
+ MIT
@@ -1,2 +1,2 @@
1
- #Thu Dec 18 19:32:36 PET 2025
1
+ #Wed Dec 24 08:51:52 PET 2025
2
2
  gradle.version=9.0-milestone-1
@@ -1,2 +1,2 @@
1
- #Thu Dec 04 11:39:59 PET 2025
1
+ #Wed Dec 24 08:51:50 PET 2025
2
2
  java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
@@ -347,7 +347,7 @@
347
347
  <option name="id" value="b6q" />
348
348
  <option name="labId" value="google" />
349
349
  <option name="manufacturer" value="Samsung" />
350
- <option name="name" value="Flip 6" />
350
+ <option name="name" value="Galaxy Z Flip 6" />
351
351
  <option name="screenDensity" value="340" />
352
352
  <option name="screenX" value="1080" />
353
353
  <option name="screenY" value="2640" />
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
- <component name="GradleMigrationSettings" migrationVersion="1" />
4
3
  <component name="GradleSettings">
5
4
  <option name="linkedExternalProjectsSettings">
6
5
  <GradleProjectSettings>
@@ -1,3 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
1
2
  <project version="4">
2
3
  <component name="ExternalStorageConfigurationManager" enabled="true" />
3
4
  <component name="ProjectRootManager">
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>android_</name>
4
+ <comment>Project android_ created by Buildship.</comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ <buildCommand>
9
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10
+ <arguments>
11
+ </arguments>
12
+ </buildCommand>
13
+ </buildSpec>
14
+ <natures>
15
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16
+ </natures>
17
+ </projectDescription>
@@ -0,0 +1,13 @@
1
+ arguments=
2
+ auto.sync=false
3
+ build.scans.enabled=false
4
+ connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0))
5
+ connection.project.dir=
6
+ eclipse.preferences.version=1
7
+ gradle.user.home=
8
+ java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
9
+ jvm.arguments=
10
+ offline.mode=false
11
+ override.workspace.settings=true
12
+ show.console.view=true
13
+ show.executions.view=true
@@ -1,34 +1,53 @@
1
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['ZybanbifbioModule_kotlinVersion']
4
+
2
5
  repositories {
3
6
  google()
7
+ jcenter()
4
8
  mavenCentral()
5
9
  }
6
10
 
7
11
  dependencies {
8
- classpath "com.android.tools.build:gradle:8.1.1"
9
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
12
+ classpath 'com.android.tools.build:gradle:8.1.1'
13
+ // noinspection DifferentKotlinGradleVersion
14
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10
15
  }
11
16
  }
12
17
 
13
18
  apply plugin: 'com.android.library'
14
19
  apply plugin: 'kotlin-android'
15
20
 
16
- android {
17
- // Conditional for compatibility with AGP <4.2.
21
+ def getExtOrDefault(name) {
22
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ZybanbifbioModule_' + name]
23
+ }
18
24
 
19
- compileSdk 34
25
+ def getExtOrIntegerDefault(name) {
26
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ZybanbifbioModule_' + name]).toInteger()
27
+ }
20
28
 
29
+ android {
30
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
31
+ buildToolsVersion getExtOrDefault('buildToolsVersion')
21
32
  defaultConfig {
22
33
  minSdkVersion 24
23
- targetSdk 34
34
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
24
35
  versionCode 1
25
36
  versionName "1.0"
37
+
26
38
  }
27
-
28
- lint {
29
- //disable 'MissingTranslation', 'TypographyFractions'
30
- abortOnError false
31
- checkReleaseBuilds false
39
+
40
+ buildTypes {
41
+ release {
42
+ minifyEnabled false
43
+ }
44
+ }
45
+ lintOptions {
46
+ disable 'GradleCompatible'
47
+ }
48
+ compileOptions {
49
+ sourceCompatibility JavaVersion.VERSION_1_8
50
+ targetCompatibility JavaVersion.VERSION_1_8
32
51
  }
33
52
  packagingOptions {
34
53
  exclude 'META-INF/DEPENDENCIES'
@@ -36,38 +55,91 @@ android {
36
55
  exclude 'META-INF/LICENSE'
37
56
 
38
57
  }
39
-
40
58
  }
41
59
 
42
- rootProject.allprojects {
43
- repositories {
44
- google()
45
- mavenCentral()
46
- maven {
47
- url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
48
- }
60
+ repositories {
61
+ mavenCentral()
62
+ jcenter()
63
+ google()
64
+
65
+ def found = false
66
+ def defaultDir = null
67
+ def androidSourcesName = 'React Native sources'
68
+
69
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
70
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
71
+ } else {
72
+ defaultDir = new File(
73
+ projectDir,
74
+ '/../../../node_modules/react-native/android'
75
+ )
76
+ }
77
+
78
+ if (defaultDir.exists()) {
79
+ maven {
80
+ url defaultDir.toString()
81
+ name androidSourcesName
82
+ }
83
+
84
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
85
+ found = true
86
+ } else {
87
+ def parentDir = rootProject.projectDir
88
+
89
+ 1.upto(5, {
90
+ if (found) return true
91
+ parentDir = parentDir.parentFile
92
+
93
+ def androidSourcesDir = new File(
94
+ parentDir,
95
+ 'node_modules/react-native'
96
+ )
97
+
98
+ def androidPrebuiltBinaryDir = new File(
99
+ parentDir,
100
+ 'node_modules/react-native/android'
101
+ )
102
+
103
+ if (androidPrebuiltBinaryDir.exists()) {
49
104
  maven {
50
- url = uri("https://repo.zytrust.com/artifactory/zy-mobile-maven")
105
+ url androidPrebuiltBinaryDir.toString()
106
+ name androidSourcesName
51
107
  }
108
+
109
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
110
+ found = true
111
+ } else if (androidSourcesDir.exists()) {
52
112
  maven {
53
- url = "https://identy.jfrog.io/identy/identy-face-release"
54
- credentials {
55
- username = 'zytrust'
56
- password = 'yK54WHqgel8PztBHwXZn7'
57
- }
113
+ url androidSourcesDir.toString()
114
+ name androidSourcesName
58
115
  }
59
- }
116
+
117
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
118
+ found = true
119
+ }
120
+ })
121
+ }
122
+
123
+ if (!found) {
124
+ throw new GradleException(
125
+ "${project.name}: unable to locate React Native android sources. " +
126
+ "Ensure you have you installed React Native as a dependency in your project and try again."
127
+ )
128
+ }
60
129
  }
61
130
 
131
+
132
+ def kotlin_version = getExtOrDefault('kotlinVersion')
133
+
62
134
  dependencies {
63
- //INICIO_ZY_ZYTRUST
64
- implementation("com.facebook.react:react-android")
135
+ // noinspection GradleDynamicVersion
136
+ api 'com.facebook.react:react-native:+'
137
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
65
138
 
139
+ //INICIO_ZY_ZYTRUST
66
140
  implementation 'androidx.appcompat:appcompat:1.4.0'
67
141
  implementation 'com.google.android.material:material:1.5.0'
68
-
69
- /************************gson***********************************/
70
- implementation(group: 'com.zy.multiempresa.android.lib.protecta', name: 'sdk', version: '1.0.18', ext: 'aar'){
142
+ implementation(group: 'com.zy.multiempresa.android.lib.protecta', name: 'sdk', version: '1.0.18', ext: 'aar'){
71
143
  transitive = true
72
144
  }
73
145
 
@@ -76,7 +148,14 @@ dependencies {
76
148
  }
77
149
  debugImplementation(group: 'com.identy.face', name: 'face', version: '6.3.0-develop', ext: 'aar')
78
150
  releaseImplementation(group: 'com.identy.face', name: 'face', version: '6.3.0', ext: 'aar')
79
-
80
151
  //FIN_ZY_ZYTRUST
152
+ }
81
153
 
154
+ // Agrégalo al final del archivo, fuera de cualquier otro bloque
155
+ configurations.all {
156
+ resolutionStrategy {
157
+ force 'org.bouncycastle:bcprov-jdk15to18:1.70'
158
+ force 'org.bouncycastle:bcutil-jdk15to18:1.70'
159
+ }
160
+ exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
82
161
  }
@@ -1,5 +1,4 @@
1
- ZyprotectabioModule_kotlinVersion=1.7.0
2
- ZyprotectabioModule_minSdkVersion=21
3
- ZyprotectabioModule_targetSdkVersion=31
4
- ZyprotectabioModule_compileSdkVersion=31
5
- ZyprotectabioModule_ndkversion=21.4.7075529
1
+ ZybanbifbioModule_kotlinVersion=1.3.50
2
+ ZybanbifbioModule_compileSdkVersion=29
3
+ ZybanbifbioModule_buildToolsVersion=29.0.2
4
+ ZybanbifbioModule_targetSdkVersion=29
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Thu Dec 04 11:39:59 PET 2025
7
+ #Wed Dec 24 08:51:50 PET 2025
8
8
  sdk.dir=/Users/jsaenz/Library/Android/sdk
@@ -1,7 +1,4 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- xmlns:tools="http://schemas.android.com/tools"
3
- package="com.zyprotectabiomodule">
4
-
5
-
2
+ package="com.reactnativezybanbifbiomodule">
6
3
 
7
4
  </manifest>
@@ -1,10 +1,12 @@
1
- package com.zyprotectabiomodule
1
+ package com.reactnativezybanbifbiomodule
2
2
 
3
- import android.util.Log
4
- import com.facebook.react.bridge.Promise
5
3
  import com.facebook.react.bridge.ReactApplicationContext
6
4
  import com.facebook.react.bridge.ReactContextBaseJavaModule
7
5
  import com.facebook.react.bridge.ReactMethod
6
+ import com.facebook.react.bridge.Promise
7
+
8
+
9
+ import android.util.Log
8
10
  import com.facebook.react.bridge.ReadableMap
9
11
  import com.facebook.react.bridge.WritableMap
10
12
  import com.facebook.react.bridge.WritableNativeMap
@@ -18,22 +20,34 @@ import com.zy.multicompany.android.lib.sdk.validacionfacial.api.bean.visual.Step
18
20
  import com.zy.multicompany.android.lib.sdk.validacionfacial.api.bean.visual.VisualScreenError
19
21
 
20
22
 
21
- class ZyBioProtectaReactNativeModuleModule(reactContext: ReactApplicationContext) :
22
- ReactContextBaseJavaModule(reactContext) {
23
- /**
24
- * @return the name of this module. This will be the name used to `require()` this module
25
- * from javascript.
26
- */
27
- override fun getName(): String {
28
- return "ZyProtectaBioRn"
29
- }
23
+ class ZybanbifbioModuleModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
30
24
 
31
- @ReactMethod
32
- fun validacionFacialOcr(opcional: ReadableMap,
25
+ override fun getName(): String {
26
+ return "ZybanbifbioModule"
27
+ }
28
+
29
+ // Example method
30
+ // See https://reactnative.dev/docs/native-modules-android
31
+ /*@ReactMethod
32
+ fun multiply(a: Int, b: Int, promise: Promise) {
33
+
34
+ promise.resolve(a * b)
35
+
36
+ }*/
37
+
38
+ /*@ReactMethod
39
+ fun validacionFacialOcr(a: Int, b: Int, promise: Promise) {
40
+
41
+ promise.resolve(a * b)
42
+
43
+ }*/
44
+
45
+ @ReactMethod
46
+ fun validacionFacialOcr(opcional: ReadableMap,
33
47
  promise: Promise) {
34
48
  val gson = Gson()
35
49
  val opcionalJson = gson.toJson(opcional.toHashMap())
36
- val opcionalData = gson.fromJson(opcionalJson, com.zyprotectabiomodule.bean.Opcional::class.java)
50
+ val opcionalData = gson.fromJson(opcionalJson, com.reactnativezybanbifbiomodule.bean.Opcional::class.java)
37
51
  val zyRequestApi: ZyRequest = ZyRequest()
38
52
 
39
53
  zyRequestApi.bioTiDoc = opcionalData.tiDocumento
@@ -160,4 +174,5 @@ class ZyBioProtectaReactNativeModuleModule(reactContext: ReactApplicationContext
160
174
  companion object {
161
175
  private const val TAG = "ZyTFacialModule"
162
176
  }
177
+
163
178
  }
@@ -0,0 +1,17 @@
1
+ package com.reactnativezybanbifbiomodule
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 ZybanbifbioModulePackage : ReactPackage {
10
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11
+ return listOf(ZybanbifbioModuleModule(reactContext))
12
+ }
13
+
14
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15
+ return emptyList()
16
+ }
17
+ }
@@ -1,4 +1,4 @@
1
- package com.zyprotectabiomodule.bean
1
+ package com.reactnativezybanbifbiomodule.bean
2
2
 
3
3
  import com.facebook.react.bridge.Arguments
4
4
  import com.facebook.react.bridge.WritableMap
@@ -1,4 +1,4 @@
1
- package com.zyprotectabiomodule.bean
1
+ package com.reactnativezybanbifbiomodule.bean
2
2
 
3
3
  import androidx.annotation.Keep
4
4
 
@@ -1,4 +1,4 @@
1
- package com.zyprotectabiomodule.bean
1
+ package com.reactnativezybanbifbiomodule.bean
2
2
 
3
3
  import com.facebook.react.bridge.Arguments
4
4
  import com.facebook.react.bridge.WritableMap
@@ -1,4 +1,4 @@
1
- package com.zyprotectabiomodule.bean
1
+ package com.reactnativezybanbifbiomodule.bean
2
2
 
3
3
  import androidx.annotation.Keep
4
4
  import com.facebook.react.bridge.Arguments
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,9 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(ZybanbifbioModule, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
6
+ withResolver:(RCTPromiseResolveBlock)resolve
7
+ withRejecter:(RCTPromiseRejectBlock)reject)
8
+
9
+ @end
@@ -0,0 +1,8 @@
1
+ @objc(ZybanbifbioModule)
2
+ class ZybanbifbioModule: 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
+ }