assentify-sdk-react-native 0.0.15 → 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 CHANGED
@@ -92,6 +92,9 @@ yarn add assentify-sdk-react-native
92
92
  ```
93
93
 
94
94
  ## Versions
95
+ **0.0.16**
96
+ - Active liveness
97
+
95
98
  **0.0.15**
96
99
  - Detect improvements
97
100
 
@@ -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.66'
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
- infoLayout.visibility = View.GONE
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 {
@@ -38,6 +38,6 @@ Pod::Spec.new do |s|
38
38
 
39
39
 
40
40
  s.dependency "React-Core"
41
- s.dependency "AssentifySdk", '0.0.51'
41
+ s.dependency "AssentifySdk", '0.0.53'
42
42
 
43
43
  end
@@ -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
@@ -214,7 +216,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
214
216
 
215
217
  func onEnvironmentalConditionsChange(brightnessEvents: BrightnessEvents,motion: MotionType,faceEvents: FaceEvents,zoom: ZoomType) {
216
218
  DispatchQueue.main.async {
217
- if self.start == false {
219
+ if self.start == false && self.currentActiveLiveEvents == ActiveLiveEvents.GOOD {
218
220
  // Zoom Type Handling
219
221
  if (zoom != ZoomType.SENDING && zoom != ZoomType.NO_DETECT) {
220
222
  if (zoom == ZoomType.ZOOM_IN) {
@@ -281,12 +283,37 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
281
283
  }
282
284
  }
283
285
  } else {
284
- self.infoLabel?.removeFromSuperview()
285
- self.infoImage?.removeFromSuperview()
286
+ if(self.currentActiveLiveEvents == ActiveLiveEvents.GOOD){
287
+ self.infoLabel?.removeFromSuperview()
288
+ self.infoImage?.removeFromSuperview()
289
+ }
286
290
  }
287
291
  }
288
292
  }
289
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
+
290
317
  func onHasTemplates(templates: [TemplatesByCountry]){
291
318
  }
292
319
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assentify-sdk-react-native",
3
- "version": "0.0.15",
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",