@digiotech/react-native 2.0.11 → 2.0.13

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.
@@ -60,7 +60,8 @@ class DigioReactNative: RCTEventEmitter, DigioKycResponseDelegate,DigioEsignDele
60
60
  reject: reject
61
61
  )else{return}
62
62
 
63
- let clientSecretKey = self.optionalString("clientSecretKey", from: config)
63
+ // let clientSecretKey = self.optionalString("clientSecretKey", from: config)
64
+ let clientSecretKey = self.optionalString("clientSecretKey", from: config) ?? ""
64
65
  // let clientToken = optionalString("token", from: config)
65
66
 
66
67
  let logo = config["logo"] as? String
@@ -96,15 +97,14 @@ class DigioReactNative: RCTEventEmitter, DigioKycResponseDelegate,DigioEsignDele
96
97
  if rootViewController != nil {
97
98
  do{
98
99
 
99
- try DigioKycBuilder()
100
+ let builder = try DigioKycBuilder()
100
101
  .withController(viewController: rootViewController!)
101
102
  .setLogo(logo: logo ?? "")
102
- // .setEnvironment(environment: sdkEnvironment.elementsEqual("sandbox") ? DigioEnvironment.SANDBOX : DigioEnvironment.PRODUCTION)
103
103
  .setEnvironment(
104
104
  environment:
105
- sdkEnvironment.lowercased().elementsEqual("sandbox")
105
+ sdkEnvironment.lowercased() == "sandbox"
106
106
  ? DigioEnvironment.SANDBOX
107
- : sdkEnvironment.lowercased().elementsEqual("development")
107
+ : sdkEnvironment.lowercased() == "development"
108
108
  ? DigioEnvironment.DEV
109
109
  : DigioEnvironment.PRODUCTION
110
110
  )
@@ -113,15 +113,20 @@ class DigioReactNative: RCTEventEmitter, DigioKycResponseDelegate,DigioEsignDele
113
113
  referenceId: "",
114
114
  uniqueRequestId: ""
115
115
  )
116
- .setCaptureConfig(captureConfig: captureConfig)
116
+ .setCaptureConfig(captureConfig: captureConfig)
117
117
  .setStatelessResponseDelegate(delegate: self)
118
- // .build(
119
- // clientId: clientId,
120
- // clientSecretKey: clientSecretKey
121
- // )
122
- .build(token: clientToken,
123
- clientId: clientId
124
- )
118
+
119
+ if clientToken.isEmpty {
120
+ try builder.build(
121
+ clientId: clientId,
122
+ clientSecretKey: clientSecretKey
123
+ )
124
+ } else {
125
+ try builder.build(
126
+ token: clientToken,
127
+ clientId: clientId
128
+ )
129
+ }
125
130
 
126
131
  }catch {
127
132
  reject("Error", error.localizedDescription, error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digiotech/react-native",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "SDK for invoking client side journey for any of Digio request",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",