@regulaforensics/face-sdk 8.4.1349-rc → 8.4.1352-beta

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/RNFaceSDK.podspec CHANGED
@@ -5,7 +5,7 @@ source = File.join(__dir__, 'ios')
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'RNFaceSDK'
8
- s.version = '8.4.1349-rc'
8
+ s.version = '8.4.1352-beta'
9
9
  s.summary = package['description']
10
10
  s.license = package['license']
11
11
 
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
16
16
  s.ios.deployment_target = '13.0'
17
17
  s.source_files = [ 'ios/**/*.swift', 'ios/**/RN*.m' ]
18
18
  s.exclude_files = [ 'ios/CDVFaceSDK.swift' ]
19
- s.dependency 'FaceSDKStage', '8.4.4892'
19
+ s.dependency 'FaceSDKBeta', '8.4.4895'
20
20
  s.dependency 'React'
21
21
  end
@@ -20,7 +20,7 @@ android {
20
20
  rootProject.allprojects {
21
21
  repositories {
22
22
  maven {
23
- url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
23
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
24
24
  }
25
25
  }
26
26
  }
@@ -29,7 +29,7 @@ dependencies {
29
29
  //noinspection GradleDynamicVersion
30
30
  implementation 'com.facebook.react:react-native:+'
31
31
  //noinspection GradleDependency
32
- implementation('com.regula.face:api:8.4.5355'){
32
+ implementation('com.regula.face:api:8.4.5358'){
33
33
  transitive = true
34
34
  }
35
35
  }
@@ -6,13 +6,13 @@ android {
6
6
 
7
7
  repositories {
8
8
  maven {
9
- url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
9
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
10
10
  }
11
11
  }
12
12
 
13
13
  dependencies {
14
14
  //noinspection GradleDependency
15
- implementation('com.regula.face:api:8.4.5355'){
15
+ implementation('com.regula.face:api:8.4.5358'){
16
16
  transitive = true
17
17
  }
18
18
  }
@@ -6,8 +6,8 @@
6
6
  "android": "scripts/android.sh"
7
7
  },
8
8
  "dependencies": {
9
- "@regulaforensics/face-sdk": "8.4.1349-rc",
10
- "@regulaforensics/face-core-basic": "8.4.822-rc",
9
+ "@regulaforensics/face-sdk": "8.4.1352-beta",
10
+ "@regulaforensics/face-core-basic": "8.3.683",
11
11
  "@awesome-cordova-plugins/file": "^8.1.0",
12
12
  "@awesome-cordova-plugins/camera": "^8.1.0",
13
13
  "cordova-plugin-file": "^8.1.3",
@@ -20,8 +20,8 @@
20
20
  "@awesome-cordova-plugins/camera": "^9.2.0",
21
21
  "@awesome-cordova-plugins/dialogs": "^9.2.0",
22
22
  "@awesome-cordova-plugins/file": "^9.2.0",
23
- "@regulaforensics/face-sdk": "8.4.1349-rc",
24
- "@regulaforensics/face-core-basic": "8.4.822-rc",
23
+ "@regulaforensics/face-sdk": "8.4.1352-beta",
24
+ "@regulaforensics/face-core-basic": "8.3.683",
25
25
  "cordova-android": "^15.0.0",
26
26
  "cordova-ios": "^8.1.1",
27
27
  "cordova-plugin-camera": "^8.0.0",
@@ -8,8 +8,8 @@
8
8
  "start": "expo start"
9
9
  },
10
10
  "dependencies": {
11
- "@regulaforensics/face-sdk": "8.4.1349-rc",
12
- "@regulaforensics/face-core-basic": "8.4.822-rc",
11
+ "@regulaforensics/face-sdk": "8.4.1352-beta",
12
+ "@regulaforensics/face-core-basic": "8.3.683",
13
13
  "react-native": "^0.81.4",
14
14
  "react-native-fs": "^2.20.0",
15
15
  "react-native-image-picker": "^8.2.1",
@@ -33,10 +33,22 @@ func sendEvent(_ event: String, _ data: Any? = "") {
33
33
  this!.commandDelegate.send(result!, callbackId: callbackId)
34
34
  }
35
35
 
36
- let rootViewController: () -> UIViewController? = {
37
- return UIApplication.shared.connectedScenes
38
- .compactMap { $0 as? UIWindowScene }
39
- .flatMap { $0.windows }
40
- .first { $0.isKeyWindow }?
41
- .rootViewController
36
+ func runAsync (_ action: @escaping (UIViewController) -> Void) {
37
+ DispatchQueue.main.async {
38
+ for case let scene as UIWindowScene in UIApplication.shared.connectedScenes
39
+ where scene.activationState == .foregroundActive || scene.activationState == .foregroundInactive {
40
+ let window = scene.windows.first { $0.isKeyWindow } ?? scene.windows.first { !$0.isHidden && $0.alpha > 0 && $0.windowLevel == .normal }
41
+ guard var presenter = window?.rootViewController else { continue }
42
+ while let next = presenter.presentedViewController
43
+ ?? (presenter as? UINavigationController)?.visibleViewController
44
+ ?? (presenter as? UINavigationController)?.topViewController
45
+ ?? (presenter as? UITabBarController)?.selectedViewController {
46
+ presenter = next
47
+ }
48
+ guard presenter.viewIfLoaded?.window != nil else { continue }
49
+ action(presenter)
50
+ return
51
+ }
52
+ print("REGULA: Cannot present the UI: no presenter available.")
53
+ }
42
54
  }
@@ -39,26 +39,26 @@ func methodCall(_ method: String, _ callback: @escaping Callback) {
39
39
  })
40
40
  case("deinitialize"): face.deinitialize()
41
41
  case("startFaceCapture"): let config = FaceCaptureConfiguration.decode(argsNullable(0))
42
- DispatchQueue.main.async {
42
+ runAsync { presenter in
43
43
  face.presentFaceCaptureViewController(
44
- from: rootViewController()!,
44
+ from: presenter,
45
45
  animated: true,
46
46
  configuration: config,
47
47
  onCapture: { callback($0.encode()) })
48
48
  }
49
49
  case("stopFaceCapture"): face.stopFaceCaptureViewController()
50
50
  case("startLiveness"): let config = LivenessConfiguration.decode(argsNullable(0))
51
- DispatchQueue.main.async {
51
+ runAsync { presenter in
52
52
  face.startLiveness(
53
- from: rootViewController()!,
53
+ from: presenter,
54
54
  animated: true,
55
55
  configuration: config,
56
56
  onLiveness: { callback($0.encode()) })
57
57
  }
58
58
  case("startEnrollment"): let config = EnrollmentConfiguration.decode2(args(0))
59
- DispatchQueue.main.async {
59
+ runAsync { presenter in
60
60
  face.startEnrollment(
61
- from: rootViewController()!,
61
+ from: presenter,
62
62
  animated: true,
63
63
  configuration: config,
64
64
  onEnrollment: { callback([
@@ -67,9 +67,9 @@ func methodCall(_ method: String, _ callback: @escaping Callback) {
67
67
  ]) })
68
68
  }
69
69
  case("startVerification"): let config = VerificationConfiguration.decode2(args(0))
70
- DispatchQueue.main.async {
70
+ runAsync { presenter in
71
71
  face.startVerification(
72
- from: rootViewController()!,
72
+ from: presenter,
73
73
  animated: true,
74
74
  configuration: config,
75
75
  onVerification: { callback([
@@ -34,9 +34,15 @@ private var this: RNFaceSDK?
34
34
 
35
35
  func sendEvent(_ event: String, _ data: Any? = nil) {
36
36
  guard let plugin = this, hasListeners else { return }
37
+ runAsync { _ in plugin.sendEvent(withName: event, body: data.toSendable()) }
38
+ }
39
+
40
+ func runAsync(_ action: @escaping (UIViewController) -> Void) {
37
41
  DispatchQueue.main.async {
38
- plugin.sendEvent(withName: event, body: data.toSendable())
42
+ if let presenter = RCTPresentedViewController() {
43
+ action(presenter)
44
+ return
45
+ }
46
+ print("REGULA: Cannot present Face SDK UI: no presenter available.")
39
47
  }
40
48
  }
41
-
42
- let rootViewController: () -> UIViewController? = { return RCTPresentedViewController() }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/face-sdk",
3
- "version": "8.4.1349-rc",
3
+ "version": "8.4.1352-beta",
4
4
  "description": "This is an npm module for Regula Face SDK. It allows you to easily compaire faces using your phone's camera.",
5
5
  "main": "www/react-native/index.js",
6
6
  "module": "www/capacitor/index.js",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@regulaforensics/face-sdk" version="8.4.1349-rc" xmlns="http://apache.org/cordova/ns/plugins/1.0">
2
+ <plugin id="@regulaforensics/face-sdk" version="8.4.1352-beta" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
3
  <name>FaceSDK</name>
4
4
  <description>Cordova plugin for Regula Face SDK</description>
5
5
  <license>commercial</license>
@@ -27,7 +27,7 @@
27
27
  <source url="https://github.com/regulaforensics/podspecs.git" />
28
28
  </config>
29
29
  <pods>
30
- <pod name="FaceSDKStage" spec="8.4.4892" />
30
+ <pod name="FaceSDKBeta" spec="8.4.4895" />
31
31
  </pods>
32
32
  </podspec>
33
33
  </platform>
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "..": {
15
15
  "name": "@regulaforensics/face-sdk",
16
- "version": "8.4.1349-rc",
16
+ "version": "8.4.1352-beta",
17
17
  "dev": true,
18
18
  "license": "commercial",
19
19
  "dependencies": {