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.
- package/LICENSE +3 -0
- package/README.md +65 -0
- package/android/build.gradle +111 -0
- package/android/gradle.properties +9 -0
- package/android/src/main/AndroidManifest.xml +55 -0
- package/android/src/main/java/com/assentifysdk/AndroidProgressBarModule.kt +33 -0
- package/android/src/main/java/com/assentifysdk/AssentifySdkBaseModule.kt +39 -0
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +432 -0
- package/android/src/main/java/com/assentifysdk/AssentifySdkPackage.kt +19 -0
- package/android/src/main/java/com/assentifysdk/FaceMatchActivity.kt +309 -0
- package/android/src/main/java/com/assentifysdk/ImageToBase64Converter.kt +40 -0
- package/android/src/main/java/com/assentifysdk/ReactApplicationContextObject.kt +14 -0
- package/android/src/main/java/com/assentifysdk/ScanIDActivity.kt +431 -0
- package/android/src/main/java/com/assentifysdk/ScanOtherActivity.kt +328 -0
- package/android/src/main/java/com/assentifysdk/ScanPassportActivity.kt +364 -0
- package/android/src/main/java/com/assentifysdk/StepsKeys.kt +91 -0
- package/android/src/main/res/drawable/back_icon.png +0 -0
- package/android/src/main/res/drawable/button_rounded_background.xml +6 -0
- package/android/src/main/res/drawable/card.gif +0 -0
- package/android/src/main/res/drawable/expire.png +0 -0
- package/android/src/main/res/drawable/id.gif +0 -0
- package/android/src/main/res/drawable/id_warning.png +0 -0
- package/android/src/main/res/drawable/info_icon.png +0 -0
- package/android/src/main/res/drawable/info_rounded_background.xml +6 -0
- package/android/src/main/res/drawable/passport.gif +0 -0
- package/android/src/main/res/drawable/rounded_background.xml +3 -0
- package/android/src/main/res/drawable/sending.png +0 -0
- package/android/src/main/res/drawable/warning.png +0 -0
- package/android/src/main/res/drawable/zoom_in.png +0 -0
- package/android/src/main/res/drawable/zoom_out.png +0 -0
- package/android/src/main/res/layout/activity_face_scan.xml +242 -0
- package/android/src/main/res/layout/activity_scan.xml +297 -0
- package/android/src/main/res/raw/sending_video.MP4 +0 -0
- package/android/src/main/res/values/colors.xml +8 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +4 -0
- package/assentify-sdk.podspec +43 -0
- package/ios/AssentifySdkBaseModule.swift +15 -0
- package/ios/Info.plist +27 -0
- package/ios/NativeAssentifySdk-Bridging-Header.h +3 -0
- package/ios/NativeAssentifySdk.mm +45 -0
- package/ios/NativeAssentifySdk.swift +460 -0
- package/ios/Resources/card.gif +0 -0
- package/ios/Resources/expire.png +0 -0
- package/ios/Resources/id.gif +0 -0
- package/ios/Resources/id_warning.png +0 -0
- package/ios/Resources/info_icon.png +0 -0
- package/ios/Resources/passport.gif +0 -0
- package/ios/Resources/sending.png +0 -0
- package/ios/Resources/warning.png +0 -0
- package/ios/Resources/zoom_in.png +0 -0
- package/ios/Resources/zoom_out.png +0 -0
- package/ios/UIComponents/RNIOSProgressBar.h +4 -0
- package/ios/UIComponents/RNIOSProgressBar.m +34 -0
- package/ios/UIComponents/RNPassportScanner.m +26 -0
- package/ios/UIComponents/RNPassportScanner.swift +245 -0
- package/ios/UIComponents/RNTMapManager.h +4 -0
- package/ios/UIComponents/RNTMapManager.m +19 -0
- package/ios/View/DataDecoder.swift +469 -0
- package/ios/View/FaceMatchController.swift +258 -0
- package/ios/View/IDCardController.swift +360 -0
- package/ios/View/OtherController.swift +283 -0
- package/ios/View/PassportController.swift +302 -0
- package/ios/View/UI.swift +298 -0
- package/lib/commonjs/AssentifyProvider.js +202 -0
- package/lib/commonjs/AssentifyProvider.js.map +1 -0
- package/lib/commonjs/AssentifyWrapper.js +76 -0
- package/lib/commonjs/AssentifyWrapper.js.map +1 -0
- package/lib/commonjs/Language.js +27 -0
- package/lib/commonjs/Language.js.map +1 -0
- package/lib/commonjs/helpers/index.js +2 -0
- package/lib/commonjs/helpers/index.js.map +1 -0
- package/lib/commonjs/helpers/parsers/FaceMatchParser.js +27 -0
- package/lib/commonjs/helpers/parsers/FaceMatchParser.js.map +1 -0
- package/lib/commonjs/helpers/parsers/IDCardParser.js +25 -0
- package/lib/commonjs/helpers/parsers/IDCardParser.js.map +1 -0
- package/lib/commonjs/helpers/parsers/OtherIDParser.js +29 -0
- package/lib/commonjs/helpers/parsers/OtherIDParser.js.map +1 -0
- package/lib/commonjs/helpers/parsers/PassportParser.js +25 -0
- package/lib/commonjs/helpers/parsers/PassportParser.js.map +1 -0
- package/lib/commonjs/index.js +49 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/types.js +42 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/AssentifyProvider.js +193 -0
- package/lib/module/AssentifyProvider.js.map +1 -0
- package/lib/module/AssentifyWrapper.js +70 -0
- package/lib/module/AssentifyWrapper.js.map +1 -0
- package/lib/module/Language.js +21 -0
- package/lib/module/Language.js.map +1 -0
- package/lib/module/helpers/index.js +2 -0
- package/lib/module/helpers/index.js.map +1 -0
- package/lib/module/helpers/parsers/FaceMatchParser.js +21 -0
- package/lib/module/helpers/parsers/FaceMatchParser.js.map +1 -0
- package/lib/module/helpers/parsers/IDCardParser.js +19 -0
- package/lib/module/helpers/parsers/IDCardParser.js.map +1 -0
- package/lib/module/helpers/parsers/OtherIDParser.js +23 -0
- package/lib/module/helpers/parsers/OtherIDParser.js.map +1 -0
- package/lib/module/helpers/parsers/PassportParser.js +19 -0
- package/lib/module/helpers/parsers/PassportParser.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/types.js +36 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/babel.config.d.ts +3 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/commitlint.config.d.ts +7 -0
- package/lib/typescript/commitlint.config.d.ts.map +1 -0
- package/lib/typescript/example/babel.config.d.ts +8 -0
- package/lib/typescript/example/babel.config.d.ts.map +1 -0
- package/lib/typescript/example/index.d.ts +2 -0
- package/lib/typescript/example/index.d.ts.map +1 -0
- package/lib/typescript/example/jest.config.d.ts +2 -0
- package/lib/typescript/example/jest.config.d.ts.map +1 -0
- package/lib/typescript/example/metro.config.d.ts +3 -0
- package/lib/typescript/example/metro.config.d.ts.map +1 -0
- package/lib/typescript/example/react-native.config.d.ts +6 -0
- package/lib/typescript/example/react-native.config.d.ts.map +1 -0
- package/lib/typescript/example/src/App.d.ts +3 -0
- package/lib/typescript/example/src/App.d.ts.map +1 -0
- package/lib/typescript/example/src/Home.d.ts +4 -0
- package/lib/typescript/example/src/Home.d.ts.map +1 -0
- package/lib/typescript/example/src/navigator.d.ts +4 -0
- package/lib/typescript/example/src/navigator.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts +3 -0
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +11 -0
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Language.d.ts +22 -0
- package/lib/typescript/lib/commonjs/Language.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/helpers/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/FaceMatchParser.d.ts +12 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/IDCardParser.d.ts +11 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/IDCardParser.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/OtherIDParser.d.ts +13 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/OtherIDParser.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/PassportParser.d.ts +11 -0
- package/lib/typescript/lib/commonjs/helpers/parsers/PassportParser.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types.d.ts +18 -0
- package/lib/typescript/lib/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts +3 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -0
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts +10 -0
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -0
- package/lib/typescript/lib/module/Language.d.ts +21 -0
- package/lib/typescript/lib/module/Language.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/index.d.ts +1 -0
- package/lib/typescript/lib/module/helpers/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/parsers/FaceMatchParser.d.ts +11 -0
- package/lib/typescript/lib/module/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/parsers/IDCardParser.d.ts +10 -0
- package/lib/typescript/lib/module/helpers/parsers/IDCardParser.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/parsers/OtherIDParser.d.ts +12 -0
- package/lib/typescript/lib/module/helpers/parsers/OtherIDParser.d.ts.map +1 -0
- package/lib/typescript/lib/module/helpers/parsers/PassportParser.d.ts +10 -0
- package/lib/typescript/lib/module/helpers/parsers/PassportParser.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +12 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/types.d.ts +17 -0
- package/lib/typescript/lib/module/types.d.ts.map +1 -0
- package/lib/typescript/src/AssentifyProvider.d.ts +4 -0
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -0
- package/lib/typescript/src/AssentifyWrapper.d.ts +12 -0
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -0
- package/lib/typescript/src/Language.d.ts +22 -0
- package/lib/typescript/src/Language.d.ts.map +1 -0
- package/lib/typescript/src/helpers/index.d.ts +1 -0
- package/lib/typescript/src/helpers/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/parsers/FaceMatchParser.d.ts +4 -0
- package/lib/typescript/src/helpers/parsers/FaceMatchParser.d.ts.map +1 -0
- package/lib/typescript/src/helpers/parsers/IDCardParser.d.ts +4 -0
- package/lib/typescript/src/helpers/parsers/IDCardParser.d.ts.map +1 -0
- package/lib/typescript/src/helpers/parsers/OtherIDParser.d.ts +4 -0
- package/lib/typescript/src/helpers/parsers/OtherIDParser.d.ts.map +1 -0
- package/lib/typescript/src/helpers/parsers/PassportParser.d.ts +4 -0
- package/lib/typescript/src/helpers/parsers/PassportParser.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +308 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +201 -0
- package/src/AssentifyProvider.tsx +189 -0
- package/src/AssentifyWrapper.ts +142 -0
- package/src/Language.ts +22 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/parsers/FaceMatchParser.ts +28 -0
- package/src/helpers/parsers/IDCardParser.ts +27 -0
- package/src/helpers/parsers/OtherIDParser.ts +31 -0
- package/src/helpers/parsers/PassportParser.ts +27 -0
- package/src/index.ts +6 -0
- package/src/types.ts +373 -0
package/LICENSE
ADDED
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,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
|
+
}
|