@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.
- package/ios/DigioReactNative.swift +18 -13
- package/package.json +1 -1
|
@@ -60,7 +60,8 @@ class DigioReactNative: RCTEventEmitter, DigioKycResponseDelegate,DigioEsignDele
|
|
|
60
60
|
reject: reject
|
|
61
61
|
)else{return}
|
|
62
62
|
|
|
63
|
-
|
|
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
|
-
|
|
105
|
+
sdkEnvironment.lowercased() == "sandbox"
|
|
106
106
|
? DigioEnvironment.SANDBOX
|
|
107
|
-
: sdkEnvironment.lowercased()
|
|
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
|
-
|
|
116
|
+
.setCaptureConfig(captureConfig: captureConfig)
|
|
117
117
|
.setStatelessResponseDelegate(delegate: self)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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)
|