assentify-sdk-react-native 0.0.14 → 0.0.16
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 +6 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/assentifysdk/FaceMatchActivity.kt +22 -3
- package/assentify-sdk.podspec +1 -1
- package/ios/View/FaceMatchController.swift +33 -16
- package/ios/View/IDCardController.swift +4 -13
- package/ios/View/OtherController.swift +4 -13
- package/ios/View/PassportController.swift +5 -14
- package/package.json +1 -1
package/README.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -99,7 +99,7 @@ dependencies {
|
|
|
99
99
|
implementation "com.facebook.react:react-native:+"
|
|
100
100
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
101
101
|
|
|
102
|
-
implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:0.0.
|
|
102
|
+
implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:0.0.68'
|
|
103
103
|
|
|
104
104
|
/* Assentify Sdk Dependencies */
|
|
105
105
|
implementation 'com.google.code.gson:gson:2.8.9'
|
|
@@ -34,6 +34,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
34
34
|
import android.util.Log
|
|
35
35
|
import com.assentify.sdk.Core.Constants.BrightnessEvents
|
|
36
36
|
import com.assentify.sdk.Core.Constants.FaceEvents
|
|
37
|
+
import com.assentify.sdk.Core.Constants.ActiveLiveEvents
|
|
37
38
|
|
|
38
39
|
class FaceMatchActivity: AppCompatActivity(),
|
|
39
40
|
FaceMatchCallback {
|
|
@@ -54,7 +55,7 @@ private lateinit var assentifySdk: AssentifySdk
|
|
|
54
55
|
private lateinit var processingColor: String;
|
|
55
56
|
private var showCountDown: Boolean = true;
|
|
56
57
|
private var start: Boolean = false;
|
|
57
|
-
|
|
58
|
+
private var currentActiveLiveEvents: ActiveLiveEvents = ActiveLiveEvents.Good
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
@@ -254,7 +255,7 @@ private lateinit var assentifySdk: AssentifySdk
|
|
|
254
255
|
zoomType: ZoomType
|
|
255
256
|
) {
|
|
256
257
|
runOnUiThread {
|
|
257
|
-
if(start == false){
|
|
258
|
+
if(start == false && currentActiveLiveEvents == ActiveLiveEvents.Good){
|
|
258
259
|
infoLayout.visibility = View.VISIBLE
|
|
259
260
|
if (zoomType != ZoomType.SENDING && zoomType != ZoomType.NO_DETECT) {
|
|
260
261
|
if (zoomType == ZoomType.ZOOM_IN) {
|
|
@@ -316,11 +317,29 @@ private lateinit var assentifySdk: AssentifySdk
|
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
319
|
}else {
|
|
319
|
-
|
|
320
|
+
if(currentActiveLiveEvents == ActiveLiveEvents.Good){
|
|
321
|
+
infoLayout.visibility = View.GONE
|
|
322
|
+
}
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
override fun onCurrentLiveMoveChange(activeLiveEvents: ActiveLiveEvents) {
|
|
328
|
+
runOnUiThread {
|
|
329
|
+
currentActiveLiveEvents = activeLiveEvents;
|
|
330
|
+
if (activeLiveEvents != ActiveLiveEvents.Good) {
|
|
331
|
+
when (activeLiveEvents) {
|
|
332
|
+
ActiveLiveEvents.YawLeft -> infoText.setText("Please move your face left")
|
|
333
|
+
ActiveLiveEvents.YawRight -> infoText.setText("Please move your face right")
|
|
334
|
+
ActiveLiveEvents.PitchUp -> infoText.setText("Please move your face up")
|
|
335
|
+
ActiveLiveEvents.PitchDown -> infoText.setText("Please move your face down")
|
|
336
|
+
ActiveLiveEvents.Good -> infoText.setText("")
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
|
|
324
343
|
|
|
325
344
|
private fun triggerCompleteEvent(eventName:String, dataModel: FaceResponseModel?){
|
|
326
345
|
val eventResultMap = Arguments.createMap().apply {
|
package/assentify-sdk.podspec
CHANGED
|
@@ -20,6 +20,8 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
20
20
|
private var processingColor: String;
|
|
21
21
|
private var showCountDown: Bool = true;
|
|
22
22
|
private var faceMatch: FaceMatch?;
|
|
23
|
+
private var currentActiveLiveEvents: ActiveLiveEvents? = ActiveLiveEvents.GOOD;
|
|
24
|
+
|
|
23
25
|
|
|
24
26
|
init(assentifySdk: AssentifySdk, nativeAssentifySdk:NativeAssentifySdk?,holdHandColor: String,processingColor: String,secondImage:String,showCountDown:Bool) {
|
|
25
27
|
self.assentifySdk = assentifySdk
|
|
@@ -63,11 +65,11 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
63
65
|
@objc func backButtonTapped() {
|
|
64
66
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
65
67
|
DispatchQueue.main.async {
|
|
68
|
+
self.faceMatch?.stopScanning()
|
|
66
69
|
self.faceMatch?.willMove(toParent: nil)
|
|
67
70
|
self.faceMatch?.view.removeFromSuperview()
|
|
68
71
|
self.faceMatch?.removeFromParent()
|
|
69
72
|
self.faceMatch = nil
|
|
70
|
-
self.closeAllCameras()
|
|
71
73
|
self.dismiss(animated: false)
|
|
72
74
|
}
|
|
73
75
|
}
|
|
@@ -75,26 +77,16 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
75
77
|
func dismissParentViewController() {
|
|
76
78
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
77
79
|
DispatchQueue.main.async {
|
|
80
|
+
self.faceMatch?.stopScanning()
|
|
78
81
|
self.faceMatch?.willMove(toParent: nil)
|
|
79
82
|
self.faceMatch?.view.removeFromSuperview()
|
|
80
83
|
self.faceMatch?.removeFromParent()
|
|
81
84
|
self.faceMatch = nil
|
|
82
|
-
self.closeAllCameras()
|
|
83
85
|
self.dismiss(animated: false)
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
func closeAllCameras() {
|
|
89
|
-
children.forEach { child in
|
|
90
|
-
if let captureSession = child.value(forKey: "captureSession") as? AVCaptureSession {
|
|
91
|
-
captureSession.stopRunning()
|
|
92
|
-
}
|
|
93
|
-
child.willMove(toParent: nil)
|
|
94
|
-
child.view.removeFromSuperview()
|
|
95
|
-
child.removeFromParent()
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
90
|
|
|
99
91
|
@objc func dismissPopUpMessage() {
|
|
100
92
|
DispatchQueue.main.async {
|
|
@@ -168,11 +160,11 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
168
160
|
triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.faceExtractedModel)
|
|
169
161
|
|
|
170
162
|
DispatchQueue.main.async {
|
|
163
|
+
self.faceMatch?.stopScanning()
|
|
171
164
|
self.faceMatch?.willMove(toParent: nil)
|
|
172
165
|
self.faceMatch?.view.removeFromSuperview()
|
|
173
166
|
self.faceMatch?.removeFromParent()
|
|
174
167
|
self.faceMatch = nil
|
|
175
|
-
self.closeAllCameras()
|
|
176
168
|
self.dismiss(animated: false)
|
|
177
169
|
}
|
|
178
170
|
}
|
|
@@ -224,7 +216,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
224
216
|
|
|
225
217
|
func onEnvironmentalConditionsChange(brightnessEvents: BrightnessEvents,motion: MotionType,faceEvents: FaceEvents,zoom: ZoomType) {
|
|
226
218
|
DispatchQueue.main.async {
|
|
227
|
-
if self.start == false {
|
|
219
|
+
if self.start == false && self.currentActiveLiveEvents == ActiveLiveEvents.GOOD {
|
|
228
220
|
// Zoom Type Handling
|
|
229
221
|
if (zoom != ZoomType.SENDING && zoom != ZoomType.NO_DETECT) {
|
|
230
222
|
if (zoom == ZoomType.ZOOM_IN) {
|
|
@@ -291,12 +283,37 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
291
283
|
}
|
|
292
284
|
}
|
|
293
285
|
} else {
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
if(self.currentActiveLiveEvents == ActiveLiveEvents.GOOD){
|
|
287
|
+
self.infoLabel?.removeFromSuperview()
|
|
288
|
+
self.infoImage?.removeFromSuperview()
|
|
289
|
+
}
|
|
296
290
|
}
|
|
297
291
|
}
|
|
298
292
|
}
|
|
299
293
|
|
|
294
|
+
func onCurrentLiveMoveChange(activeLiveEvents: ActiveLiveEvents) {
|
|
295
|
+
DispatchQueue.main.async {
|
|
296
|
+
self.currentActiveLiveEvents = activeLiveEvents
|
|
297
|
+
switch activeLiveEvents {
|
|
298
|
+
case .YAW_LEFT:
|
|
299
|
+
self.infoLabel?.text = "Please move your face left"
|
|
300
|
+
self.infoImage?.image = UIImage(named: "info_icon")
|
|
301
|
+
case .YAW_RIGHT:
|
|
302
|
+
self.infoLabel?.text = "Please move your face right"
|
|
303
|
+
self.infoImage?.image = UIImage(named: "info_icon")
|
|
304
|
+
case .PITCH_UP:
|
|
305
|
+
self.infoLabel?.text = "Please move your face up"
|
|
306
|
+
self.infoImage?.image = UIImage(named: "info_icon")
|
|
307
|
+
case .PITCH_DOWN:
|
|
308
|
+
self.infoLabel?.text = "Please move your face down"
|
|
309
|
+
self.infoImage?.image = UIImage(named: "info_icon")
|
|
310
|
+
case .GOOD:
|
|
311
|
+
break
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
300
317
|
func onHasTemplates(templates: [TemplatesByCountry]){
|
|
301
318
|
}
|
|
302
319
|
|
|
@@ -70,11 +70,11 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
70
70
|
@objc func backButtonTapped() {
|
|
71
71
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
72
72
|
DispatchQueue.main.async {
|
|
73
|
+
self.scanID?.stopScanning()
|
|
73
74
|
self.scanID?.willMove(toParent: nil)
|
|
74
75
|
self.scanID?.view.removeFromSuperview()
|
|
75
76
|
self.scanID?.removeFromParent()
|
|
76
77
|
self.scanID = nil
|
|
77
|
-
self.closeAllCameras();
|
|
78
78
|
self.dismiss(animated: false)
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -82,26 +82,17 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
82
82
|
func dismissParentViewController() {
|
|
83
83
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
84
84
|
DispatchQueue.main.async {
|
|
85
|
+
self.scanID?.stopScanning()
|
|
85
86
|
self.scanID?.willMove(toParent: nil)
|
|
86
87
|
self.scanID?.view.removeFromSuperview()
|
|
87
88
|
self.scanID?.removeFromParent()
|
|
88
89
|
self.scanID = nil
|
|
89
|
-
self.closeAllCameras();
|
|
90
90
|
self.dismiss(animated: false)
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
children.forEach { child in
|
|
97
|
-
if let captureSession = child.value(forKey: "captureSession") as? AVCaptureSession {
|
|
98
|
-
captureSession.stopRunning()
|
|
99
|
-
}
|
|
100
|
-
child.willMove(toParent: nil)
|
|
101
|
-
child.view.removeFromSuperview()
|
|
102
|
-
child.removeFromParent()
|
|
103
|
-
}
|
|
104
|
-
}
|
|
95
|
+
|
|
105
96
|
|
|
106
97
|
|
|
107
98
|
@objc func dismissPopUpMessage() {
|
|
@@ -196,11 +187,11 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
196
187
|
UserDefaults.standard.set(outputProperties, forKey: "OutputPropertiesDoc")
|
|
197
188
|
}
|
|
198
189
|
DispatchQueue.main.async {
|
|
190
|
+
self.scanID?.stopScanning()
|
|
199
191
|
self.scanID?.willMove(toParent: nil)
|
|
200
192
|
self.scanID?.view.removeFromSuperview()
|
|
201
193
|
self.scanID?.removeFromParent()
|
|
202
194
|
self.scanID = nil
|
|
203
|
-
self.closeAllCameras();
|
|
204
195
|
self.dismiss(animated: false)
|
|
205
196
|
}
|
|
206
197
|
|
|
@@ -70,11 +70,11 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
|
|
|
70
70
|
@objc func backButtonTapped() {
|
|
71
71
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
72
72
|
DispatchQueue.main.async {
|
|
73
|
+
self.scanOther?.stopScanning();
|
|
73
74
|
self.scanOther?.willMove(toParent: nil)
|
|
74
75
|
self.scanOther?.view.removeFromSuperview()
|
|
75
76
|
self.scanOther?.removeFromParent()
|
|
76
77
|
self.scanOther = nil
|
|
77
|
-
self.closeAllCameras();
|
|
78
78
|
self.dismiss(animated: false)
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -82,26 +82,17 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
|
|
|
82
82
|
func dismissParentViewController() {
|
|
83
83
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
84
84
|
DispatchQueue.main.async {
|
|
85
|
+
self.scanOther?.stopScanning();
|
|
85
86
|
self.scanOther?.willMove(toParent: nil)
|
|
86
87
|
self.scanOther?.view.removeFromSuperview()
|
|
87
88
|
self.scanOther?.removeFromParent()
|
|
88
89
|
self.scanOther = nil
|
|
89
|
-
self.closeAllCameras();
|
|
90
90
|
self.dismiss(animated: false)
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
children.forEach { child in
|
|
97
|
-
if let captureSession = child.value(forKey: "captureSession") as? AVCaptureSession {
|
|
98
|
-
captureSession.stopRunning()
|
|
99
|
-
}
|
|
100
|
-
child.willMove(toParent: nil)
|
|
101
|
-
child.view.removeFromSuperview()
|
|
102
|
-
child.removeFromParent()
|
|
103
|
-
}
|
|
104
|
-
}
|
|
95
|
+
|
|
105
96
|
|
|
106
97
|
@objc func dismissPopUpMessage() {
|
|
107
98
|
DispatchQueue.main.async {
|
|
@@ -174,11 +165,11 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
|
|
|
174
165
|
}
|
|
175
166
|
triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.otherExtractedModel)
|
|
176
167
|
DispatchQueue.main.async {
|
|
168
|
+
self.scanOther?.stopScanning();
|
|
177
169
|
self.scanOther?.willMove(toParent: nil)
|
|
178
170
|
self.scanOther?.view.removeFromSuperview()
|
|
179
171
|
self.scanOther?.removeFromParent()
|
|
180
172
|
self.scanOther = nil
|
|
181
|
-
self.closeAllCameras();
|
|
182
173
|
self.dismiss(animated: false)
|
|
183
174
|
}
|
|
184
175
|
|
|
@@ -74,11 +74,11 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
|
|
|
74
74
|
@objc func backButtonTapped() {
|
|
75
75
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
76
76
|
DispatchQueue.main.async {
|
|
77
|
+
self.scanPassport?.stopScanning();
|
|
77
78
|
self.scanPassport?.willMove(toParent: nil)
|
|
78
79
|
self.scanPassport?.view.removeFromSuperview()
|
|
79
80
|
self.scanPassport?.removeFromParent()
|
|
80
81
|
self.scanPassport = nil
|
|
81
|
-
self.closeAllCameras();
|
|
82
82
|
self.dismiss(animated: false)
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -86,26 +86,17 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
|
|
|
86
86
|
func dismissParentViewController() {
|
|
87
87
|
triggerEvent(eventName:"onBackClick",dataModel:nil)
|
|
88
88
|
DispatchQueue.main.async {
|
|
89
|
+
self.scanPassport?.stopScanning();
|
|
89
90
|
self.scanPassport?.willMove(toParent: nil)
|
|
90
91
|
self.scanPassport?.view.removeFromSuperview()
|
|
91
92
|
self.scanPassport?.removeFromParent()
|
|
92
93
|
self.scanPassport = nil
|
|
93
|
-
self.closeAllCameras();
|
|
94
94
|
self.dismiss(animated: false)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
children.forEach { child in
|
|
101
|
-
if let captureSession = child.value(forKey: "captureSession") as? AVCaptureSession {
|
|
102
|
-
captureSession.stopRunning()
|
|
103
|
-
}
|
|
104
|
-
child.willMove(toParent: nil)
|
|
105
|
-
child.view.removeFromSuperview()
|
|
106
|
-
child.removeFromParent()
|
|
107
|
-
}
|
|
108
|
-
}
|
|
99
|
+
|
|
109
100
|
|
|
110
101
|
@objc func dismissPopUpMessage() {
|
|
111
102
|
DispatchQueue.main.async {
|
|
@@ -188,11 +179,11 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
|
|
|
188
179
|
}
|
|
189
180
|
triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.passportExtractedModel)
|
|
190
181
|
DispatchQueue.main.async {
|
|
182
|
+
self.scanPassport?.stopScanning();
|
|
191
183
|
self.scanPassport?.willMove(toParent: nil)
|
|
192
184
|
self.scanPassport?.view.removeFromSuperview()
|
|
193
185
|
self.scanPassport?.removeFromParent()
|
|
194
186
|
self.scanPassport = nil
|
|
195
|
-
self.closeAllCameras();
|
|
196
187
|
self.dismiss(animated: false)
|
|
197
188
|
}
|
|
198
189
|
}
|
|
@@ -205,11 +196,11 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
|
|
|
205
196
|
}
|
|
206
197
|
triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.passportExtractedModel)
|
|
207
198
|
DispatchQueue.main.async {
|
|
199
|
+
self.scanPassport?.stopScanning();
|
|
208
200
|
self.scanPassport?.willMove(toParent: nil)
|
|
209
201
|
self.scanPassport?.view.removeFromSuperview()
|
|
210
202
|
self.scanPassport?.removeFromParent()
|
|
211
203
|
self.scanPassport = nil
|
|
212
|
-
self.closeAllCameras();
|
|
213
204
|
self.dismiss(animated: false)
|
|
214
205
|
}
|
|
215
206
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "assentify-sdk-react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "This package provides integration with Assentify's services, allowing developers to incorporate Assentify functionalities seamlessly into their applications.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|