@soyio/soyio-rn-sdk 4.1.2 → 4.1.3
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/ios/IOSFacetecSdk.swift +6 -4
- package/package.json +1 -1
package/ios/IOSFacetecSdk.swift
CHANGED
|
@@ -8,6 +8,7 @@ class IOSFacetecSdk: RCTEventEmitter {
|
|
|
8
8
|
|
|
9
9
|
private var currentPhotoIDProcessor: SoyioPhotoIDMatchProcessor?
|
|
10
10
|
private var currentIDOnlyProcessor: SoyioIDOnlyProcessor?
|
|
11
|
+
private var isInitializing = false
|
|
11
12
|
|
|
12
13
|
@objc
|
|
13
14
|
override static func requiresMainQueueSetup() -> Bool {
|
|
@@ -87,12 +88,13 @@ class IOSFacetecSdk: RCTEventEmitter {
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
DispatchQueue.main.async {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
resolver(["success": true])
|
|
91
|
+
if self.isInitializing {
|
|
92
|
+
resolver(["success": false, "error": "FaceTec SDK initialization already in progress"])
|
|
93
93
|
return
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
self.isInitializing = true
|
|
97
|
+
|
|
96
98
|
// Apply customization before initializing (matching Android pattern)
|
|
97
99
|
var themeColors: [String: String]? = nil
|
|
98
100
|
if let theme = config["theme"] as? [String: Any] {
|
|
@@ -104,12 +106,12 @@ class IOSFacetecSdk: RCTEventEmitter {
|
|
|
104
106
|
}
|
|
105
107
|
FacetecConfig.apply(theme: themeColors)
|
|
106
108
|
|
|
107
|
-
// Initialize SDK directly (matching Android pattern)
|
|
108
109
|
FaceTec.sdk.initializeInProductionMode(
|
|
109
110
|
productionKeyText: productionKey,
|
|
110
111
|
deviceKeyIdentifier: deviceKey,
|
|
111
112
|
faceScanEncryptionKey: publicKey,
|
|
112
113
|
completion: { initializationSuccessful in
|
|
114
|
+
self.isInitializing = false
|
|
113
115
|
if initializationSuccessful {
|
|
114
116
|
resolver(["success": true])
|
|
115
117
|
} else {
|