@soyio/soyio-rn-sdk 4.1.1 → 4.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.
@@ -86,39 +86,41 @@ class IOSFacetecSdk: RCTEventEmitter {
86
86
  return
87
87
  }
88
88
 
89
- let status = FaceTec.sdk.getStatus()
90
- if status == .initialized {
91
- resolver(["success": true])
92
- return
93
- }
89
+ DispatchQueue.main.async {
90
+ let status = FaceTec.sdk.getStatus()
91
+ if status == .initialized {
92
+ resolver(["success": true])
93
+ return
94
+ }
94
95
 
95
- // Apply customization before initializing (matching Android pattern)
96
- var themeColors: [String: String]? = nil
97
- if let theme = config["theme"] as? [String: Any] {
98
- themeColors = [
99
- "mainColor": theme["mainColor"] as? String ?? "",
100
- "highlightColor": theme["highlightColor"] as? String ?? "",
101
- "disabledColor": theme["disabledColor"] as? String ?? ""
102
- ]
103
- }
104
- FacetecConfig.apply(theme: themeColors)
105
-
106
- // Initialize SDK directly (matching Android pattern)
107
- FaceTec.sdk.initializeInProductionMode(
108
- productionKeyText: productionKey,
109
- deviceKeyIdentifier: deviceKey,
110
- faceScanEncryptionKey: publicKey,
111
- completion: { initializationSuccessful in
112
- if initializationSuccessful {
113
- resolver(["success": true])
114
- } else {
115
- let sdkStatus = FaceTec.sdk.getStatus()
116
- print("[FaceTec] Initialization failed with status: \(sdkStatus.rawValue) (\(sdkStatus))")
117
- let errorMessage = self.getStatusErrorMessage(sdkStatus)
118
- resolver(["success": false, "error": errorMessage])
119
- }
96
+ // Apply customization before initializing (matching Android pattern)
97
+ var themeColors: [String: String]? = nil
98
+ if let theme = config["theme"] as? [String: Any] {
99
+ themeColors = [
100
+ "mainColor": theme["mainColor"] as? String ?? "",
101
+ "highlightColor": theme["highlightColor"] as? String ?? "",
102
+ "disabledColor": theme["disabledColor"] as? String ?? ""
103
+ ]
120
104
  }
121
- )
105
+ FacetecConfig.apply(theme: themeColors)
106
+
107
+ // Initialize SDK directly (matching Android pattern)
108
+ FaceTec.sdk.initializeInProductionMode(
109
+ productionKeyText: productionKey,
110
+ deviceKeyIdentifier: deviceKey,
111
+ faceScanEncryptionKey: publicKey,
112
+ completion: { initializationSuccessful in
113
+ if initializationSuccessful {
114
+ resolver(["success": true])
115
+ } else {
116
+ let sdkStatus = FaceTec.sdk.getStatus()
117
+ print("[FaceTec] Initialization failed with status: \(sdkStatus.rawValue) (\(sdkStatus))")
118
+ let errorMessage = self.getStatusErrorMessage(sdkStatus)
119
+ resolver(["success": false, "error": errorMessage])
120
+ }
121
+ }
122
+ )
123
+ }
122
124
  }
123
125
 
124
126
  private func startLivenessAndIDVerificationFlow(facetecSessionToken: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-rn-sdk",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "license": "MIT",
5
5
  "author": "Ignacio Méndez",
6
6
  "main": "./package/index.js",