react-native-hyperkyc-sdk 0.1.6-alpha1 → 0.1.6-alpha2

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.
@@ -6,7 +6,7 @@ import HyperKYC
6
6
  @objc(Hyperkyc)
7
7
  class Hyperkyc: NSObject {
8
8
  @objc static func requiresMainQueueSetup() -> Bool {return true}
9
-
9
+
10
10
  @objc(launch:callback:)
11
11
  func launch(_config: NSDictionary, callback: @escaping RCTResponseSenderBlock) {
12
12
  let appId = _config["appId"] as? String
@@ -156,31 +156,17 @@ class Hyperkyc: NSObject {
156
156
  //
157
157
  func getResponseResultJsonString(docDataResponseResult: DocCaptureApiDetail?, faceDataResponseResult: FaceCaptureApiDetail?, faceMatchDataResponseResult: FaceMatchApiDetail?) -> [String:Any] {
158
158
  let encoder = JSONEncoder()
159
- encoder.outputFormatting = .prettyPrinted
160
159
 
161
- var responseResultJsonString:String = "{}"
162
160
  do {
163
161
  if let responseResult = docDataResponseResult {
164
162
  let responseResultData = try encoder.encode(responseResult)
165
- responseResultJsonString = String(data: responseResultData, encoding: .utf8) ?? "{}"
166
- if let data = responseResultJsonString.data(using: .utf8) {
167
- return try JSONSerialization.jsonObject(with: data, options: []) as? [String:Any] ?? [:]
168
- }
169
-
170
-
163
+ return try JSONSerialization.jsonObject(with: responseResultData, options: []) as? [String:Any] ?? [:]
171
164
  } else if let responseResult = faceDataResponseResult {
172
165
  let responseResultData = try encoder.encode(responseResult)
173
- responseResultJsonString = String(data: responseResultData, encoding: .utf8) ?? "{}"
174
- if let data = responseResultJsonString.data(using: .utf8) {
175
- return try JSONSerialization.jsonObject(with: data, options: []) as? [String:Any] ?? [:]
176
- }
166
+ return try JSONSerialization.jsonObject(with: responseResultData, options: []) as? [String:Any] ?? [:]
177
167
  } else if let responseResult = faceMatchDataResponseResult {
178
168
  let responseResultData = try encoder.encode(responseResult)
179
- responseResultJsonString = String(data: responseResultData, encoding: .utf8) ?? "{}"
180
-
181
- if let data = responseResultJsonString.data(using: .utf8) {
182
- return try JSONSerialization.jsonObject(with: data, options: []) as? [String:Any] ?? [:]
183
- }
169
+ return try JSONSerialization.jsonObject(with: responseResultData, options: []) as? [String:Any] ?? [:]
184
170
  } else {
185
171
  return [:]
186
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperkyc-sdk",
3
- "version": "0.1.6-alpha1",
3
+ "version": "0.1.6-alpha2",
4
4
  "description": "React Native wrapper for HyperKYC SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",