@socure-inc/docv-react-native 3.1.0 → 3.1.2
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/.whitesource
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scanSettings": {
|
|
3
|
+
"configMode": "AUTO",
|
|
4
|
+
"configExternalURL": "",
|
|
5
|
+
"projectToken": "",
|
|
6
|
+
"baseBranches": []
|
|
7
|
+
},
|
|
8
|
+
"commitStatusSettings": {
|
|
9
|
+
"vulnerableCommitStatus": "FAILED",
|
|
10
|
+
"displayMode": "diff",
|
|
11
|
+
"useMendStatusNames": true
|
|
12
|
+
},
|
|
13
|
+
"issueSettings": {
|
|
14
|
+
"minSeverityLevel": "LOW",
|
|
15
|
+
"openConfidentialIssues": true,
|
|
16
|
+
"issueType": "DEPENDENCY"
|
|
17
|
+
},
|
|
18
|
+
"remediateSettings": {
|
|
19
|
+
"workflowRules": {
|
|
20
|
+
"enabled": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
package/android/build.gradle
CHANGED
|
@@ -134,7 +134,7 @@ dependencies {
|
|
|
134
134
|
//noinspection GradleDynamicVersion
|
|
135
135
|
implementation "com.facebook.react:react-native:+"
|
|
136
136
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
137
|
-
implementation "com.github.socure-inc:socure-docv:3.1.
|
|
137
|
+
implementation "com.github.socure-inc:socure-docv:3.1.1"
|
|
138
138
|
// From node_modules
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -2,6 +2,7 @@ package com.socure.docv.reactnative
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Intent
|
|
5
|
+
import android.util.Log
|
|
5
6
|
import android.util.Base64
|
|
6
7
|
import com.facebook.react.bridge.*
|
|
7
8
|
import com.socure.docv.capturesdk.api.Platform.REACT_NATIVE
|
|
@@ -17,13 +18,12 @@ import org.json.JSONObject
|
|
|
17
18
|
class SocureDocVReactNativeModule(reactContext: ReactApplicationContext) :
|
|
18
19
|
ReactContextBaseJavaModule(reactContext), ActivityEventListener {
|
|
19
20
|
|
|
21
|
+
private val TAG = "SDLT_RN"
|
|
22
|
+
|
|
23
|
+
private val SOCURE_SDK_REQUEST_CODE = 753
|
|
20
24
|
private var onSuccessCallback: Callback? = null
|
|
21
25
|
private var onErrorCallback: Callback? = null
|
|
22
26
|
|
|
23
|
-
init {
|
|
24
|
-
reactApplicationContext.addActivityEventListener(this)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
27
|
override fun getName(): String {
|
|
28
28
|
return "SocureDocVReactNative"
|
|
29
29
|
}
|
|
@@ -37,10 +37,15 @@ class SocureDocVReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
37
37
|
) {
|
|
38
38
|
this.onSuccessCallback = onSuccess
|
|
39
39
|
this.onErrorCallback = onError
|
|
40
|
+
|
|
41
|
+
Log.d(TAG, "launchSocureDocV - registering activity event listener")
|
|
42
|
+
|
|
43
|
+
reactApplicationContext.addActivityEventListener(this)
|
|
44
|
+
|
|
40
45
|
setSource(REACT_NATIVE)
|
|
41
46
|
currentActivity?.startActivityForResult(
|
|
42
47
|
getIntent(currentActivity!!, socureApiKey, flow),
|
|
43
|
-
|
|
48
|
+
SOCURE_SDK_REQUEST_CODE
|
|
44
49
|
)
|
|
45
50
|
}
|
|
46
51
|
|
|
@@ -50,16 +55,24 @@ class SocureDocVReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
50
55
|
resultCode: Int,
|
|
51
56
|
data: Intent?
|
|
52
57
|
) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
if (requestCode == SOCURE_SDK_REQUEST_CODE) {
|
|
59
|
+
Log.d(TAG, "onActivityResult - requestCode matched, removing activity event listener")
|
|
60
|
+
|
|
61
|
+
data?.let {
|
|
62
|
+
getResult(data, object : ResultListener {
|
|
63
|
+
override fun onSuccess(scannedData: ScannedData) {
|
|
64
|
+
onSuccessCallback?.invoke(convertResultToReadbleMap(scannedData))
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
override fun onError(scanError: ScanError) {
|
|
68
|
+
onErrorCallback?.invoke(convertErrorToReadableMap(scanError))
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
}
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
73
|
+
reactApplicationContext.removeActivityEventListener(this)
|
|
74
|
+
} else {
|
|
75
|
+
Log.d(TAG, "onActivityResult - requestCode does not match: $requestCode, not removing activity event listener")
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
78
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socure-inc/docv-react-native",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "The Predictive Document Verification (DocV) SDK React Native bridge allows you to use the DocV SDK v3 for Android and iOS in your React Native application.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|