Skip to content

Commit 3ef0af9

Browse files
Update react-idcheckio plugin to version 7.0.1
1 parent 951b553 commit 3ef0af9

File tree

30 files changed

+14240
-402
lines changed

30 files changed

+14240
-402
lines changed

ReactIdcheckioClient/Dictionnary.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { CheckType, CISType, Codeline, ConfirmationType, DocumentType, Extraction, FaceDetection, FeedbackLevel, FileSize, IDCheckioOrientation, IDCheckioParamsBuilder, IntegrityCheck, Language, OnlineConfig, ScanBothSides } from "react-idcheckio"
1+
import { CISType, Codeline, ConfirmationType, DocumentType, Extraction, FaceDetection, FeedbackLevel, FileSize, IDCheckioOrientation, IDCheckioParamsBuilder, IntegrityCheck, Language, OnlineConfig, ScanBothSides } from "react-idcheckio"
22

3-
export const paramsID = new IDCheckioParamsBuilder()
3+
export const paramsIDOffline = new IDCheckioParamsBuilder()
44
.setDocType(DocumentType.ID)
55
.setOrientation(IDCheckioOrientation.PORTRAIT)
6-
.setIntegrityCheck(new IntegrityCheck(true))
76
.setUseHd(false)
87
.setConfirmationType(ConfirmationType.DATA_OR_PICTURE)
98
.setScanBothSides(ScanBothSides.ENABLED)
@@ -15,15 +14,17 @@ export const paramsID = new IDCheckioParamsBuilder()
1514
.setFeedbackLevel(FeedbackLevel.ALL)
1615
.setAdjustCrop(false)
1716
.setConfirmAbort(false)
18-
.setOnlineConfig(new OnlineConfig({ checkType: CheckType.CHECK_FAST, isReferenceDocument: true }))
1917
.build()
2018

21-
export const paramsIDAnalyze = new IDCheckioParamsBuilder()
19+
export const paramsIDOnline = new IDCheckioParamsBuilder()
2220
.setDocType(DocumentType.ID)
2321
.setOrientation(IDCheckioOrientation.PORTRAIT)
24-
.setUseHd(false)
25-
.setConfirmationType(ConfirmationType.DATA_OR_PICTURE)
26-
.setScanBothSides(ScanBothSides.ENABLED)
22+
.setIntegrityCheck(new IntegrityCheck({ readEmrtd: true, docLiveness: true }))
23+
.setOnlineConfig(new OnlineConfig({ isReferenceDocument: true }))
24+
.build()
25+
26+
export const paramsIDAnalyze = new IDCheckioParamsBuilder()
27+
.setDocType(DocumentType.ID)
2728
.setSideOneExtraction(new Extraction(Codeline.ANY, FaceDetection.ENABLED))
2829
.setSideTwoExtraction(new Extraction(Codeline.ANY, FaceDetection.ENABLED))
2930
.setMaxPictureFilesize(FileSize.TWO_MEGA_BYTES)
@@ -89,8 +90,8 @@ export class ParamsListItem {
8990
}
9091

9192
export const paramsList = [
92-
new ParamsListItem({name: "ID Offline", params: paramsID, isOnline: false}),
93-
new ParamsListItem({name: "ID Online", params: paramsID, isOnline: true}),
93+
new ParamsListItem({name: "ID Offline", params: paramsIDOffline, isOnline: false}),
94+
new ParamsListItem({name: "ID Online", params: paramsIDOnline, isOnline: true}),
9495
new ParamsListItem({name: "Liveness Online", params: paramsLiveness, isOnline: true}),
9596
new ParamsListItem({name: "French health card Online", params: paramsFrenchHealthCard, isOnline: true}),
9697
new ParamsListItem({name: "Selfie Online", params: paramsSelfie, isOnline: true}),

ReactIdcheckioClient/android/app/build.gradle

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,13 @@ android {
145145
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
146146
}
147147
}
148-
signingConfigs {
149-
debug {
150-
storeFile file("react-idcheckio.jks")
151-
storePassword "password"
152-
keyAlias "key0"
153-
keyPassword "password"
154-
}
155-
release {
156-
storeFile file("react-idcheckio.jks")
157-
storePassword "password"
158-
keyAlias "key0"
159-
keyPassword "password"
160-
}
161-
}
162-
163148
buildTypes {
164149
debug {
165150
signingConfig signingConfigs.debug
166151
}
167152
release {
153+
// Caution! In production, you need to generate your own keystore file.
154+
// see https://reactnative.dev/docs/signed-apk-android.
168155
signingConfig signingConfigs.debug
169156
minifyEnabled enableProguardInReleaseBuilds
170157
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
@@ -188,6 +175,10 @@ android {
188175
}
189176

190177
packagingOptions {
178+
pickFirst '**/armeabi-v7a/libfbjni.so'
179+
pickFirst '**/arm64-v8a/libfbjni.so'
180+
pickFirst '**/x86_64/libfbjni.so'
181+
pickFirst '**/x86/libfbjni.so'
191182
pickFirst '**/armeabi-v7a/libc++_shared.so'
192183
pickFirst '**/x86/libc++_shared.so'
193184
pickFirst '**/arm64-v8a/libc++_shared.so'

ReactIdcheckioClient/android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.reactidcheckioclient">
2+
package="com.ariadnext.idcheckio.react.client">
33

44
<uses-permission android:name="android.permission.INTERNET" />
55

@@ -15,7 +15,8 @@
1515
android:label="@string/app_name"
1616
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
1717
android:launchMode="singleTask"
18-
android:windowSoftInputMode="adjustResize">
18+
android:windowSoftInputMode="adjustResize"
19+
android:exported="true">
1920
<intent-filter>
2021
<action android:name="android.intent.action.MAIN" />
2122
<category android:name="android.intent.category.LAUNCHER" />

ReactIdcheckioClient/android/app/src/main/assets/.gitkeep

Whitespace-only changes.

ReactIdcheckioClient/android/app/src/main/java/com/reactidcheckioclient/MainActivity.java renamed to ReactIdcheckioClient/android/app/src/main/java/com/ariadnext/idcheckio/react/client/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactidcheckioclient;
1+
package com.ariadnext.idcheckio.react.client;
22

33
import com.facebook.react.ReactActivity;
44

ReactIdcheckioClient/android/app/src/main/java/com/reactidcheckioclient/MainApplication.java renamed to ReactIdcheckioClient/android/app/src/main/java/com/ariadnext/idcheckio/react/client/MainApplication.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
package com.reactidcheckioclient;
1+
package com.ariadnext.idcheckio.react.client;
22

33
import android.app.Application;
44
import android.content.Context;
5+
56
import com.facebook.react.PackageList;
67
import com.facebook.react.ReactApplication;
78
import com.facebook.react.ReactInstanceManager;
89
import com.facebook.react.ReactNativeHost;
910
import com.facebook.react.ReactPackage;
1011
import com.facebook.soloader.SoLoader;
12+
import com.ariadnext.idcheckio.react.client.BuildConfig;
13+
1114
import java.lang.reflect.InvocationTargetException;
1215
import java.util.List;
1316

ReactIdcheckioClient/android/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.3"
65
minSdkVersion = 21
7-
compileSdkVersion = 29
8-
targetSdkVersion = 29
6+
compileSdkVersion = 33
7+
targetSdkVersion = 33
98
ndkVersion = "20.1.5948944"
109
}
1110
repositories {

ReactIdcheckioClient/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
13+
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1414

1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit

ReactIdcheckioClient/index.js

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,39 @@ import {
1313
Text,
1414
View,
1515
Button,
16+
TextInput
1617
} from 'react-native';
1718
import { launchImageLibrary } from 'react-native-image-picker';
1819

20+
21+
const demoToken = "YOUR_ACTIVATION_TOKEN"
22+
1923
class Resultat extends Component {
2024

2125
constructor(props) {
2226
super(props);
2327
this.state = {
2428
sdkActivated: false,
2529
sdkResult: null,
30+
isIps: false,
31+
folderUid: "",
2632
selectedValue: 0
2733
};
2834
}
2935

3036
setSelectedValue(value){
3137
this.setState({
38+
isIps: value == 10,
3239
selectedValue: value
3340
})
3441
}
3542

43+
setFolderUid(value){
44+
this.setState({
45+
folderUid: value
46+
})
47+
}
48+
3649
response_server(results) {
3750
this.setState({
3851
sdkResult: results
@@ -61,7 +74,7 @@ class Resultat extends Component {
6174
this.response_server(results);
6275
},
6376
cause => {
64-
console.log(cause);
77+
this.showError(cause);
6578
})
6679
.catch(err => {
6780
console.log(err);
@@ -74,7 +87,7 @@ class Resultat extends Component {
7487
this.response_server(results);
7588
},
7689
cause => {
77-
console.log(cause);
90+
this.showError(cause);
7891
})
7992
.catch(err => {
8093
console.log(err);
@@ -83,14 +96,40 @@ class Resultat extends Component {
8396
}
8497
}
8598

99+
startIps() {
100+
IdcheckioModule.startIps(this.state.folderUid)
101+
.then(data => {
102+
console.log(data);
103+
let results = JSON.parse(data)
104+
this.response_server(results);
105+
console.log("Session IPS Ok !")
106+
},
107+
cause => {
108+
this.showError(cause);
109+
})
110+
.catch(err => {
111+
console.log(err);
112+
});
113+
}
114+
115+
showError(error) {
116+
console.log(error);
117+
var errorMsg = JSON.parse(error.message.replace("\n", "\\n"));
118+
console.log("cause: " + errorMsg.cause);
119+
console.log("details: " + errorMsg.details);
120+
console.log("message: " + errorMsg.message);
121+
console.log("subCause: " + errorMsg.subCause);
122+
alert(errorMsg.message);
123+
}
124+
86125
activate() {
87-
IdcheckioModule.activate("license", true, true, "DEMO")
126+
IdcheckioModule.activate(demoToken, true)
88127
.then(data => {
89128
this.setState({sdkActivated: true})
90129
console.log("Activated");
91130
},
92131
cause => {
93-
console.log(cause);
132+
this.showError(cause);
94133
})
95134
.catch(err => {
96135
console.log(err);
@@ -128,7 +167,7 @@ class Resultat extends Component {
128167
this.response_server(results);
129168
},
130169
cause => {
131-
console.log(cause);
170+
this.showError(cause);
132171
})
133172
.catch(err => {
134173
console.log(err);
@@ -160,13 +199,15 @@ class Resultat extends Component {
160199
<Picker.Item label={Dictionnary.paramsList[7].name} value='7'/>
161200
<Picker.Item label={Dictionnary.paramsList[8].name} value='8'/>
162201
<Picker.Item label={Dictionnary.paramsList[9].name} value='9'/>
202+
<Picker.Item label='Start Ips' value='10'/>
163203
</Picker>
164204
</View>
205+
<TextInput style={styles.input} display= {(this.state.isIps)? 'flex' : 'none'} onChangeText={(text) => this.setFolderUid(text)}/>
165206
<Button disabled = {this.state.sdkActivated} onPress = {() => {this.activate()}}
166207
title = {(this.state.sdkActivated)? "SDK already activated" : "Activate SDK"}
167208
/>
168-
<Button disabled = {!this.state.sdkActivated} onPress = {() => {this.capture()}}
169-
title = {(this.state.sdkActivated)? "Capture Document" : "SDK not activated"}
209+
<Button disabled = {!this.state.sdkActivated} onPress = {(this.state.isIps)? () => {this.startIps()} : () => {this.capture()}}
210+
title = {(this.state.sdkActivated)? ((this.state.isIps)? "Start ips session" : "Capture Document") : "SDK not activated"}
170211
/>
171212
<Text style = {styles.welcome}>
172213
{(this.state.sdkResult != null)?
@@ -208,6 +249,13 @@ const styles = StyleSheet.create({
208249
color: '#333333',
209250
marginBottom: 5,
210251
},
252+
input: {
253+
borderColor: "gray",
254+
width: "60%",
255+
borderWidth: 1,
256+
borderRadius: 10,
257+
padding: 10,
258+
},
211259
activationText: {
212260
fontSize: 24,
213261
marginBottom: 40

ReactIdcheckioClient/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ
33
source 'https://github.com/CocoaPods/Specs.git'
44
source 'https://git-externe.rennes.ariadnext.com/idcheckio/axt-podspecs.git'
55

6-
platform :ios, '10.0'
6+
platform :ios, '12.0'
77

88
target 'ReactIdcheckioClient' do
99
use_frameworks!

0 commit comments

Comments
 (0)