@identomat-inc/react-native-identomat 1.0.23 → 1.0.25
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 +149 -2
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactlibrary/BridgeModule.java +37 -11
- package/index.js +14 -0
- package/ios/Identomat.m +2 -0
- package/ios/Identomat.swift +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
...
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
29
28
|
## Usage
|
|
30
29
|
```javascript
|
|
31
30
|
import identomat from '@identomat-inc/react-native-identomat';
|
|
@@ -36,6 +35,154 @@
|
|
|
36
35
|
}
|
|
37
36
|
identomat.setCallback(new Callback())
|
|
38
37
|
identomat.setBaseUrl(config.baseUrl);
|
|
39
|
-
identomat.
|
|
38
|
+
identomat.setColors(config.colors);
|
|
39
|
+
identomat.setStrings(config.strings);
|
|
40
|
+
identomat.start(config.sessionKey);
|
|
41
|
+
|
|
40
42
|
|
|
41
43
|
```
|
|
44
|
+
## config
|
|
45
|
+
```javascript
|
|
46
|
+
module.exports = {
|
|
47
|
+
sessionKey : '',
|
|
48
|
+
baseUrl : 'https://widget.identomat.com/api/',
|
|
49
|
+
colors: {
|
|
50
|
+
"background_low":"#222222",
|
|
51
|
+
"background_high":"#2D2D2D",
|
|
52
|
+
"text_color_title":"#A4A4A4",
|
|
53
|
+
"text_color_header":"#A4A4A4",
|
|
54
|
+
"text_color":"#676767",
|
|
55
|
+
"primary_button":"#7848FF",
|
|
56
|
+
"primary_button_text":"#FFFFFF",
|
|
57
|
+
"secondary_button":"#222222",
|
|
58
|
+
"secondary_button_text":"#FFFFFF",
|
|
59
|
+
"document_outer":"#2D2D2D",
|
|
60
|
+
"loading_indicator_background":"#FFFFFF",
|
|
61
|
+
"iteration_text":"#FFFFFF",
|
|
62
|
+
},
|
|
63
|
+
strings:{
|
|
64
|
+
"en":{
|
|
65
|
+
"identomat_agree": "Agree",
|
|
66
|
+
"identomat_title": " ",
|
|
67
|
+
"identomat_agree_page_title": "Consent for personal data processing",
|
|
68
|
+
"identomat_capture_method_title": "Choose a method",
|
|
69
|
+
"identomat_card_front_instructions": "Scan FRONT SIDE of ID CARD",
|
|
70
|
+
"identomat_card_front_upload": "Upload FRONT SIDE of ID CARD",
|
|
71
|
+
"identomat_card_looks_fine": "Card looks fine",
|
|
72
|
+
"identomat_card_rear_instructions": "Scan BACK SIDE of ID CARD",
|
|
73
|
+
"identomat_card_rear_upload": "Upload BACK SIDE of ID CARD",
|
|
74
|
+
"identomat_choose_file": "Choose a file",
|
|
75
|
+
"identomat_continue": "Continue",
|
|
76
|
+
"identomat_disagree": "Disagree",
|
|
77
|
+
"identomat_driver_license": "Driver license",
|
|
78
|
+
"identomat_driver_license_front_instructions": "Scan FRONT SIDE of DRIVER LICENSE",
|
|
79
|
+
"identomat_driver_license_front_upload": "Upload FRONT SIDE of DRIVER LICENSE",
|
|
80
|
+
"identomat_driver_license_rear_instructions": "Scan BACK SIDE of DRIVER LICENSE",
|
|
81
|
+
"identomat_driver_license_rear_upload": "Upload BACK SIDE of DRIVER LICENSE",
|
|
82
|
+
"identomat_ukr_driver_license": "Ukrainian Driver license",
|
|
83
|
+
"identomat_ukr_driver_license_front_instructions": "Scan FRONT SIDE of DRIVER LICENSE",
|
|
84
|
+
"identomat_ukr_driver_license_front_upload": "Upload FRONT SIDE of DRIVER LICENSE",
|
|
85
|
+
"identomat_ukr_driver_license_rear_instructions": "Scan BACK SIDE of DRIVER LICENSE",
|
|
86
|
+
"identomat_ukr_driver_license_rear_upload": "Upload BACK SIDE of DRIVER LICENSE",
|
|
87
|
+
"identomat_face_instructions": "Place your FACE within OVAL",
|
|
88
|
+
"identomat_face_looks_fine": "Face looks fine",
|
|
89
|
+
"identomat_card": "ID card",
|
|
90
|
+
"identomat_im_ready": "I'm ready",
|
|
91
|
+
"identomat_initializing": "Initializing...",
|
|
92
|
+
"identomat_lets_try": "Let's try",
|
|
93
|
+
"identomat_passport": "Passport",
|
|
94
|
+
"identomat_passport_instructions": "Passport photo page",
|
|
95
|
+
"identomat_passport_upload": "Upload passport photo page",
|
|
96
|
+
"identomat_ukr_passport": "Ukrainian passport",
|
|
97
|
+
"identomat_record_begin_section_1": "Take a neutral expression",
|
|
98
|
+
"identomat_record_begin_section_2": "Smile on this sign",
|
|
99
|
+
"identomat_record_begin_section_3": "Take a neutral expression again",
|
|
100
|
+
"identomat_record_begin_title": "Get ready for your video selfie",
|
|
101
|
+
"identomat_record_fail_description": "But first, please take a look at the instructions",
|
|
102
|
+
"identomat_record_fail_title": "Let's try again",
|
|
103
|
+
"identomat_record_instructions": "Place your FACE within OVAL and follow the on-screen instructions",
|
|
104
|
+
"identomat_residence_permit": "Residence permit",
|
|
105
|
+
"identomat_residence_permit_front_instructions": "Scan FRONT SIDE of RESIDENCE PERMIT",
|
|
106
|
+
"identomat_residence_permit_front_upload": "Upload FRONT SIDE of RESIDENCE PERMIT",
|
|
107
|
+
"identomat_residence_permit_rear_instructions": "Scan BACK SIDE of RESIDENCE PERMIT",
|
|
108
|
+
"identomat_residence_permit_rear_upload": "Upload BACK SIDE of RESIDENCE PERMIT",
|
|
109
|
+
"identomat_inn": "Inn photo page",
|
|
110
|
+
"identomat_scan_inn": "Scan INN Document",
|
|
111
|
+
"identomat_retake_photo": "Retake photo",
|
|
112
|
+
"identomat_retry": "Retry",
|
|
113
|
+
"identomat_scan_code": "Scan the code",
|
|
114
|
+
"identomat_scan_me": "Scan me",
|
|
115
|
+
"identomat_select_document": "Select document",
|
|
116
|
+
"identomat_neutral_expression": "Neutral face",
|
|
117
|
+
"identomat_smile": "Smile",
|
|
118
|
+
"identomat_take_photo": "Take a photo",
|
|
119
|
+
"identomat_upload_another_file": "Upload another file",
|
|
120
|
+
"identomat_upload_file": "Upload a file",
|
|
121
|
+
"identomat_uploading": "Uploading...",
|
|
122
|
+
"identomat_verifying": "Verifying...",
|
|
123
|
+
"identomat_upload_instructions_1": "Upload a color image of the entire document",
|
|
124
|
+
"identomat_upload_instructions_2": "JPG or PNG format only",
|
|
125
|
+
"identomat_upload_instructions_3": "Screenshots are not allowed",
|
|
126
|
+
"identomat_document_align": "Frame your document",
|
|
127
|
+
"identomat_document_blurry": "Document is blurry",
|
|
128
|
+
"identomat_document_face_blurry": "Face on document is blurry",
|
|
129
|
+
"identomat_document_face_require_brighter": "Low light",
|
|
130
|
+
"identomat_document_face_too_bright": "Avoid direct light",
|
|
131
|
+
"identomat_document_move_away": "Please move document away",
|
|
132
|
+
"identomat_document_move_closer": "Please move document closer",
|
|
133
|
+
"identomat_document_move_down": "Please move document down",
|
|
134
|
+
"identomat_document_move_left": "Please move document to the left",
|
|
135
|
+
"identomat_document_move_right": "Please move document to the right",
|
|
136
|
+
"identomat_document_move_up": "Please move document up",
|
|
137
|
+
"identomat_document_type_unknown": "Unknown document type",
|
|
138
|
+
"identomat_document_covered": "Document is covered",
|
|
139
|
+
"identomat_document_grayscale": "Document is grayscale",
|
|
140
|
+
"identomat_document_format_mismatch": "Document format mismatch",
|
|
141
|
+
"identomat_document_type_mismatch": "Wrong document",
|
|
142
|
+
"identomat_document_not_readable": "Document not readable",
|
|
143
|
+
"identomat_document_face_align": "Document face align",
|
|
144
|
+
"identomat_document_spoofing_detected2": "Document spoofing detected",
|
|
145
|
+
"identomat_document_page_mismatch": "Wrong page",
|
|
146
|
+
"identomat_face_look_straight": "Look straight",
|
|
147
|
+
"identomat_face_mismatch": "Faces do not match",
|
|
148
|
+
"identomat_face_align": "Frame your face",
|
|
149
|
+
"identomat_face_away_from_center": "Center your Face",
|
|
150
|
+
"identomat_face_blurry": "Face is blurry",
|
|
151
|
+
"identomat_face_far_away": "Move closer",
|
|
152
|
+
"identomat_face_require_brighter": "Low light",
|
|
153
|
+
"identomat_face_too_bright": "Avoid direct light",
|
|
154
|
+
"identomat_face_too_close": "Move away",
|
|
155
|
+
"identomat_no_document_in_image": "Frame your document",
|
|
156
|
+
"identomat_smile_detected": "Get neutral face",
|
|
157
|
+
"identomat_upload_success": "Successfully uploaded!",
|
|
158
|
+
"identomat_scan_success": "Success!",
|
|
159
|
+
"identomat_scan_success_info": "Document scanned successfully, Change it to the other side.",
|
|
160
|
+
"identomat_liveness_success": "Liveness completed successfully",
|
|
161
|
+
"identomat_camera_permission_title": "Can't access the camera",
|
|
162
|
+
"identomat_camera_permission_text": "Permission on the camera is restricted, without the camera, the app can't progress forward, please go to settings and check camera permission.",
|
|
163
|
+
"identomat_audio_permission_title": "Can't access the microphone",
|
|
164
|
+
"identomat_audio_permission_text": "Permission on the microphone is restricted, without the microphone, a call can't be made, please go to settings and check audio permission.",
|
|
165
|
+
"identomat_no_connection": "No internet connection",
|
|
166
|
+
"identomat_scan_retry_title": "Capture failed",
|
|
167
|
+
"identomat_scan_retry_instruction": "Please try again in better lighting",
|
|
168
|
+
"identomat_scan_retry_again": "Try again",
|
|
169
|
+
"identomat_scan_retry_cancel": "Cancel process",
|
|
170
|
+
"identomat_liveness_retry_title": "Let's try again",
|
|
171
|
+
"identomat_liveness_retry_instruction": "But first, please take a look at the instructions",
|
|
172
|
+
"identomat_liveness_retry_again": "Try again",
|
|
173
|
+
"identomat_liveness_retry_instruction_1": "Place your FACE within OVAL",
|
|
174
|
+
"identomat_liveness_retry_instruction_2": "Place your FACE within OVAL and follow the on-screen instructions",
|
|
175
|
+
"identomat_camera_deny_title": "Camera access denied",
|
|
176
|
+
"identomat_camera_deny_settings": "Allow access",
|
|
177
|
+
"identomat_camera_deny_cancel": "Cancel process",
|
|
178
|
+
"identomat_cascading_instructions": "Ready for the task? \n\n When prompted, repeat \n the facial expression shown on the icons: \n\n<b> • Keep neutral face \n • Smile</b> \n\n good luck!",
|
|
179
|
+
"identomat_cascading_button": "Start Liveness Check",
|
|
180
|
+
"identomat_cascading_neutral_face": "Keep neutral face",
|
|
181
|
+
"identomat_cascading_start": "Get ready for the liveness check!",
|
|
182
|
+
"identomat_cascading_smile": "Smile!",
|
|
183
|
+
"identomat_cascading_fail": "Liveness Failed",
|
|
184
|
+
"identomat_cascading_success": "That's it!"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
package/android/build.gradle
CHANGED
|
@@ -43,6 +43,6 @@ dependencies {
|
|
|
43
43
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
44
44
|
// implementation 'com.android.support:recyclerview-v7:28.0.0'
|
|
45
45
|
implementation 'com.android.support:design:28.0.0'
|
|
46
|
-
implementation 'com.identomat:identomat-sdk:1.1.
|
|
46
|
+
implementation 'com.identomat:identomat-sdk:1.1.61'
|
|
47
47
|
implementation 'androidx.fragment:fragment:1.1.0-alpha05'
|
|
48
48
|
}
|
|
@@ -33,7 +33,6 @@ import java.util.Iterator;
|
|
|
33
33
|
|
|
34
34
|
public class BridgeModule extends ReactContextBaseJavaModule {
|
|
35
35
|
private static ReactApplicationContext reactContext;
|
|
36
|
-
JSONObject identomatConfig = null;
|
|
37
36
|
static IdentomatKotlinObjectBridge identomatSDK = new IdentomatKotlinObjectBridge();
|
|
38
37
|
String mLanguage=null;
|
|
39
38
|
BridgeModule(ReactApplicationContext context){
|
|
@@ -54,7 +53,6 @@ public class BridgeModule extends ReactContextBaseJavaModule {
|
|
|
54
53
|
identomatSDK.setCallback(new IdentomatBridgeCallback(){
|
|
55
54
|
@Override
|
|
56
55
|
public void invoke(){
|
|
57
|
-
System.out.println("---------------------");
|
|
58
56
|
catalystInstance.callFunction("JavaScriptVisibleToJava", "callback",params);
|
|
59
57
|
}
|
|
60
58
|
});
|
|
@@ -62,6 +60,43 @@ public class BridgeModule extends ReactContextBaseJavaModule {
|
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
|
|
63
|
+
@ReactMethod
|
|
64
|
+
public void setColors(String colorsString){
|
|
65
|
+
try {
|
|
66
|
+
JSONObject colorsObj=new JSONObject(colorsString);
|
|
67
|
+
Iterator<String> keys = colorsObj.keys();
|
|
68
|
+
HashMap<String, String> colors = new HashMap<String, String>();
|
|
69
|
+
while(keys.hasNext()) {
|
|
70
|
+
String key = keys.next();
|
|
71
|
+
colors.put(key, colorsObj.getString(key));
|
|
72
|
+
}
|
|
73
|
+
identomatSDK.setColors(colors);
|
|
74
|
+
} catch (JSONException e) {
|
|
75
|
+
e.printStackTrace();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@ReactMethod
|
|
79
|
+
public void setStrings(String strings){
|
|
80
|
+
try {
|
|
81
|
+
JSONObject allStringsObj=new JSONObject(strings);
|
|
82
|
+
Iterator<String> languageKeys = allStringsObj.keys();
|
|
83
|
+
HashMap<String, HashMap> fullStringsMap = new HashMap<String, HashMap>();
|
|
84
|
+
while(languageKeys.hasNext()) {
|
|
85
|
+
String languageKey = languageKeys.next();
|
|
86
|
+
JSONObject stringsObj=allStringsObj.getJSONObject(languageKey);
|
|
87
|
+
Iterator<String> keys = stringsObj.keys();
|
|
88
|
+
HashMap<String, String> stringsMap = new HashMap<String, String>();
|
|
89
|
+
while(keys.hasNext()) {
|
|
90
|
+
String key = keys.next();
|
|
91
|
+
stringsMap.put(key, stringsObj.getString(key));
|
|
92
|
+
}
|
|
93
|
+
fullStringsMap.put(languageKey, stringsMap);
|
|
94
|
+
}
|
|
95
|
+
identomatSDK.strings(fullStringsMap);
|
|
96
|
+
} catch (JSONException e) {
|
|
97
|
+
e.printStackTrace();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
65
100
|
|
|
66
101
|
|
|
67
102
|
@ReactMethod
|
|
@@ -71,15 +106,6 @@ public class BridgeModule extends ReactContextBaseJavaModule {
|
|
|
71
106
|
@ReactMethod
|
|
72
107
|
public void start(String mSessionKey){
|
|
73
108
|
callback();
|
|
74
|
-
// IdentomatBroadcastReceiver mReceiver = new IdentomatBroadcastReceiver();
|
|
75
|
-
// IntentFilter filter = new IntentFilter("com.identomat.Broadcast");
|
|
76
|
-
// reactContext.registerReceiver(mReceiver, filter);
|
|
77
|
-
// try {
|
|
78
|
-
// identomatConfig=new JSONObject(identomatConfigString);
|
|
79
|
-
|
|
80
|
-
// } catch (JSONException e) {
|
|
81
|
-
// e.printStackTrace();
|
|
82
|
-
// }
|
|
83
109
|
identomatSDK.setUp(mSessionKey);
|
|
84
110
|
reactContext.startActivity(identomatSDK.getIdentomatActivity(reactContext));
|
|
85
111
|
}
|
package/index.js
CHANGED
|
@@ -15,6 +15,20 @@ class Identomat {
|
|
|
15
15
|
NativeModules.Identomat.setBaseUrl(baseUrl);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
async setColors(colors) {
|
|
19
|
+
if(Platform.OS == "android"){
|
|
20
|
+
NativeModules.BridgeModule.setColors(JSON.stringify(colors));
|
|
21
|
+
}else if(Platform.OS == "ios"){
|
|
22
|
+
NativeModules.Identomat.setColors(JSON.stringify(colors));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async setStrings(strings) {
|
|
26
|
+
if(Platform.OS == "android"){
|
|
27
|
+
NativeModules.BridgeModule.setStrings(JSON.stringify(strings));
|
|
28
|
+
}else if(Platform.OS == "ios"){
|
|
29
|
+
NativeModules.Identomat.setStrings(JSON.stringify(strings));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
18
32
|
async start(sessionKey) {
|
|
19
33
|
if(Platform.OS == "android"){
|
|
20
34
|
NativeModules.BridgeModule.start(sessionKey);
|
package/ios/Identomat.m
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
@interface RCT_EXTERN_MODULE(Identomat, NSObject)
|
|
22
22
|
RCT_EXTERN_METHOD(start: (NSString *)sessionId)
|
|
23
23
|
RCT_EXTERN_METHOD(setBaseUrl: (NSString *)baseUrl)
|
|
24
|
+
RCT_EXTERN_METHOD(setColors: (NSString *)colors)
|
|
25
|
+
RCT_EXTERN_METHOD(setStrings: (NSString *)strings)
|
|
24
26
|
RCT_EXTERN_METHOD(callback: (RCTResponseSenderBlock *)successCallback)
|
|
25
27
|
@end
|
|
26
28
|
|
package/ios/Identomat.swift
CHANGED
|
@@ -42,10 +42,22 @@ class Identomat: NSObject, RCTBridgeModule{
|
|
|
42
42
|
IdentomatManager.getInstance().setBaseUrl(url: baseUrl)
|
|
43
43
|
}
|
|
44
44
|
@objc
|
|
45
|
+
func setColors(_ colors : String) -> Void {
|
|
46
|
+
let data: Data? = colors.data(using: .utf8)
|
|
47
|
+
let colorsObj = (try? JSONSerialization.jsonObject(with: data!, options: [])) as! [String:String]
|
|
48
|
+
IdentomatManager.getInstance().setColors(color: colorsObj)
|
|
49
|
+
}
|
|
50
|
+
@objc
|
|
51
|
+
func setStrings(_ strings : String) -> Void {
|
|
52
|
+
let data: Data? = strings.data(using: .utf8)
|
|
53
|
+
let stringsObj = (try? JSONSerialization.jsonObject(with: data!, options: [])) as! [String:Any]
|
|
54
|
+
IdentomatManager.getInstance().setStrings(dict: stringsObj)
|
|
55
|
+
// IdentomatManager.getInstance().setStrings(url: baseUrl)
|
|
56
|
+
}
|
|
57
|
+
@objc
|
|
45
58
|
func callback(_ successCallback: @escaping RCTResponseSenderBlock){
|
|
46
59
|
self.successCallback = successCallback;
|
|
47
60
|
IdentomatManager.getInstance().callBack {
|
|
48
|
-
print("process is done we are good")
|
|
49
61
|
self.successCallback!([NSNull(),"done"])
|
|
50
62
|
}
|
|
51
63
|
|