facia-mobilesdk 0.0.6 → 0.0.8

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.
@@ -1,30 +1,21 @@
1
1
  package com.facia.plugins.reactnative;
2
2
 
3
- import androidx.annotation.Nullable;
4
-
5
3
  import com.facebook.react.bridge.*;
6
4
  import com.facebook.react.modules.core.*;
7
5
 
8
6
 
9
7
 
10
8
  import org.jetbrains.annotations.*;
11
- import android.os.Bundle;
9
+
12
10
  import android.util.Log;
13
11
 
14
- import com.facia.faciasdk.Activity.Helpers.Enums.FaceDetectionThreshold;
15
- import com.facia.faciasdk.Activity.Helpers.Enums.FaceLivenessType;
16
- import com.facia.faciasdk.Activity.Helpers.Enums.OvalSize;
12
+ import com.facia.faciasdk.Activity.Helpers.Enums.DocumentType;
17
13
  import com.facia.faciasdk.FaciaAi;
18
14
 
19
- import org.json.JSONException;
20
15
  import org.json.JSONObject;
21
16
 
22
- import java.util.HashMap;
23
-
24
17
  import androidx.annotation.NonNull;
25
18
 
26
- import org.json.JSONObject;
27
-
28
19
  public class FaciaReactNativeModule extends ReactContextBaseJavaModule {
29
20
 
30
21
  private final ReactApplicationContext reactContext;
@@ -32,6 +23,7 @@ public class FaciaReactNativeModule extends ReactContextBaseJavaModule {
32
23
 
33
24
  private final static String LOG_TAG = "FaciaModule";
34
25
 
26
+
35
27
  public FaciaReactNativeModule(@NonNull ReactApplicationContext reactContext) {
36
28
  super(reactContext);
37
29
  this.reactContext = reactContext;
@@ -43,11 +35,23 @@ public class FaciaReactNativeModule extends ReactContextBaseJavaModule {
43
35
  }
44
36
 
45
37
  @ReactMethod
46
- public void verify(String configObject, Callback callback) {
38
+ public void verify(String docType,String configObject, Callback callback) {
47
39
  try {
48
40
 
41
+
49
42
  JSONObject configJson = new JSONObject(configObject);
50
43
 
44
+ if (docType.equalsIgnoreCase("ID_CARD"))
45
+ {
46
+ configJson.put("documentType", DocumentType.ID_CARD)
47
+ }else if (docType.equalsIgnoreCase("PASSPORT"))
48
+ {
49
+ configJson.put("documentType", DocumentType.PASSPORT)
50
+ }else
51
+ {
52
+ configJson.put("documentType", DocumentType.OTHERS)
53
+ }
54
+
51
55
  FaciaAi faciaAi = new FaciaAi();
52
56
 
53
57
  faciaAi.createRequest(getCurrentActivity(), configJson, responseSet -> {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "facia-mobilesdk",
3
3
  "title": "React Native Mobilesdk Module",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "description": "Facia mobile SDK",
6
6
  "main": "index.js",
7
7
  "files": [