@getyoti/yoti-doc-scan-react-native 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -0
- package/RNYotiDocScan.js +3 -0
- package/android/.project +17 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/android/build.gradle +47 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradlew +172 -0
- package/android/gradlew.bat +84 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/yoti/reactnative/docscan/RNYotiDocScanModule.java +79 -0
- package/android/src/main/java/com/yoti/reactnative/docscan/RNYotiDocScanPackage.java +23 -0
- package/ios/RNYotiDocScan.h +7 -0
- package/ios/RNYotiDocScan.m +120 -0
- package/ios/RNYotiDocScan.xcodeproj/project.pbxproj +258 -0
- package/ios/RNYotiDocScan.xcodeproj/xcshareddata/xcschemes/RNYotiDocScan.xcscheme +67 -0
- package/package.json +29 -0
- package/yoti-doc-scan-react-native.podspec +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Yoti IDV, React Native
|
|
2
|
+
|
|
3
|
+
[](https://github.com/getyoti/yoti-doc-scan-react-native/releases)
|
|
4
|
+
[](https://github.com/getyoti/yoti-doc-scan-react-native/actions?query=workflow%3A%22Publish+Release%22)
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
A react native wrapper of Yoti IDV for [Android](https://github.com/getyoti/yoti-doc-scan-android) and [iOS](https://github.com/getyoti/yoti-doc-scan-ios). Yoti IDV allows a user of your app to take a photo of their document, as well as to scan or capture their face, we then verify this instantly and prepare a response, which your system can then retrieve on your hosted site.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
To integrate with Yoti IDV, a working infrastructure is needed (see [developers.yoti.com](https://developers.yoti.com/identity-verification/overview) for more details or get in touch with us [here](https://developers.yoti.com/support)).
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
- [Android SDK 3+](https://github.com/getyoti/yoti-doc-scan-android/releases)
|
|
14
|
+
- [iOS SDK 4+](https://github.com/getyoti/yoti-doc-scan-ios/releases)
|
|
15
|
+
|
|
16
|
+
## Integration
|
|
17
|
+
Start your integration by adding the following dependency to your `package.json` file:
|
|
18
|
+
```json
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@getyoti/yoti-doc-scan-react-native": "^2.0.0"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Android
|
|
25
|
+
Continuing with your integration for Android, add the following property and repository to your project's [`build.gradle`](https://developer.android.com/build#build-files) file:
|
|
26
|
+
```groovy
|
|
27
|
+
buildscript {
|
|
28
|
+
ext {
|
|
29
|
+
yotiSdkVersion = "3.1.1"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
allprojects {
|
|
33
|
+
repositories {
|
|
34
|
+
maven {
|
|
35
|
+
url 'https://maven.microblink.com'
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
Now add any of these optional dependencies to your app's [`build.gradle`](https://developer.android.com/build#build-files) file:
|
|
41
|
+
```groovy
|
|
42
|
+
dependencies {
|
|
43
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-doc-scan:${rootProject.ext.yotiSdkVersion}"
|
|
44
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-doc-scan-sup:${rootProject.ext.yotiSdkVersion}"
|
|
45
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-liveness-zoom:${rootProject.ext.yotiSdkVersion}"
|
|
46
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-facecapture:${rootProject.ext.yotiSdkVersion}" // With embedded AI model
|
|
47
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-facecapture-unbundled:${rootProject.ext.yotiSdkVersion}" // Without embedded AI model - around 20 MB smaller in size
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
If you're using Proguard or another obfuscation tool, you should also add the following configuration rules to your `proguard-rules.pro` file:
|
|
51
|
+
```groovy
|
|
52
|
+
-keep class com.yoti.** { *; }
|
|
53
|
+
-keep class com.microblink.** { *; }
|
|
54
|
+
-keep class com.microblink.**$* { *; }
|
|
55
|
+
-dontwarn com.microblink.**
|
|
56
|
+
-keep class com.facetec.zoom.** { *; }
|
|
57
|
+
-dontwarn javax.annotation.Nullable
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### iOS
|
|
61
|
+
To continue your integration with iOS, you should add the following to your [`Podfile`](https://guides.cocoapods.org/using/the-podfile.html) and run `pod install` from its directory:
|
|
62
|
+
```bash
|
|
63
|
+
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
|
|
64
|
+
require_relative '../node_modules/react-native/scripts/react_native_pods'
|
|
65
|
+
|
|
66
|
+
platform :ios, '11.0'
|
|
67
|
+
|
|
68
|
+
target 'TargetName' do
|
|
69
|
+
config = use_native_modules!
|
|
70
|
+
use_react_native!(:path => config[:reactNativePath])
|
|
71
|
+
use_frameworks!
|
|
72
|
+
use_native_modules!
|
|
73
|
+
pod 'YotiSDKIdentityDocument' // Optional
|
|
74
|
+
pod 'YotiSDKSupplementaryDocument' // Optional
|
|
75
|
+
pod 'YotiSDKFaceTec' // Optional
|
|
76
|
+
pod 'YotiSDKFaceCapture' // Optional
|
|
77
|
+
end
|
|
78
|
+
```
|
|
79
|
+
In addition, you should add [`NSCameraUsageDescription`](https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription) to your `Info.plist`.
|
|
80
|
+
|
|
81
|
+
And if you have included `YotiSDKIdentityDocument` in your target, make sure to also:
|
|
82
|
+
- Add [`NFCReaderUsageDescription`](https://developer.apple.com/documentation/bundleresources/information_property_list/nfcreaderusagedescription) to your `Info.plist`
|
|
83
|
+
- Add [`com.apple.developer.nfc.readersession.iso7816.select-identifiers`](https://developer.apple.com/documentation/bundleresources/information_property_list/select-identifiers) to your `Info.plist` and include [`A0000002471001`](https://www.icao.int/publications/Documents/9303_p10_cons_en.pdf) as an application identifier for your app to support
|
|
84
|
+
- Turn on [`Near Field Communication Tag Reading`](https://developer.apple.com/documentation/corenfc/building_an_nfc_tag-reader_app) under the Signing & Capabilities tab for your project’s target
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
### 1. Import module
|
|
88
|
+
```javascript
|
|
89
|
+
import RNYotiDocScan from '@getyoti/yoti-doc-scan-react-native';
|
|
90
|
+
```
|
|
91
|
+
### 2. Launch a session
|
|
92
|
+
Launch a session with its required parameters using the `startSession` function.
|
|
93
|
+
```javascript
|
|
94
|
+
const successCallback = (code, description) => {
|
|
95
|
+
...
|
|
96
|
+
}
|
|
97
|
+
const errorCallback = (code, description) => {
|
|
98
|
+
...
|
|
99
|
+
}
|
|
100
|
+
RNYotiDocScan.startSession(id, token, successCallback, errorCallback);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Customizations
|
|
104
|
+
On iOS, you can set the primary color using the following API:
|
|
105
|
+
```javascript
|
|
106
|
+
RNYotiDocScan.setPrimaryColorRGB(0, 0, 0); // default: (34, 157, 255)
|
|
107
|
+
```
|
|
108
|
+
To customize the colors on Android, please refer to its separate [documentation](https://github.com/getyoti/yoti-doc-scan-android#colours).
|
|
109
|
+
|
|
110
|
+
In addition, you can choose to also specify a request code on Android:
|
|
111
|
+
```javascript
|
|
112
|
+
RNYotiDocScan.setRequestCode(0); // default: 9001
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Supported languages
|
|
116
|
+
Yoti IDV supports the 9 languages listed in the table below, but their use is driven by the localization configuration of your target. If your target only supports a subset of our SDK's supported languages, our SDK will fall back to English on the ones your target doesn't support.
|
|
117
|
+
|
|
118
|
+
Language | Code
|
|
119
|
+
:-- | :--
|
|
120
|
+
Arabic | ar
|
|
121
|
+
Dutch | nl
|
|
122
|
+
English (default) | en
|
|
123
|
+
French | fr
|
|
124
|
+
German | de
|
|
125
|
+
Italian | it
|
|
126
|
+
Russian | ru
|
|
127
|
+
Spanish | es
|
|
128
|
+
Turkish | tr
|
|
129
|
+
|
|
130
|
+
## Error codes
|
|
131
|
+
Code | Description
|
|
132
|
+
:-- | :--
|
|
133
|
+
1000 | No error occurred. The user cancelled the session
|
|
134
|
+
2000 | Unauthorised request (wrong or expired session token)
|
|
135
|
+
2001 | Session not found
|
|
136
|
+
2002 | Session expired
|
|
137
|
+
2003 | SDK launched without session Token
|
|
138
|
+
2004 | SDK launched without session ID
|
|
139
|
+
3000 | Yoti's services are down or unable to process the request
|
|
140
|
+
3001 | An error occurred during a network request
|
|
141
|
+
3002 | The user did not have a network connection
|
|
142
|
+
4000 | The user did not grant permission to the camera
|
|
143
|
+
4001 | The user submitted a wrong document
|
|
144
|
+
5000 | The user's camera was not found and file upload is not allowed
|
|
145
|
+
5002 | No more local tries for the liveness flow
|
|
146
|
+
5003 | SDK is out-of-date, please update the SDK to the latest version
|
|
147
|
+
5004 | An unexpected internal error occurred
|
|
148
|
+
5005 | An unexpected document capture error occurred
|
|
149
|
+
5006 | An unexpected liveness capture error occurred
|
|
150
|
+
5008 | An unsupported configuration was used
|
|
151
|
+
6000 | The identity document dependency could not be found
|
|
152
|
+
6001 | The face scan dependency could not be found
|
|
153
|
+
6002 | The supplementary document dependency could not be found
|
|
154
|
+
6003 | The face capture dependency could not be found
|
|
155
|
+
7000 | The user did not have the required documents
|
|
156
|
+
|
|
157
|
+
## Support
|
|
158
|
+
For any questions or support please contact us [here](https://support.yoti.com). Once we have answered your question, we may contact you again to discuss Yoti products and services. If you'd prefer us not to do this, please let us know when you e-mail.
|
|
159
|
+
|
|
160
|
+
## Licence
|
|
161
|
+
See the licence [here](https://www.yoti.com/terms/identity-verification).
|
package/RNYotiDocScan.js
ADDED
package/android/.project
ADDED
|
@@ -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,47 @@
|
|
|
1
|
+
apply plugin: 'com.android.library'
|
|
2
|
+
|
|
3
|
+
def safeExtGet(prop, fallback) {
|
|
4
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
android {
|
|
8
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 29)
|
|
9
|
+
buildToolsVersion safeExtGet('buildToolsVersion', '29.0.3')
|
|
10
|
+
|
|
11
|
+
defaultConfig {
|
|
12
|
+
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
13
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 29)
|
|
14
|
+
versionCode 204
|
|
15
|
+
versionName "2.0.0"
|
|
16
|
+
ndk {
|
|
17
|
+
abiFilters "armeabi-v7a", "x86"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
buildTypes {
|
|
21
|
+
debug {
|
|
22
|
+
matchingFallbacks = ['release']
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
packagingOptions {
|
|
26
|
+
exclude 'META-INF/*.kotlin_module'
|
|
27
|
+
exclude "**/kotlin/**"
|
|
28
|
+
}
|
|
29
|
+
compileOptions {
|
|
30
|
+
sourceCompatibility = '1.8'
|
|
31
|
+
targetCompatibility = '1.8'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dependencies {
|
|
36
|
+
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
|
|
37
|
+
implementation "com.yoti.mobile.android.sdk:yoti-sdk-core:${safeExtGet('yotiSdkVersion', '+')}"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
allprojects {
|
|
41
|
+
repositories {
|
|
42
|
+
mavenCentral()
|
|
43
|
+
maven {
|
|
44
|
+
url "https://jitpack.io"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
Binary file
|
package/android/gradlew
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
##
|
|
5
|
+
## Gradle start up script for UN*X
|
|
6
|
+
##
|
|
7
|
+
##############################################################################
|
|
8
|
+
|
|
9
|
+
# Attempt to set APP_HOME
|
|
10
|
+
# Resolve links: $0 may be a link
|
|
11
|
+
PRG="$0"
|
|
12
|
+
# Need this for relative symlinks.
|
|
13
|
+
while [ -h "$PRG" ] ; do
|
|
14
|
+
ls=`ls -ld "$PRG"`
|
|
15
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
16
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
17
|
+
PRG="$link"
|
|
18
|
+
else
|
|
19
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
20
|
+
fi
|
|
21
|
+
done
|
|
22
|
+
SAVED="`pwd`"
|
|
23
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
24
|
+
APP_HOME="`pwd -P`"
|
|
25
|
+
cd "$SAVED" >/dev/null
|
|
26
|
+
|
|
27
|
+
APP_NAME="Gradle"
|
|
28
|
+
APP_BASE_NAME=`basename "$0"`
|
|
29
|
+
|
|
30
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
31
|
+
DEFAULT_JVM_OPTS=""
|
|
32
|
+
|
|
33
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
34
|
+
MAX_FD="maximum"
|
|
35
|
+
|
|
36
|
+
warn () {
|
|
37
|
+
echo "$*"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
die () {
|
|
41
|
+
echo
|
|
42
|
+
echo "$*"
|
|
43
|
+
echo
|
|
44
|
+
exit 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# OS specific support (must be 'true' or 'false').
|
|
48
|
+
cygwin=false
|
|
49
|
+
msys=false
|
|
50
|
+
darwin=false
|
|
51
|
+
nonstop=false
|
|
52
|
+
case "`uname`" in
|
|
53
|
+
CYGWIN* )
|
|
54
|
+
cygwin=true
|
|
55
|
+
;;
|
|
56
|
+
Darwin* )
|
|
57
|
+
darwin=true
|
|
58
|
+
;;
|
|
59
|
+
MINGW* )
|
|
60
|
+
msys=true
|
|
61
|
+
;;
|
|
62
|
+
NONSTOP* )
|
|
63
|
+
nonstop=true
|
|
64
|
+
;;
|
|
65
|
+
esac
|
|
66
|
+
|
|
67
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
68
|
+
|
|
69
|
+
# Determine the Java command to use to start the JVM.
|
|
70
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
71
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
72
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
73
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
74
|
+
else
|
|
75
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
76
|
+
fi
|
|
77
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
78
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
79
|
+
|
|
80
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
81
|
+
location of your Java installation."
|
|
82
|
+
fi
|
|
83
|
+
else
|
|
84
|
+
JAVACMD="java"
|
|
85
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
86
|
+
|
|
87
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
88
|
+
location of your Java installation."
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Increase the maximum file descriptors if we can.
|
|
92
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
93
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
94
|
+
if [ $? -eq 0 ] ; then
|
|
95
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
96
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
97
|
+
fi
|
|
98
|
+
ulimit -n $MAX_FD
|
|
99
|
+
if [ $? -ne 0 ] ; then
|
|
100
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
101
|
+
fi
|
|
102
|
+
else
|
|
103
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
104
|
+
fi
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
108
|
+
if $darwin; then
|
|
109
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
# For Cygwin, switch paths to Windows format before running java
|
|
113
|
+
if $cygwin ; then
|
|
114
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
115
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
116
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
117
|
+
|
|
118
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
119
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
120
|
+
SEP=""
|
|
121
|
+
for dir in $ROOTDIRSRAW ; do
|
|
122
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
123
|
+
SEP="|"
|
|
124
|
+
done
|
|
125
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
126
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
127
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
128
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
129
|
+
fi
|
|
130
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
131
|
+
i=0
|
|
132
|
+
for arg in "$@" ; do
|
|
133
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
134
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
135
|
+
|
|
136
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
137
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
138
|
+
else
|
|
139
|
+
eval `echo args$i`="\"$arg\""
|
|
140
|
+
fi
|
|
141
|
+
i=$((i+1))
|
|
142
|
+
done
|
|
143
|
+
case $i in
|
|
144
|
+
(0) set -- ;;
|
|
145
|
+
(1) set -- "$args0" ;;
|
|
146
|
+
(2) set -- "$args0" "$args1" ;;
|
|
147
|
+
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
148
|
+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
149
|
+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
150
|
+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
151
|
+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
152
|
+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
153
|
+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
154
|
+
esac
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
# Escape application args
|
|
158
|
+
save () {
|
|
159
|
+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
160
|
+
echo " "
|
|
161
|
+
}
|
|
162
|
+
APP_ARGS=$(save "$@")
|
|
163
|
+
|
|
164
|
+
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
165
|
+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
166
|
+
|
|
167
|
+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
168
|
+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
169
|
+
cd "$(dirname "$0")"
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
exec "$JAVACMD" "$@"
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@if "%DEBUG%" == "" @echo off
|
|
2
|
+
@rem ##########################################################################
|
|
3
|
+
@rem
|
|
4
|
+
@rem Gradle startup script for Windows
|
|
5
|
+
@rem
|
|
6
|
+
@rem ##########################################################################
|
|
7
|
+
|
|
8
|
+
@rem Set local scope for the variables with windows NT shell
|
|
9
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
10
|
+
|
|
11
|
+
set DIRNAME=%~dp0
|
|
12
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
13
|
+
set APP_BASE_NAME=%~n0
|
|
14
|
+
set APP_HOME=%DIRNAME%
|
|
15
|
+
|
|
16
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
17
|
+
set DEFAULT_JVM_OPTS=
|
|
18
|
+
|
|
19
|
+
@rem Find java.exe
|
|
20
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
21
|
+
|
|
22
|
+
set JAVA_EXE=java.exe
|
|
23
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
24
|
+
if "%ERRORLEVEL%" == "0" goto init
|
|
25
|
+
|
|
26
|
+
echo.
|
|
27
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
28
|
+
echo.
|
|
29
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
30
|
+
echo location of your Java installation.
|
|
31
|
+
|
|
32
|
+
goto fail
|
|
33
|
+
|
|
34
|
+
:findJavaFromJavaHome
|
|
35
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
36
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
37
|
+
|
|
38
|
+
if exist "%JAVA_EXE%" goto init
|
|
39
|
+
|
|
40
|
+
echo.
|
|
41
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
42
|
+
echo.
|
|
43
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
44
|
+
echo location of your Java installation.
|
|
45
|
+
|
|
46
|
+
goto fail
|
|
47
|
+
|
|
48
|
+
:init
|
|
49
|
+
@rem Get command-line arguments, handling Windows variants
|
|
50
|
+
|
|
51
|
+
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
52
|
+
|
|
53
|
+
:win9xME_args
|
|
54
|
+
@rem Slurp the command line arguments.
|
|
55
|
+
set CMD_LINE_ARGS=
|
|
56
|
+
set _SKIP=2
|
|
57
|
+
|
|
58
|
+
:win9xME_args_slurp
|
|
59
|
+
if "x%~1" == "x" goto execute
|
|
60
|
+
|
|
61
|
+
set CMD_LINE_ARGS=%*
|
|
62
|
+
|
|
63
|
+
:execute
|
|
64
|
+
@rem Setup the command line
|
|
65
|
+
|
|
66
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
67
|
+
|
|
68
|
+
@rem Execute Gradle
|
|
69
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
70
|
+
|
|
71
|
+
:end
|
|
72
|
+
@rem End local scope for the variables with windows NT shell
|
|
73
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
74
|
+
|
|
75
|
+
:fail
|
|
76
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
77
|
+
rem the _cmd.exe /c_ return code!
|
|
78
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
79
|
+
exit /b 1
|
|
80
|
+
|
|
81
|
+
:mainEnd
|
|
82
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
83
|
+
|
|
84
|
+
:omega
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.yoti.reactnative.docscan"></manifest>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
package com.yoti.reactnative.docscan;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import com.facebook.react.bridge.ActivityEventListener;
|
|
6
|
+
import com.facebook.react.bridge.BaseActivityEventListener;
|
|
7
|
+
import com.facebook.react.bridge.Callback;
|
|
8
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
10
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
11
|
+
import com.yoti.mobile.android.yotisdkcore.YotiSdk;
|
|
12
|
+
import static com.yoti.mobile.android.yotisdkcore.YotiSdkKt.YOTI_SDK_REQUEST_CODE;
|
|
13
|
+
|
|
14
|
+
public class RNYotiDocScanModule extends ReactContextBaseJavaModule {
|
|
15
|
+
private final static int SESSION_SUCCESS_CODE = 0;
|
|
16
|
+
private YotiSdk mYotiSdk;
|
|
17
|
+
private Callback mErrorCallback;
|
|
18
|
+
private Callback mSuccessCallback;
|
|
19
|
+
private int mRequestCode = YOTI_SDK_REQUEST_CODE;
|
|
20
|
+
|
|
21
|
+
private final ActivityEventListener mActivityEventListener = new BaseActivityEventListener() {
|
|
22
|
+
@Override
|
|
23
|
+
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) {
|
|
24
|
+
if (requestCode != mRequestCode) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
int code = mYotiSdk.getSessionStatusCode();
|
|
28
|
+
String description = mYotiSdk.getSessionStatusDescription();
|
|
29
|
+
if (resultCode == Activity.RESULT_OK && code == SESSION_SUCCESS_CODE) {
|
|
30
|
+
mSuccessCallback.invoke(code, description);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
mErrorCallback.invoke(code, description);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
RNYotiDocScanModule(ReactApplicationContext reactContext) {
|
|
38
|
+
super(reactContext);
|
|
39
|
+
reactContext.addActivityEventListener((mActivityEventListener));
|
|
40
|
+
mYotiSdk = new YotiSdk(reactContext).configureReactNativeClient();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Override
|
|
44
|
+
public String getName() {
|
|
45
|
+
return "RNYotiDocScan";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@ReactMethod
|
|
49
|
+
public void useCanadaService() {
|
|
50
|
+
mYotiSdk.useCanadaService();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactMethod
|
|
54
|
+
public void setPrimaryColorRGB(double red, double green, double blue) {
|
|
55
|
+
// Required to maintain cross-platform API compatibility.
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactMethod
|
|
59
|
+
public void setRequestCode(int requestCode) {
|
|
60
|
+
mRequestCode = requestCode;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactMethod
|
|
64
|
+
public void startSession(String sessionId, String clientSessionToken, Callback successCallback, Callback errorCallback) {
|
|
65
|
+
mErrorCallback = errorCallback;
|
|
66
|
+
mSuccessCallback = successCallback;
|
|
67
|
+
Activity currentActivity = getCurrentActivity();
|
|
68
|
+
if (currentActivity == null) {
|
|
69
|
+
mErrorCallback.invoke("E_ACTIVITY_DOES_NOT_EXIST");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
boolean success = mYotiSdk.setSessionId(sessionId).setClientSessionToken(clientSessionToken).start(currentActivity, mRequestCode);
|
|
73
|
+
if (!success) {
|
|
74
|
+
int code = mYotiSdk.getSessionStatusCode();
|
|
75
|
+
String description = mYotiSdk.getSessionStatusDescription();
|
|
76
|
+
mErrorCallback.invoke(code, description);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.yoti.reactnative.docscan;
|
|
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
|
+
import java.util.ArrayList;
|
|
8
|
+
import java.util.Collections;
|
|
9
|
+
import java.util.List;
|
|
10
|
+
|
|
11
|
+
public class RNYotiDocScanPackage implements ReactPackage {
|
|
12
|
+
@Override
|
|
13
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
14
|
+
return Collections.emptyList();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Override
|
|
18
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
19
|
+
List<NativeModule> modules = new ArrayList<>();
|
|
20
|
+
modules.add(new RNYotiDocScanModule(reactContext));
|
|
21
|
+
return modules;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#import "RNYotiDocScan.h"
|
|
2
|
+
#import <React/RCTUtils.h>
|
|
3
|
+
#import <YotiSDKNetwork/YotiSDKNetwork-Swift.h>
|
|
4
|
+
#import <YotiSDKCommon/YotiSDKCommon-Swift.h>
|
|
5
|
+
#import <YotiSDKCore/YotiSDKCore-Swift.h>
|
|
6
|
+
#if __has_include(<YotiSDKIdentityDocument/YotiSDKIdentityDocument-Swift.h>)
|
|
7
|
+
#import <YotiSDKIdentityDocument/YotiSDKIdentityDocument-Swift.h>
|
|
8
|
+
#endif
|
|
9
|
+
#if __has_include(<YotiSDKSupplementaryDocument/YotiSDKSupplementaryDocument-Swift.h>)
|
|
10
|
+
#import <YotiSDKSupplementaryDocument/YotiSDKSupplementaryDocument-Swift.h>
|
|
11
|
+
#endif
|
|
12
|
+
#if __has_include(<YotiSDKFaceTec/YotiSDKFaceTec-Swift.h>)
|
|
13
|
+
#import <YotiSDKFaceTec/YotiSDKFaceTec-Swift.h>
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<YotiSDKFaceCapture/YotiSDKFaceCapture-Swift.h>)
|
|
16
|
+
#import <YotiSDKFaceCapture/YotiSDKFaceCapture-Swift.h>
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NSInteger const kYotiSuccessStatusCode = 0;
|
|
20
|
+
|
|
21
|
+
@interface RNYotiDocScan()
|
|
22
|
+
|
|
23
|
+
@property (nonatomic, strong) YotiSDKNavigationController *yotiSDKNavigationController;
|
|
24
|
+
@property (nonatomic, strong) UIViewController *rootViewController;
|
|
25
|
+
@property (nonatomic, strong) NSString *sessionID;
|
|
26
|
+
@property (nonatomic, strong) NSString *sessionToken;
|
|
27
|
+
@property (nonatomic, assign) BOOL setUpCanadaServerLocation;
|
|
28
|
+
@property (nonatomic, strong) UIColor *primaryColor;
|
|
29
|
+
@property (nonatomic, strong) RCTResponseSenderBlock errorCallback;
|
|
30
|
+
@property (nonatomic, strong) RCTResponseSenderBlock successCallback;
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
@implementation RNYotiDocScan
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_MODULE(RNYotiDocScan);
|
|
36
|
+
|
|
37
|
+
RCT_EXPORT_METHOD(useCanadaService) {
|
|
38
|
+
_setUpCanadaServerLocation = YES;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
RCT_EXPORT_METHOD(setPrimaryColorRGB:(double)red green:(double)green blue:(double)blue) {
|
|
42
|
+
_primaryColor = [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1.0];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
RCT_EXPORT_METHOD(setRequestCode:(NSNumber * _Nonnull)requestCode) {
|
|
46
|
+
// Required to maintain cross-platform API compatibility.
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
RCT_EXPORT_METHOD(startSession:(NSString *)sessionId clientSessionToken:(NSString *)clientSessionToken successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback)
|
|
50
|
+
{
|
|
51
|
+
_sessionID = sessionId;
|
|
52
|
+
_sessionToken = clientSessionToken;
|
|
53
|
+
self.errorCallback = errorCallback;
|
|
54
|
+
self.successCallback = successCallback;
|
|
55
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
56
|
+
self.yotiSDKNavigationController = [[YotiSDKNavigationController alloc] init];
|
|
57
|
+
self.yotiSDKNavigationController.sdkDataSource = self;
|
|
58
|
+
self.yotiSDKNavigationController.sdkDelegate = self;
|
|
59
|
+
self.rootViewController = RCTPresentedViewController();
|
|
60
|
+
[self.rootViewController presentViewController:self.yotiSDKNavigationController animated:YES completion:nil];
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// MARK: - YotiSDKDataSource
|
|
65
|
+
- (NSArray<Class<YotiSDKModule>> * _Nonnull)supportedModuleTypesFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
66
|
+
NSMutableArray *moduleTypes = [NSMutableArray array];
|
|
67
|
+
#if __has_include(<YotiSDKIdentityDocument/YotiSDKIdentityDocument-Swift.h>)
|
|
68
|
+
[moduleTypes addObject:[YotiSDKIdentityDocumentModule class]];
|
|
69
|
+
#endif
|
|
70
|
+
#if __has_include(<YotiSDKSupplementaryDocument/YotiSDKSupplementaryDocument-Swift.h>)
|
|
71
|
+
[moduleTypes addObject:[YotiSDKSupplementaryDocumentModule class]];
|
|
72
|
+
#endif
|
|
73
|
+
#if __has_include(<YotiSDKFaceTec/YotiSDKFaceTec-Swift.h>)
|
|
74
|
+
[moduleTypes addObject:[YotiSDKFaceTecModule class]];
|
|
75
|
+
#endif
|
|
76
|
+
#if __has_include(<YotiSDKFaceCapture/YotiSDKFaceCapture-Swift.h>)
|
|
77
|
+
[moduleTypes addObject:[YotiSDKFaceCaptureModule class]];
|
|
78
|
+
#endif
|
|
79
|
+
return moduleTypes;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
- (NSString * _Nonnull)sessionIDFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
83
|
+
return _sessionID;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (NSString * _Nonnull)sessionTokenFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
87
|
+
return _sessionToken;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
- (ServerLocation)serverLocationFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
91
|
+
if (_setUpCanadaServerLocation) {
|
|
92
|
+
return ServerLocationCanada;
|
|
93
|
+
} else {
|
|
94
|
+
return ServerLocationUnitedKingdom;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
- (BOOL)isReactNativeClientFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
99
|
+
return YES;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// MARK: - YotiSDKDelegate
|
|
103
|
+
- (UIColor * _Nonnull)primaryColorFor:(YotiSDKNavigationController * _Nonnull)navigationController {
|
|
104
|
+
if (_primaryColor != nil) {
|
|
105
|
+
return _primaryColor;
|
|
106
|
+
} else {
|
|
107
|
+
return [UIColor colorWithRed:34.0/255.0 green:157.0/255.0 blue:255.0/255.0 alpha:1.0];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
- (void)navigationController:(YotiSDKNavigationController * _Nonnull)navigationController didFinishWithStatusCode:(NSInteger)statusCode {
|
|
112
|
+
[_rootViewController dismissViewControllerAnimated:YES completion:nil];
|
|
113
|
+
if (statusCode == kYotiSuccessStatusCode) {
|
|
114
|
+
_successCallback(@[[NSNumber numberWithLong:statusCode]]);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
_errorCallback(@[[NSNumber numberWithLong:statusCode]]);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@end
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 53;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
20C21B632A1E794C0065E753 /* RNYotiDocScan.m in Sources */ = {isa = PBXBuildFile; fileRef = 20C21B612A1E794C0065E753 /* RNYotiDocScan.m */; };
|
|
11
|
+
/* End PBXBuildFile section */
|
|
12
|
+
|
|
13
|
+
/* Begin PBXFileReference section */
|
|
14
|
+
20C21B612A1E794C0065E753 /* RNYotiDocScan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNYotiDocScan.m; sourceTree = "<group>"; };
|
|
15
|
+
20C21B622A1E794C0065E753 /* RNYotiDocScan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNYotiDocScan.h; sourceTree = "<group>"; };
|
|
16
|
+
2224907023E3E53500258582 /* libRNYotiDocScan.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNYotiDocScan.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
17
|
+
/* End PBXFileReference section */
|
|
18
|
+
|
|
19
|
+
/* Begin PBXGroup section */
|
|
20
|
+
2224906723E3E53500258582 = {
|
|
21
|
+
isa = PBXGroup;
|
|
22
|
+
children = (
|
|
23
|
+
20C21B622A1E794C0065E753 /* RNYotiDocScan.h */,
|
|
24
|
+
20C21B612A1E794C0065E753 /* RNYotiDocScan.m */,
|
|
25
|
+
2224907123E3E53500258582 /* Products */,
|
|
26
|
+
);
|
|
27
|
+
sourceTree = "<group>";
|
|
28
|
+
};
|
|
29
|
+
2224907123E3E53500258582 /* Products */ = {
|
|
30
|
+
isa = PBXGroup;
|
|
31
|
+
children = (
|
|
32
|
+
2224907023E3E53500258582 /* libRNYotiDocScan.a */,
|
|
33
|
+
);
|
|
34
|
+
name = Products;
|
|
35
|
+
sourceTree = "<group>";
|
|
36
|
+
};
|
|
37
|
+
/* End PBXGroup section */
|
|
38
|
+
|
|
39
|
+
/* Begin PBXNativeTarget section */
|
|
40
|
+
2224906F23E3E53500258582 /* RNYotiDocScan */ = {
|
|
41
|
+
isa = PBXNativeTarget;
|
|
42
|
+
buildConfigurationList = 2224907923E3E53500258582 /* Build configuration list for PBXNativeTarget "RNYotiDocScan" */;
|
|
43
|
+
buildPhases = (
|
|
44
|
+
2224906C23E3E53500258582 /* Sources */,
|
|
45
|
+
);
|
|
46
|
+
buildRules = (
|
|
47
|
+
);
|
|
48
|
+
dependencies = (
|
|
49
|
+
);
|
|
50
|
+
name = RNYotiDocScan;
|
|
51
|
+
productName = rnyotidocscan;
|
|
52
|
+
productReference = 2224907023E3E53500258582 /* libRNYotiDocScan.a */;
|
|
53
|
+
productType = "com.apple.product-type.library.static";
|
|
54
|
+
};
|
|
55
|
+
/* End PBXNativeTarget section */
|
|
56
|
+
|
|
57
|
+
/* Begin PBXProject section */
|
|
58
|
+
2224906823E3E53500258582 /* Project object */ = {
|
|
59
|
+
isa = PBXProject;
|
|
60
|
+
attributes = {
|
|
61
|
+
BuildIndependentTargetsInParallel = YES;
|
|
62
|
+
LastUpgradeCheck = 1430;
|
|
63
|
+
ORGANIZATIONNAME = "Yoti Ltd";
|
|
64
|
+
TargetAttributes = {
|
|
65
|
+
2224906F23E3E53500258582 = {
|
|
66
|
+
CreatedOnToolsVersion = 11.2;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
buildConfigurationList = 2224906B23E3E53500258582 /* Build configuration list for PBXProject "RNYotiDocScan" */;
|
|
71
|
+
compatibilityVersion = "Xcode 9.3";
|
|
72
|
+
developmentRegion = en;
|
|
73
|
+
hasScannedForEncodings = 0;
|
|
74
|
+
knownRegions = (
|
|
75
|
+
en,
|
|
76
|
+
Base,
|
|
77
|
+
);
|
|
78
|
+
mainGroup = 2224906723E3E53500258582;
|
|
79
|
+
productRefGroup = 2224907123E3E53500258582 /* Products */;
|
|
80
|
+
projectDirPath = "";
|
|
81
|
+
projectRoot = "";
|
|
82
|
+
targets = (
|
|
83
|
+
2224906F23E3E53500258582 /* RNYotiDocScan */,
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
/* End PBXProject section */
|
|
87
|
+
|
|
88
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
89
|
+
2224906C23E3E53500258582 /* Sources */ = {
|
|
90
|
+
isa = PBXSourcesBuildPhase;
|
|
91
|
+
buildActionMask = 2147483647;
|
|
92
|
+
files = (
|
|
93
|
+
20C21B632A1E794C0065E753 /* RNYotiDocScan.m in Sources */,
|
|
94
|
+
);
|
|
95
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
96
|
+
};
|
|
97
|
+
/* End PBXSourcesBuildPhase section */
|
|
98
|
+
|
|
99
|
+
/* Begin XCBuildConfiguration section */
|
|
100
|
+
2224907723E3E53500258582 /* Debug */ = {
|
|
101
|
+
isa = XCBuildConfiguration;
|
|
102
|
+
buildSettings = {
|
|
103
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
104
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
105
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
106
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
107
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
108
|
+
CLANG_ENABLE_MODULES = YES;
|
|
109
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
110
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
111
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
112
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
113
|
+
CLANG_WARN_COMMA = YES;
|
|
114
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
115
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
116
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
117
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
118
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
119
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
120
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
121
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
122
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
123
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
124
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
125
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
126
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
127
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
128
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
129
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
130
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
131
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
132
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
133
|
+
COPY_PHASE_STRIP = NO;
|
|
134
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
135
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
136
|
+
ENABLE_TESTABILITY = YES;
|
|
137
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
138
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
139
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
140
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
141
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
142
|
+
"DEBUG=1",
|
|
143
|
+
"$(inherited)",
|
|
144
|
+
);
|
|
145
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
146
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
147
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
148
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
149
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
150
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
151
|
+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
|
152
|
+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
|
153
|
+
MTL_FAST_MATH = YES;
|
|
154
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
155
|
+
SDKROOT = iphoneos;
|
|
156
|
+
};
|
|
157
|
+
name = Debug;
|
|
158
|
+
};
|
|
159
|
+
2224907823E3E53500258582 /* Release */ = {
|
|
160
|
+
isa = XCBuildConfiguration;
|
|
161
|
+
buildSettings = {
|
|
162
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
163
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
164
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
165
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
166
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
167
|
+
CLANG_ENABLE_MODULES = YES;
|
|
168
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
169
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
170
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
171
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
172
|
+
CLANG_WARN_COMMA = YES;
|
|
173
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
174
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
175
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
176
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
177
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
178
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
179
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
180
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
181
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
182
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
183
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
184
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
185
|
+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
|
186
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
187
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
188
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
189
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
190
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
191
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
192
|
+
COPY_PHASE_STRIP = NO;
|
|
193
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
194
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
195
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
196
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
197
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
198
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
199
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
200
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
201
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
202
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
203
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
204
|
+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
|
205
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
206
|
+
MTL_FAST_MATH = YES;
|
|
207
|
+
SDKROOT = iphoneos;
|
|
208
|
+
VALIDATE_PRODUCT = YES;
|
|
209
|
+
};
|
|
210
|
+
name = Release;
|
|
211
|
+
};
|
|
212
|
+
2224907A23E3E53500258582 /* Debug */ = {
|
|
213
|
+
isa = XCBuildConfiguration;
|
|
214
|
+
buildSettings = {
|
|
215
|
+
CODE_SIGN_STYLE = Automatic;
|
|
216
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
217
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
218
|
+
SKIP_INSTALL = YES;
|
|
219
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
220
|
+
};
|
|
221
|
+
name = Debug;
|
|
222
|
+
};
|
|
223
|
+
2224907B23E3E53500258582 /* Release */ = {
|
|
224
|
+
isa = XCBuildConfiguration;
|
|
225
|
+
buildSettings = {
|
|
226
|
+
CODE_SIGN_STYLE = Automatic;
|
|
227
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
228
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
229
|
+
SKIP_INSTALL = YES;
|
|
230
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
231
|
+
};
|
|
232
|
+
name = Release;
|
|
233
|
+
};
|
|
234
|
+
/* End XCBuildConfiguration section */
|
|
235
|
+
|
|
236
|
+
/* Begin XCConfigurationList section */
|
|
237
|
+
2224906B23E3E53500258582 /* Build configuration list for PBXProject "RNYotiDocScan" */ = {
|
|
238
|
+
isa = XCConfigurationList;
|
|
239
|
+
buildConfigurations = (
|
|
240
|
+
2224907723E3E53500258582 /* Debug */,
|
|
241
|
+
2224907823E3E53500258582 /* Release */,
|
|
242
|
+
);
|
|
243
|
+
defaultConfigurationIsVisible = 0;
|
|
244
|
+
defaultConfigurationName = Release;
|
|
245
|
+
};
|
|
246
|
+
2224907923E3E53500258582 /* Build configuration list for PBXNativeTarget "RNYotiDocScan" */ = {
|
|
247
|
+
isa = XCConfigurationList;
|
|
248
|
+
buildConfigurations = (
|
|
249
|
+
2224907A23E3E53500258582 /* Debug */,
|
|
250
|
+
2224907B23E3E53500258582 /* Release */,
|
|
251
|
+
);
|
|
252
|
+
defaultConfigurationIsVisible = 0;
|
|
253
|
+
defaultConfigurationName = Release;
|
|
254
|
+
};
|
|
255
|
+
/* End XCConfigurationList section */
|
|
256
|
+
};
|
|
257
|
+
rootObject = 2224906823E3E53500258582 /* Project object */;
|
|
258
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1430"
|
|
4
|
+
version = "1.3">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "2224906F23E3E53500258582"
|
|
18
|
+
BuildableName = "libRNYotiDocScan.a"
|
|
19
|
+
BlueprintName = "RNYotiDocScan"
|
|
20
|
+
ReferencedContainer = "container:RNYotiDocScan.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
+
<Testables>
|
|
31
|
+
</Testables>
|
|
32
|
+
</TestAction>
|
|
33
|
+
<LaunchAction
|
|
34
|
+
buildConfiguration = "Debug"
|
|
35
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
+
launchStyle = "0"
|
|
38
|
+
useCustomWorkingDirectory = "NO"
|
|
39
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
+
debugDocumentVersioning = "YES"
|
|
41
|
+
debugServiceExtension = "internal"
|
|
42
|
+
allowLocationSimulation = "YES">
|
|
43
|
+
</LaunchAction>
|
|
44
|
+
<ProfileAction
|
|
45
|
+
buildConfiguration = "Release"
|
|
46
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
+
savedToolIdentifier = ""
|
|
48
|
+
useCustomWorkingDirectory = "NO"
|
|
49
|
+
debugDocumentVersioning = "YES">
|
|
50
|
+
<MacroExpansion>
|
|
51
|
+
<BuildableReference
|
|
52
|
+
BuildableIdentifier = "primary"
|
|
53
|
+
BlueprintIdentifier = "2224906F23E3E53500258582"
|
|
54
|
+
BuildableName = "libRNYotiDocScan.a"
|
|
55
|
+
BlueprintName = "RNYotiDocScan"
|
|
56
|
+
ReferencedContainer = "container:RNYotiDocScan.xcodeproj">
|
|
57
|
+
</BuildableReference>
|
|
58
|
+
</MacroExpansion>
|
|
59
|
+
</ProfileAction>
|
|
60
|
+
<AnalyzeAction
|
|
61
|
+
buildConfiguration = "Debug">
|
|
62
|
+
</AnalyzeAction>
|
|
63
|
+
<ArchiveAction
|
|
64
|
+
buildConfiguration = "Release"
|
|
65
|
+
revealArchiveInOrganizer = "YES">
|
|
66
|
+
</ArchiveAction>
|
|
67
|
+
</Scheme>
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@getyoti/yoti-doc-scan-react-native",
|
|
3
|
+
"description": "A react native SDK for Yoti's identity verification services",
|
|
4
|
+
"homepage": "https://github.com/getyoti/yoti-doc-scan-react-native",
|
|
5
|
+
"license": "https://www.yoti.com/terms/identity-verification",
|
|
6
|
+
"author": "Yoti Ltd",
|
|
7
|
+
"main": "RNYotiDocScan.js",
|
|
8
|
+
"version": "2.0.0",
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"react": "^17.0.2",
|
|
11
|
+
"react-dom": "^17.0.2",
|
|
12
|
+
"react-hot-loader": "^4.12.20",
|
|
13
|
+
"react-native": "^0.68.5"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"keymirror": "^0.1.1",
|
|
17
|
+
"prop-types": "^15.7.2"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git@github.com:getyoti/yoti-doc-scan-react-native.git"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"RNYotiDocScan.js",
|
|
25
|
+
"android",
|
|
26
|
+
"ios",
|
|
27
|
+
"yoti-doc-scan-react-native.podspec"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |spec|
|
|
6
|
+
spec.name = "yoti-doc-scan-react-native"
|
|
7
|
+
spec.summary = package["description"]
|
|
8
|
+
spec.homepage = package["homepage"]
|
|
9
|
+
spec.license = package["license"]
|
|
10
|
+
spec.author = package["author"]
|
|
11
|
+
spec.version = package["version"]
|
|
12
|
+
spec.pod_target_xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/**" }
|
|
13
|
+
spec.source = { :git => "https://github.com/getyoti/yoti-doc-scan-react-native.git", :tag => "#{spec.version}" }
|
|
14
|
+
spec.source_files = "ios/**/*.{h,m}"
|
|
15
|
+
spec.platform = :ios, "11.0"
|
|
16
|
+
spec.dependency "React"
|
|
17
|
+
spec.dependency "YotiSDKNetwork"
|
|
18
|
+
spec.dependency "YotiSDKCommon"
|
|
19
|
+
spec.dependency "YotiSDKCore"
|
|
20
|
+
end
|