assentify-sdk-react-native 0.0.1

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 (195) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +65 -0
  3. package/android/build.gradle +111 -0
  4. package/android/gradle.properties +9 -0
  5. package/android/src/main/AndroidManifest.xml +55 -0
  6. package/android/src/main/java/com/assentifysdk/AndroidProgressBarModule.kt +33 -0
  7. package/android/src/main/java/com/assentifysdk/AssentifySdkBaseModule.kt +39 -0
  8. package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +432 -0
  9. package/android/src/main/java/com/assentifysdk/AssentifySdkPackage.kt +19 -0
  10. package/android/src/main/java/com/assentifysdk/FaceMatchActivity.kt +309 -0
  11. package/android/src/main/java/com/assentifysdk/ImageToBase64Converter.kt +40 -0
  12. package/android/src/main/java/com/assentifysdk/ReactApplicationContextObject.kt +14 -0
  13. package/android/src/main/java/com/assentifysdk/ScanIDActivity.kt +431 -0
  14. package/android/src/main/java/com/assentifysdk/ScanOtherActivity.kt +328 -0
  15. package/android/src/main/java/com/assentifysdk/ScanPassportActivity.kt +364 -0
  16. package/android/src/main/java/com/assentifysdk/StepsKeys.kt +91 -0
  17. package/android/src/main/res/drawable/back_icon.png +0 -0
  18. package/android/src/main/res/drawable/button_rounded_background.xml +6 -0
  19. package/android/src/main/res/drawable/card.gif +0 -0
  20. package/android/src/main/res/drawable/expire.png +0 -0
  21. package/android/src/main/res/drawable/id.gif +0 -0
  22. package/android/src/main/res/drawable/id_warning.png +0 -0
  23. package/android/src/main/res/drawable/info_icon.png +0 -0
  24. package/android/src/main/res/drawable/info_rounded_background.xml +6 -0
  25. package/android/src/main/res/drawable/passport.gif +0 -0
  26. package/android/src/main/res/drawable/rounded_background.xml +3 -0
  27. package/android/src/main/res/drawable/sending.png +0 -0
  28. package/android/src/main/res/drawable/warning.png +0 -0
  29. package/android/src/main/res/drawable/zoom_in.png +0 -0
  30. package/android/src/main/res/drawable/zoom_out.png +0 -0
  31. package/android/src/main/res/layout/activity_face_scan.xml +242 -0
  32. package/android/src/main/res/layout/activity_scan.xml +297 -0
  33. package/android/src/main/res/raw/sending_video.MP4 +0 -0
  34. package/android/src/main/res/values/colors.xml +8 -0
  35. package/android/src/main/res/values/strings.xml +3 -0
  36. package/android/src/main/res/values/styles.xml +4 -0
  37. package/assentify-sdk.podspec +43 -0
  38. package/ios/AssentifySdkBaseModule.swift +15 -0
  39. package/ios/Info.plist +27 -0
  40. package/ios/NativeAssentifySdk-Bridging-Header.h +3 -0
  41. package/ios/NativeAssentifySdk.mm +45 -0
  42. package/ios/NativeAssentifySdk.swift +460 -0
  43. package/ios/Resources/card.gif +0 -0
  44. package/ios/Resources/expire.png +0 -0
  45. package/ios/Resources/id.gif +0 -0
  46. package/ios/Resources/id_warning.png +0 -0
  47. package/ios/Resources/info_icon.png +0 -0
  48. package/ios/Resources/passport.gif +0 -0
  49. package/ios/Resources/sending.png +0 -0
  50. package/ios/Resources/warning.png +0 -0
  51. package/ios/Resources/zoom_in.png +0 -0
  52. package/ios/Resources/zoom_out.png +0 -0
  53. package/ios/UIComponents/RNIOSProgressBar.h +4 -0
  54. package/ios/UIComponents/RNIOSProgressBar.m +34 -0
  55. package/ios/UIComponents/RNPassportScanner.m +26 -0
  56. package/ios/UIComponents/RNPassportScanner.swift +245 -0
  57. package/ios/UIComponents/RNTMapManager.h +4 -0
  58. package/ios/UIComponents/RNTMapManager.m +19 -0
  59. package/ios/View/DataDecoder.swift +469 -0
  60. package/ios/View/FaceMatchController.swift +258 -0
  61. package/ios/View/IDCardController.swift +360 -0
  62. package/ios/View/OtherController.swift +283 -0
  63. package/ios/View/PassportController.swift +302 -0
  64. package/ios/View/UI.swift +298 -0
  65. package/lib/commonjs/AssentifyProvider.js +202 -0
  66. package/lib/commonjs/AssentifyProvider.js.map +1 -0
  67. package/lib/commonjs/AssentifyWrapper.js +76 -0
  68. package/lib/commonjs/AssentifyWrapper.js.map +1 -0
  69. package/lib/commonjs/Language.js +27 -0
  70. package/lib/commonjs/Language.js.map +1 -0
  71. package/lib/commonjs/helpers/index.js +2 -0
  72. package/lib/commonjs/helpers/index.js.map +1 -0
  73. package/lib/commonjs/helpers/parsers/FaceMatchParser.js +27 -0
  74. package/lib/commonjs/helpers/parsers/FaceMatchParser.js.map +1 -0
  75. package/lib/commonjs/helpers/parsers/IDCardParser.js +25 -0
  76. package/lib/commonjs/helpers/parsers/IDCardParser.js.map +1 -0
  77. package/lib/commonjs/helpers/parsers/OtherIDParser.js +29 -0
  78. package/lib/commonjs/helpers/parsers/OtherIDParser.js.map +1 -0
  79. package/lib/commonjs/helpers/parsers/PassportParser.js +25 -0
  80. package/lib/commonjs/helpers/parsers/PassportParser.js.map +1 -0
  81. package/lib/commonjs/index.js +49 -0
  82. package/lib/commonjs/index.js.map +1 -0
  83. package/lib/commonjs/types.js +42 -0
  84. package/lib/commonjs/types.js.map +1 -0
  85. package/lib/module/AssentifyProvider.js +193 -0
  86. package/lib/module/AssentifyProvider.js.map +1 -0
  87. package/lib/module/AssentifyWrapper.js +70 -0
  88. package/lib/module/AssentifyWrapper.js.map +1 -0
  89. package/lib/module/Language.js +21 -0
  90. package/lib/module/Language.js.map +1 -0
  91. package/lib/module/helpers/index.js +2 -0
  92. package/lib/module/helpers/index.js.map +1 -0
  93. package/lib/module/helpers/parsers/FaceMatchParser.js +21 -0
  94. package/lib/module/helpers/parsers/FaceMatchParser.js.map +1 -0
  95. package/lib/module/helpers/parsers/IDCardParser.js +19 -0
  96. package/lib/module/helpers/parsers/IDCardParser.js.map +1 -0
  97. package/lib/module/helpers/parsers/OtherIDParser.js +23 -0
  98. package/lib/module/helpers/parsers/OtherIDParser.js.map +1 -0
  99. package/lib/module/helpers/parsers/PassportParser.js +19 -0
  100. package/lib/module/helpers/parsers/PassportParser.js.map +1 -0
  101. package/lib/module/index.js +6 -0
  102. package/lib/module/index.js.map +1 -0
  103. package/lib/module/types.js +36 -0
  104. package/lib/module/types.js.map +1 -0
  105. package/lib/typescript/babel.config.d.ts +3 -0
  106. package/lib/typescript/babel.config.d.ts.map +1 -0
  107. package/lib/typescript/commitlint.config.d.ts +7 -0
  108. package/lib/typescript/commitlint.config.d.ts.map +1 -0
  109. package/lib/typescript/example/babel.config.d.ts +8 -0
  110. package/lib/typescript/example/babel.config.d.ts.map +1 -0
  111. package/lib/typescript/example/index.d.ts +2 -0
  112. package/lib/typescript/example/index.d.ts.map +1 -0
  113. package/lib/typescript/example/jest.config.d.ts +2 -0
  114. package/lib/typescript/example/jest.config.d.ts.map +1 -0
  115. package/lib/typescript/example/metro.config.d.ts +3 -0
  116. package/lib/typescript/example/metro.config.d.ts.map +1 -0
  117. package/lib/typescript/example/react-native.config.d.ts +6 -0
  118. package/lib/typescript/example/react-native.config.d.ts.map +1 -0
  119. package/lib/typescript/example/src/App.d.ts +3 -0
  120. package/lib/typescript/example/src/App.d.ts.map +1 -0
  121. package/lib/typescript/example/src/Home.d.ts +4 -0
  122. package/lib/typescript/example/src/Home.d.ts.map +1 -0
  123. package/lib/typescript/example/src/navigator.d.ts +4 -0
  124. package/lib/typescript/example/src/navigator.d.ts.map +1 -0
  125. package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts +3 -0
  126. package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -0
  127. package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +11 -0
  128. package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -0
  129. package/lib/typescript/lib/commonjs/Language.d.ts +22 -0
  130. package/lib/typescript/lib/commonjs/Language.d.ts.map +1 -0
  131. package/lib/typescript/lib/commonjs/helpers/index.d.ts +1 -0
  132. package/lib/typescript/lib/commonjs/helpers/index.d.ts.map +1 -0
  133. package/lib/typescript/lib/commonjs/helpers/parsers/FaceMatchParser.d.ts +12 -0
  134. package/lib/typescript/lib/commonjs/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
  135. package/lib/typescript/lib/commonjs/helpers/parsers/IDCardParser.d.ts +11 -0
  136. package/lib/typescript/lib/commonjs/helpers/parsers/IDCardParser.d.ts.map +1 -0
  137. package/lib/typescript/lib/commonjs/helpers/parsers/OtherIDParser.d.ts +13 -0
  138. package/lib/typescript/lib/commonjs/helpers/parsers/OtherIDParser.d.ts.map +1 -0
  139. package/lib/typescript/lib/commonjs/helpers/parsers/PassportParser.d.ts +11 -0
  140. package/lib/typescript/lib/commonjs/helpers/parsers/PassportParser.d.ts.map +1 -0
  141. package/lib/typescript/lib/commonjs/index.d.ts +2 -0
  142. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
  143. package/lib/typescript/lib/commonjs/types.d.ts +18 -0
  144. package/lib/typescript/lib/commonjs/types.d.ts.map +1 -0
  145. package/lib/typescript/lib/module/AssentifyProvider.d.ts +3 -0
  146. package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -0
  147. package/lib/typescript/lib/module/AssentifyWrapper.d.ts +10 -0
  148. package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -0
  149. package/lib/typescript/lib/module/Language.d.ts +21 -0
  150. package/lib/typescript/lib/module/Language.d.ts.map +1 -0
  151. package/lib/typescript/lib/module/helpers/index.d.ts +1 -0
  152. package/lib/typescript/lib/module/helpers/index.d.ts.map +1 -0
  153. package/lib/typescript/lib/module/helpers/parsers/FaceMatchParser.d.ts +11 -0
  154. package/lib/typescript/lib/module/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
  155. package/lib/typescript/lib/module/helpers/parsers/IDCardParser.d.ts +10 -0
  156. package/lib/typescript/lib/module/helpers/parsers/IDCardParser.d.ts.map +1 -0
  157. package/lib/typescript/lib/module/helpers/parsers/OtherIDParser.d.ts +12 -0
  158. package/lib/typescript/lib/module/helpers/parsers/OtherIDParser.d.ts.map +1 -0
  159. package/lib/typescript/lib/module/helpers/parsers/PassportParser.d.ts +10 -0
  160. package/lib/typescript/lib/module/helpers/parsers/PassportParser.d.ts.map +1 -0
  161. package/lib/typescript/lib/module/index.d.ts +12 -0
  162. package/lib/typescript/lib/module/index.d.ts.map +1 -0
  163. package/lib/typescript/lib/module/types.d.ts +17 -0
  164. package/lib/typescript/lib/module/types.d.ts.map +1 -0
  165. package/lib/typescript/src/AssentifyProvider.d.ts +4 -0
  166. package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -0
  167. package/lib/typescript/src/AssentifyWrapper.d.ts +12 -0
  168. package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -0
  169. package/lib/typescript/src/Language.d.ts +22 -0
  170. package/lib/typescript/src/Language.d.ts.map +1 -0
  171. package/lib/typescript/src/helpers/index.d.ts +1 -0
  172. package/lib/typescript/src/helpers/index.d.ts.map +1 -0
  173. package/lib/typescript/src/helpers/parsers/FaceMatchParser.d.ts +4 -0
  174. package/lib/typescript/src/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
  175. package/lib/typescript/src/helpers/parsers/IDCardParser.d.ts +4 -0
  176. package/lib/typescript/src/helpers/parsers/IDCardParser.d.ts.map +1 -0
  177. package/lib/typescript/src/helpers/parsers/OtherIDParser.d.ts +4 -0
  178. package/lib/typescript/src/helpers/parsers/OtherIDParser.d.ts.map +1 -0
  179. package/lib/typescript/src/helpers/parsers/PassportParser.d.ts +4 -0
  180. package/lib/typescript/src/helpers/parsers/PassportParser.d.ts.map +1 -0
  181. package/lib/typescript/src/index.d.ts +12 -0
  182. package/lib/typescript/src/index.d.ts.map +1 -0
  183. package/lib/typescript/src/types.d.ts +308 -0
  184. package/lib/typescript/src/types.d.ts.map +1 -0
  185. package/package.json +201 -0
  186. package/src/AssentifyProvider.tsx +189 -0
  187. package/src/AssentifyWrapper.ts +142 -0
  188. package/src/Language.ts +22 -0
  189. package/src/helpers/index.ts +1 -0
  190. package/src/helpers/parsers/FaceMatchParser.ts +28 -0
  191. package/src/helpers/parsers/IDCardParser.ts +27 -0
  192. package/src/helpers/parsers/OtherIDParser.ts +31 -0
  193. package/src/helpers/parsers/PassportParser.ts +27 -0
  194. package/src/index.ts +6 -0
  195. package/src/types.ts +373 -0
package/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ Copyright (c) 2024 SAL
2
+
3
+ Proprietary and confidential. This project is confidential and only available to authorized individuals with the permission of the copyright holders.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # assentify-sdk-react-native
2
+
3
+
4
+ This React Native package provides integration with Assentify's services, allowing developers to incorporate Assentify functionalities seamlessly into their React Native applications.
5
+
6
+ ## About Assentify
7
+
8
+ [Assentify](https://assentify.com/home) is a leading provider of advanced AI-driven solutions for businesses across various industries. We specialize in harnessing the power of artificial intelligence to optimize processes, enhance decision-making, and drive innovation.
9
+
10
+ With a focus on cutting-edge technologies such as machine learning, natural language processing, and computer vision, Assentify empowers organizations to unlock new opportunities and stay ahead in today's rapidly evolving digital landscape.
11
+
12
+ ## Features
13
+
14
+ - **Integration:** Easily integrate Assentify's AI capabilities into your React Native applications..
15
+ - **Customization:** Tailor the integration to suit your specific requirements and use cases.
16
+ - **Scalability:** Scale seamlessly as your application grows, with robust support from Assentify's infrastructure.
17
+ - **Security:** Ensure the highest levels of data security and compliance with Assentify's industry-leading standards.
18
+
19
+ ## Installation
20
+
21
+ To install the Assentify React Native package, simply add it to your project:
22
+
23
+ npm install assentify-sdk-react-native
24
+ # or
25
+ yarn add assentify-sdk-react-native
26
+
27
+ ## Installation Android
28
+ **Permissions**
29
+
30
+ ```xml
31
+ <uses-permission android:name="android.permission.INTERNET" />
32
+ <uses-permission android:name="android.permission.CAMERA" />
33
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
34
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
35
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
36
+ <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
37
+ <uses-feature android:name="android.hardware.camera" />
38
+ <uses-feature android:name="android.hardware.camera.autofocus" />
39
+ ```
40
+ **AndroidManifest** Open your AndroidManifest.xml file and add the following activity.
41
+
42
+ ```xml
43
+ <application>
44
+ <activity android:name="com.assentifysdk.ScanPassportActivity" android:exported="true" android:noHistory="true" />
45
+ <activity android:name="com.assentifysdk.ScanOtherActivity" android:exported="true" android:noHistory="true" />
46
+ <activity android:name="com.assentifysdk.FaceMatchActivity" android:exported="true" android:noHistory="true" />
47
+ <activity android:name="com.assentifysdk.ScanIDActivity" android:exported="true" android:noHistory="true" />
48
+ </application>
49
+ ```
50
+
51
+ ## Versions
52
+ **0.0.1**
53
+ - Initial release of the Assentify React Native SDK
54
+ - Core features implemented, including integration with Assentify's AI services
55
+ - Basic scanning and face matching functionalities
56
+ - Support for both iOS and Android platforms
57
+
58
+
59
+ ## Author
60
+
61
+ Assentify, info.assentify@gmail.com
62
+
63
+ ## License
64
+
65
+ AssentifySdk is available under the MIT license. See the LICENSE file for more info.
@@ -0,0 +1,111 @@
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["AssentifySdk_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath 'com.android.tools.build:gradle:7.2.2'
12
+ classpath 'de.undercouch:gradle-download-task:4.1.1'
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
14
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15
+ }
16
+ }
17
+
18
+ def isNewArchitectureEnabled() {
19
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
20
+ }
21
+
22
+ apply plugin: "com.android.library"
23
+ apply plugin: "kotlin-android"
24
+
25
+ if (isNewArchitectureEnabled()) {
26
+ apply plugin: "com.facebook.react"
27
+ }
28
+
29
+ def getExtOrDefault(name) {
30
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["AssentifySdk_" + name]
31
+ }
32
+
33
+ def getExtOrIntegerDefault(name) {
34
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AssentifySdk_" + name]).toInteger()
35
+ }
36
+
37
+ def supportsNamespace() {
38
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
39
+ def major = parsed[0].toInteger()
40
+ def minor = parsed[1].toInteger()
41
+
42
+ // Namespace support was added in 7.3.0
43
+ return (major == 7 && minor >= 3) || major >= 8
44
+ }
45
+
46
+ android {
47
+ if (supportsNamespace()) {
48
+ namespace "com.assentifysdk"
49
+
50
+ sourceSets {
51
+ main {
52
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
53
+ }
54
+ }
55
+ }
56
+
57
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
58
+
59
+ defaultConfig {
60
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
61
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
62
+
63
+ }
64
+
65
+ buildTypes {
66
+ release {
67
+ minifyEnabled false
68
+ }
69
+ }
70
+
71
+ lintOptions {
72
+ disable "GradleCompatible"
73
+ }
74
+
75
+ compileOptions {
76
+ sourceCompatibility JavaVersion.VERSION_1_8
77
+ targetCompatibility JavaVersion.VERSION_1_8
78
+ }
79
+ packagingOptions {
80
+ pickFirst '**/libc++_shared.so'
81
+ pickFirst '**/libfbjni.so'
82
+ }
83
+
84
+ }
85
+
86
+ repositories {
87
+ jcenter()
88
+ mavenCentral()
89
+ google()
90
+ maven { url 'https://jitpack.io' }
91
+ }
92
+
93
+ def kotlin_version = getExtOrDefault("kotlinVersion")
94
+
95
+ dependencies {
96
+ // For < 0.71, this will be from the local maven repo
97
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
98
+ //noinspection GradleDynamicVersion
99
+ implementation "com.facebook.react:react-native:+"
100
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
101
+
102
+ implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:0.0.59'
103
+
104
+ /* Assentify Sdk Dependencies */
105
+ implementation 'com.google.code.gson:gson:2.8.9'
106
+ implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5'
107
+ implementation 'androidx.navigation:navigation-ui-ktx:2.7.5'
108
+ implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17'
109
+
110
+ }
111
+
@@ -0,0 +1,9 @@
1
+ AssentifySdk_kotlinVersion=1.8.22
2
+ AssentifySdk_minSdkVersion=24
3
+ AssentifySdk_targetSdkVersion=34
4
+ AssentifySdk_compileSdkVersion=34
5
+ AssentifySdk_ndkversion=25.1.8937393
6
+ android.useAndroidX=true
7
+ android.enableJetifier=true
8
+ org.gradle.jvmargs=-Xmx4g
9
+
@@ -0,0 +1,55 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.assentifysdk">
4
+
5
+
6
+
7
+
8
+
9
+ <uses-sdk />
10
+ <uses-feature android:glEsVersion="0x00030001" android:required="true" />
11
+
12
+ <uses-permission android:name="android.permission.INTERNET" />
13
+ <uses-permission android:name="android.permission.CAMERA" />
14
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
15
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
16
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
17
+ <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
18
+ <uses-feature android:name="android.hardware.camera" />
19
+ <uses-feature android:name="android.hardware.camera.autofocus" />
20
+
21
+ <application
22
+ android:allowBackup="true"
23
+ android:extractNativeLibs="true"
24
+ android:hardwareAccelerated="true"
25
+ android:installLocation="internalOnly"
26
+ android:requestLegacyExternalStorage="true"
27
+ android:supportsRtl="true">
28
+
29
+ <activity
30
+ android:name="com.assentifysdk.ScanPassportActivity"
31
+ android:exported="true"
32
+ android:noHistory="true"
33
+ />
34
+
35
+ <activity
36
+ android:name="com.assentifysdk.ScanOtherActivity"
37
+ android:exported="true"
38
+ android:noHistory="true"
39
+ />
40
+
41
+ <activity
42
+ android:name="com.assentifysdk.FaceMatchActivity"
43
+ android:exported="true"
44
+ android:noHistory="true"
45
+ />
46
+
47
+ <activity
48
+ android:name="com.assentifysdk.ScanIDActivity"
49
+ android:exported="true"
50
+ android:noHistory="true"
51
+ />
52
+
53
+ </application>
54
+
55
+ </manifest>
@@ -0,0 +1,33 @@
1
+ package com.assentifysdk
2
+
3
+ import android.R
4
+ import android.widget.ProgressBar
5
+ import com.facebook.react.uimanager.SimpleViewManager
6
+ import com.facebook.react.uimanager.ThemedReactContext
7
+ import com.facebook.react.uimanager.annotations.ReactProp
8
+
9
+ class AndroidProgressBarModule : SimpleViewManager<ProgressBar>() {
10
+ var videoView: ProgressBar? = null
11
+ override fun getName(): String {
12
+ return REACT_CLASS
13
+ }
14
+
15
+ override fun createViewInstance(reactContext: ThemedReactContext): ProgressBar {
16
+ videoView = ProgressBar(reactContext, null, R.attr.progressBarStyleHorizontal)
17
+ return videoView as ProgressBar
18
+ }
19
+
20
+ @ReactProp(name = "max")
21
+ fun setMax(view: ProgressBar, progress: Int) {
22
+ view.max = progress
23
+ }
24
+
25
+ @ReactProp(name = "progress")
26
+ fun setProgress(view: ProgressBar, progress: Int) {
27
+ view.progress = progress
28
+ }
29
+
30
+ companion object {
31
+ const val REACT_CLASS = "AndroidProgressBarModule"
32
+ }
33
+ }
@@ -0,0 +1,39 @@
1
+ package com.assentifysdk
2
+
3
+ import com.facebook.react.bridge.Arguments
4
+ import com.facebook.react.bridge.ReactApplicationContext
5
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
6
+ import com.facebook.react.bridge.WritableMap
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
8
+
9
+ abstract class AssentifySdkBaseModule(context: ReactApplicationContext) : ReactContextBaseJavaModule(context) {
10
+ companion object {
11
+ const val NAME = "NativeAssentifySdk"
12
+ private const val ERROR_KEY = "EventError"
13
+ }
14
+
15
+ override fun getName(): String {
16
+ return NAME
17
+ }
18
+
19
+ val reactContext = context
20
+
21
+ fun sendErrorObject(errorCode: String?, errorMsg: String?) {
22
+ val errorResult = Arguments.createMap().apply {
23
+ putString("errorCode", errorCode ?: "")
24
+ putString("errorMessage", errorMsg ?: "")
25
+ }
26
+ sendEvent(ERROR_KEY, errorResult)
27
+ }
28
+
29
+ fun showErrorMessage(msg: String?) {
30
+ val errorResult = Arguments.createMap().apply {
31
+ putString("errorMessage", msg ?: "")
32
+ }
33
+ sendEvent(ERROR_KEY, errorResult)
34
+ }
35
+
36
+ fun sendEvent(eventName: String, params: WritableMap) =
37
+ reactApplicationContext.getJSModule(RCTDeviceEventEmitter::class.java)
38
+ .emit(eventName, params)
39
+ }