idwise-nfc-react-native-sdk 4.9.5 → 5.0.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/android/build.gradle +5 -5
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/idwisemobilesdk/IdwiseMobileSdkModule.kt +94 -73
- package/idwise-react-native-sdk.podspec +3 -4
- package/ios/IDWiseNFC.framework/Assets.car +0 -0
- package/ios/IDWiseNFC.framework/IDWiseNFC +0 -0
- package/ios/IDWiseNFC.framework/Info.plist +0 -0
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.abi.json +5587 -4553
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.private.swiftinterface +95 -57
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftinterface +95 -57
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.abi.json +5587 -4553
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +95 -57
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +95 -57
- package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/IDWiseNFC.framework/document_detector.mlmodelc/coremldata.bin +0 -0
- package/ios/IDWiseNFC.framework/document_detector.mlmodelc/metadata.json +2 -2
- package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/coremldata.bin +0 -0
- package/ios/IdwiseMobileSdk.mm +5 -2
- package/ios/IdwiseMobileSdk.swift +160 -115
- package/lib/commonjs/ApplicantDetailsKeys.js +12 -0
- package/lib/commonjs/ApplicantDetailsKeys.js.map +1 -0
- package/lib/commonjs/IDWise.js +3 -38
- package/lib/commonjs/IDWise.js.map +1 -1
- package/lib/commonjs/IDWiseConstants.js +3 -3
- package/lib/commonjs/IDWiseConstants.js.map +1 -1
- package/lib/commonjs/IDWiseDynamic.js +60 -0
- package/lib/commonjs/IDWiseDynamic.js.map +1 -0
- package/lib/commonjs/IDWiseEventListeners.js +16 -11
- package/lib/commonjs/IDWiseEventListeners.js.map +1 -1
- package/lib/commonjs/index.js +4 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/ApplicantDetailsKeys.js +6 -0
- package/lib/module/ApplicantDetailsKeys.js.map +1 -0
- package/lib/module/IDWise.js +4 -39
- package/lib/module/IDWise.js.map +1 -1
- package/lib/module/IDWiseConstants.js +2 -2
- package/lib/module/IDWiseConstants.js.map +1 -1
- package/lib/module/IDWiseDynamic.js +54 -0
- package/lib/module/IDWiseDynamic.js.map +1 -0
- package/lib/module/IDWiseEventListeners.js +16 -11
- package/lib/module/IDWiseEventListeners.js.map +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/package.json +2 -2
- package/src/ApplicantDetailsKeys.js +5 -0
- package/src/IDWise.js +8 -64
- package/src/IDWiseConstants.js +2 -2
- package/src/IDWiseDynamic.js +98 -0
- package/src/IDWiseEventListeners.js +17 -16
- package/src/index.js +3 -2
|
@@ -5,14 +5,12 @@ import React
|
|
|
5
5
|
@objc(IdwiseMobileSdk)
|
|
6
6
|
class IdwiseMobileSdk: RCTEventEmitter {
|
|
7
7
|
|
|
8
|
-
var journeyID = ""
|
|
9
|
-
|
|
10
8
|
public static var emitter: RCTEventEmitter!
|
|
11
9
|
|
|
12
10
|
open override func supportedEvents() -> [String] {
|
|
13
11
|
[
|
|
14
12
|
"onJourneyStarted", "onJourneyResumed", "onJourneyCancelled", "onError", "onJourneyError",
|
|
15
|
-
"
|
|
13
|
+
"onJourneyCompleted",
|
|
16
14
|
"onJourneySummary", "onStepCaptured", "onStepResult", "onStepCancelled", "onStepSkipped",
|
|
17
15
|
"onInitializeError",
|
|
18
16
|
"onJourneySummaryError",
|
|
@@ -25,7 +23,7 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
@objc func initialize(_ clientKey: String, _ theme: String) {
|
|
28
|
-
var sdkTheme:
|
|
26
|
+
var sdkTheme: IDWiseTheme = .systemDefault
|
|
29
27
|
if theme == "LIGHT" {
|
|
30
28
|
sdkTheme = .light
|
|
31
29
|
} else if theme == "DARK" {
|
|
@@ -33,9 +31,16 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
33
31
|
}
|
|
34
32
|
IDWise.initialize(clientKey: clientKey, theme: sdkTheme) { err in
|
|
35
33
|
if let error = err {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
do {
|
|
35
|
+
let jsonData = try JSONEncoder().encode(error)
|
|
36
|
+
let jsonString = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
37
|
+
|
|
38
|
+
IdwiseMobileSdk.emitter.sendEvent(
|
|
39
|
+
withName: "onInitializeError",
|
|
40
|
+
body: ["data": jsonString] as [String: Any])
|
|
41
|
+
} catch {
|
|
42
|
+
print(error)
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
|
|
@@ -44,18 +49,19 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
44
49
|
@objc func startJourney(
|
|
45
50
|
_ journeyDefinitionID: String,
|
|
46
51
|
_ referenceNo: String,
|
|
47
|
-
_ locale: String
|
|
52
|
+
_ locale: String,
|
|
53
|
+
_ applicantDetails: [String:String]?
|
|
48
54
|
) {
|
|
49
55
|
if referenceNo.isEmpty {
|
|
50
56
|
DispatchQueue.main.async {
|
|
51
57
|
IDWise.startJourney(
|
|
52
|
-
|
|
58
|
+
flowId: journeyDefinitionID, locale: locale, applicantDetails: applicantDetails, journeyCallbacks: self)
|
|
53
59
|
}
|
|
54
60
|
} else {
|
|
55
61
|
DispatchQueue.main.async {
|
|
56
62
|
IDWise.startJourney(
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
flowId: journeyDefinitionID, referenceNumber: referenceNo, locale: locale, applicantDetails: applicantDetails,
|
|
64
|
+
journeyCallbacks: self)
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
}
|
|
@@ -63,24 +69,27 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
63
69
|
@objc func startDynamicJourney(
|
|
64
70
|
_ journeyDefinitionId: String,
|
|
65
71
|
_ referenceNo: String,
|
|
66
|
-
_ locale: String
|
|
72
|
+
_ locale: String,
|
|
73
|
+
_ applicantDetails: [String:String]?
|
|
67
74
|
) {
|
|
68
75
|
if referenceNo.isEmpty {
|
|
69
76
|
DispatchQueue.main.async {
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
IDWiseDynamic.startJourney(
|
|
78
|
+
flowId: journeyDefinitionId,
|
|
72
79
|
locale: locale,
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
applicantDetails: applicantDetails,
|
|
81
|
+
journeyCallbacks: self,
|
|
82
|
+
stepCallbacks: self)
|
|
75
83
|
}
|
|
76
84
|
} else {
|
|
77
85
|
DispatchQueue.main.async {
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
IDWiseDynamic.startJourney(
|
|
87
|
+
flowId: journeyDefinitionId,
|
|
80
88
|
referenceNumber: referenceNo,
|
|
81
89
|
locale: locale,
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
applicantDetails: applicantDetails,
|
|
91
|
+
journeyCallbacks: self,
|
|
92
|
+
stepCallbacks: self)
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
95
|
}
|
|
@@ -90,11 +99,11 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
90
99
|
_ journeyId: String,
|
|
91
100
|
_ locale: String
|
|
92
101
|
) {
|
|
93
|
-
|
|
102
|
+
DispatchQueue.main.async {
|
|
94
103
|
IDWise.resumeJourney(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
104
|
+
flowId: journeyDefinitionId, journeyId: journeyId, locale: locale,
|
|
105
|
+
journeyCallbacks: self)
|
|
106
|
+
}
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
@objc func resumeDynamicJourney(
|
|
@@ -103,21 +112,21 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
103
112
|
_ locale: String
|
|
104
113
|
) {
|
|
105
114
|
DispatchQueue.main.async {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
IDWiseDynamic.resumeJourney(
|
|
116
|
+
flowId: journeyDefinitionId, journeyId: journeyId, locale: locale,
|
|
117
|
+
journeyCallbacks: self, stepCallbacks: self)
|
|
109
118
|
}
|
|
110
119
|
}
|
|
111
120
|
|
|
112
121
|
@objc func skipStep(_ stepId: String) {
|
|
113
122
|
DispatchQueue.main.async {
|
|
114
|
-
|
|
123
|
+
IDWiseDynamic.skipStep(stepId: stepId)
|
|
115
124
|
}
|
|
116
125
|
}
|
|
117
126
|
|
|
118
127
|
@objc func startStep(_ stepId: String) {
|
|
119
128
|
DispatchQueue.main.async {
|
|
120
|
-
|
|
129
|
+
IDWiseDynamic.startStep(stepId: stepId)
|
|
121
130
|
}
|
|
122
131
|
}
|
|
123
132
|
|
|
@@ -126,52 +135,36 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
126
135
|
_ data: Data
|
|
127
136
|
) {
|
|
128
137
|
DispatchQueue.main.async {
|
|
129
|
-
|
|
138
|
+
IDWiseDynamic.startStepFromFileUpload(stepId: stepId, data: data)
|
|
130
139
|
}
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
@objc func getJourneySummary() {
|
|
134
|
-
|
|
143
|
+
IDWiseDynamic.getJourneySummary(
|
|
135
144
|
callback: { journeySummary, error in
|
|
136
|
-
if let summary = journeySummary {
|
|
137
|
-
|
|
138
|
-
// encoding JSON response so react-native can consume it correctly
|
|
139
|
-
var journeyStepSummaries = ""
|
|
140
|
-
|
|
141
145
|
do {
|
|
142
|
-
let
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
} catch {}
|
|
151
|
-
|
|
152
|
-
IdwiseMobileSdk.emitter.sendEvent(
|
|
153
|
-
withName: "onJourneySummary",
|
|
154
|
-
body: ["summary": journeyStepSummaries] as [String: Any])
|
|
155
|
-
} else {
|
|
156
|
-
if let err = error {
|
|
157
|
-
IdwiseMobileSdk.emitter.sendEvent(
|
|
158
|
-
withName: "onJourneySummaryError",
|
|
159
|
-
body: ["errorCode": err.code, "errorMessage": err.message] as [String: Any])
|
|
146
|
+
let responseSummary = JourneySummaryExposed(summary: journeySummary,error: error)
|
|
147
|
+
|
|
148
|
+
let jsonData = try JSONEncoder().encode(responseSummary)
|
|
149
|
+
let jsonString = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
150
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneySummary", body: ["data": jsonString] as [String: Any])
|
|
151
|
+
|
|
152
|
+
} catch {
|
|
153
|
+
print(error)
|
|
160
154
|
}
|
|
161
|
-
}
|
|
162
155
|
|
|
163
156
|
})
|
|
164
157
|
}
|
|
165
158
|
|
|
166
159
|
@objc func finishDynamicJourney() {
|
|
167
160
|
DispatchQueue.main.async {
|
|
168
|
-
|
|
161
|
+
IDWiseDynamic.finishJourney()
|
|
169
162
|
}
|
|
170
163
|
}
|
|
171
164
|
|
|
172
165
|
@objc func unloadSDK() {
|
|
173
166
|
DispatchQueue.main.async {
|
|
174
|
-
|
|
167
|
+
IDWiseDynamic.unloadSDK()
|
|
175
168
|
}
|
|
176
169
|
}
|
|
177
170
|
|
|
@@ -182,84 +175,123 @@ class IdwiseMobileSdk: RCTEventEmitter {
|
|
|
182
175
|
|
|
183
176
|
}
|
|
184
177
|
|
|
185
|
-
extension IdwiseMobileSdk:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
178
|
+
extension IdwiseMobileSdk: IDWiseJourneyCallbacks {
|
|
179
|
+
public func onJourneyResumed(journeyResumedInfo: JourneyResumedInfo) {
|
|
180
|
+
do{
|
|
181
|
+
let jsonEncoder = JSONEncoder()
|
|
182
|
+
let jsonData = try jsonEncoder.encode(journeyResumedInfo)
|
|
183
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
184
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyResumed", body: ["data": jsonResp] as [String: Any])
|
|
185
|
+
}catch{
|
|
186
|
+
print(error)
|
|
187
|
+
}
|
|
188
|
+
|
|
191
189
|
}
|
|
192
190
|
|
|
193
|
-
func
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
public func onError(error : IDWiseError) {
|
|
192
|
+
|
|
193
|
+
do {
|
|
194
|
+
let jsonEncoder = JSONEncoder()
|
|
195
|
+
let jsonData = try jsonEncoder.encode(error)
|
|
196
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
197
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyError", body: ["data": jsonResp] as [String: Any])
|
|
198
|
+
} catch{
|
|
199
|
+
print(error)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
198
203
|
}
|
|
199
204
|
|
|
200
|
-
func
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
public func onJourneyStarted(journeyStartedInfo: JourneyStartedInfo) {
|
|
206
|
+
do{
|
|
207
|
+
let jsonEncoder = JSONEncoder()
|
|
208
|
+
let jsonData = try jsonEncoder.encode(journeyStartedInfo)
|
|
209
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
210
|
+
|
|
211
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyStarted", body: ["data": jsonResp] as [String: Any])
|
|
212
|
+
} catch {
|
|
213
|
+
print(error)
|
|
214
|
+
}
|
|
204
215
|
}
|
|
205
216
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
public func onJourneyCompleted(journeyCompletedInfo: JourneyCompletedInfo) {
|
|
218
|
+
|
|
219
|
+
do{
|
|
220
|
+
let jsonEncoder = JSONEncoder()
|
|
221
|
+
let jsonData = try jsonEncoder.encode(journeyCompletedInfo)
|
|
222
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
223
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyCompleted", body: ["data": jsonResp] as [String: Any])
|
|
224
|
+
}catch{
|
|
225
|
+
print(error)
|
|
226
|
+
}
|
|
227
|
+
}
|
|
210
228
|
|
|
211
|
-
|
|
229
|
+
public func onJourneyCancelled(journeyCancelledInfo: JourneyCancelledInfo) {
|
|
230
|
+
do{
|
|
231
|
+
let jsonEncoder = JSONEncoder()
|
|
232
|
+
let jsonData = try jsonEncoder.encode(journeyCancelledInfo)
|
|
233
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
234
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyCancelled", body: ["data": jsonResp] as [String: Any])
|
|
235
|
+
}catch{
|
|
236
|
+
print(error)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
212
239
|
|
|
213
|
-
func onError(error: IDWiseSDKError) {
|
|
214
|
-
IdwiseMobileSdk.emitter.sendEvent(
|
|
215
|
-
withName: "onJourneyError",
|
|
216
|
-
body: ["errorCode": error.code, "errorMessage": error.message] as [String: Any])
|
|
217
|
-
}
|
|
218
240
|
}
|
|
219
241
|
|
|
220
|
-
extension IdwiseMobileSdk:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
extension IdwiseMobileSdk: IDWiseStepCallbacks {
|
|
243
|
+
|
|
244
|
+
public func onStepCaptured(stepCapturedInfo:StepCapturedInfo) {
|
|
245
|
+
do{
|
|
246
|
+
let originalImage = convertImageToBase64String(img: stepCapturedInfo.originalImage)
|
|
247
|
+
let croppedImage = convertImageToBase64String(img: stepCapturedInfo.croppedImage)
|
|
248
|
+
|
|
249
|
+
let captureResponse = OnStepCapturedExposed(stepId: stepCapturedInfo.stepId, originalImage: originalImage, croppedImage: croppedImage)
|
|
250
|
+
|
|
251
|
+
let jsonEncoder = JSONEncoder()
|
|
252
|
+
let jsonData = try jsonEncoder.encode(captureResponse)
|
|
253
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
254
|
+
|
|
255
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onStepCaptured", body: ["data": jsonResp] as [String: Any])
|
|
256
|
+
}catch{
|
|
257
|
+
print(error)
|
|
258
|
+
}
|
|
227
259
|
}
|
|
228
260
|
|
|
229
|
-
func onStepResult(
|
|
230
|
-
|
|
231
|
-
// encoding JSON response so react-native can consume it correctly
|
|
261
|
+
public func onStepResult(stepResultInfo:StepResultInfo) {
|
|
232
262
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
stepResultObj = jsonString
|
|
263
|
+
do{
|
|
264
|
+
let jsonEncoder = JSONEncoder()
|
|
265
|
+
let jsonData = try jsonEncoder.encode(stepResultInfo)
|
|
266
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
267
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onStepResult", body: ["data": jsonResp] as [String: Any])
|
|
268
|
+
}catch{
|
|
269
|
+
print(error)
|
|
241
270
|
}
|
|
242
|
-
} catch {}
|
|
243
|
-
|
|
244
|
-
IdwiseMobileSdk.emitter.sendEvent(
|
|
245
|
-
withName: "onStepResult",
|
|
246
|
-
body: ["stepId": stepId, "stepResult": stepResultObj] as [String: Any])
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
func onStepConfirmed(stepId: String) {
|
|
250
271
|
|
|
251
272
|
}
|
|
252
273
|
|
|
253
|
-
func onStepCancelled(stepId: String) {
|
|
254
274
|
|
|
255
|
-
|
|
256
|
-
|
|
275
|
+
public func onStepCancelled(stepCancelledInfo: StepCancelledInfo) {
|
|
276
|
+
do{
|
|
277
|
+
let jsonEncoder = JSONEncoder()
|
|
278
|
+
let jsonData = try jsonEncoder.encode(stepCancelledInfo)
|
|
279
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
280
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onStepCancelled", body: ["data": jsonResp] as [String: Any])
|
|
281
|
+
}catch{
|
|
282
|
+
print(error)
|
|
283
|
+
}
|
|
257
284
|
}
|
|
258
285
|
|
|
259
|
-
func onStepSkipped(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
286
|
+
public func onStepSkipped(stepSkippedInfo: StepSkippedInfo) {
|
|
287
|
+
do{
|
|
288
|
+
let jsonEncoder = JSONEncoder()
|
|
289
|
+
let jsonData = try jsonEncoder.encode(stepSkippedInfo)
|
|
290
|
+
let jsonResp = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
291
|
+
IdwiseMobileSdk.emitter.sendEvent(withName: "onStepSkipped", body: ["data": jsonResp] as [String: Any])
|
|
292
|
+
}catch{
|
|
293
|
+
print(error)
|
|
294
|
+
}
|
|
263
295
|
}
|
|
264
296
|
|
|
265
297
|
func convertImageToBase64String(img: UIImage?) -> String {
|
|
@@ -267,3 +299,16 @@ extension IdwiseMobileSdk: IDWiseSDKStepDelegate {
|
|
|
267
299
|
}
|
|
268
300
|
|
|
269
301
|
}
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
private struct JourneySummaryExposed: Codable {
|
|
305
|
+
var summary: JourneySummary?
|
|
306
|
+
var error: IDWiseError?
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
private struct OnStepCapturedExposed: Codable {
|
|
310
|
+
var stepId: String
|
|
311
|
+
var originalImage: String?
|
|
312
|
+
var croppedImage: String?
|
|
313
|
+
}
|
|
314
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
FULL_NAME: 'full_name',
|
|
9
|
+
BIRTH_DATE: 'birth_date',
|
|
10
|
+
SEX: 'sex'
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ApplicantDetailsKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FULL_NAME","BIRTH_DATE","SEX"],"sourceRoot":"../../src","sources":["ApplicantDetailsKeys.js"],"mappings":";;;;;;iCAAe;EACbA,SAAS,EAAE,WAAW;EACtBC,UAAU,EAAE,YAAY;EACxBC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
|
package/lib/commonjs/IDWise.js
CHANGED
|
@@ -20,55 +20,20 @@ const initialize = (clientKey, theme, callback) => {
|
|
|
20
20
|
(0, _IDWiseEventListeners.setInitializeEventListeners)(callback);
|
|
21
21
|
RNIDWise.initialize(clientKey, theme);
|
|
22
22
|
};
|
|
23
|
-
const startJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback) => {
|
|
23
|
+
const startJourney = (journeyDefinitionId, referenceNo, locale, applicantDetails, journeyCallback) => {
|
|
24
24
|
console.log('IDWise - startJourney');
|
|
25
25
|
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
26
26
|
(0, _IDWiseEventListeners.setStepEventListeners)(null);
|
|
27
|
-
RNIDWise.startJourney(journeyDefinitionId, referenceNo, locale);
|
|
28
|
-
};
|
|
29
|
-
const startDynamicJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback, stepCallback) => {
|
|
30
|
-
console.log('IDWise - startDynamicJourney');
|
|
31
|
-
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
32
|
-
(0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
|
|
33
|
-
RNIDWise.startDynamicJourney(journeyDefinitionId, referenceNo, locale);
|
|
34
|
-
};
|
|
35
|
-
const resumeDynamicJourney = (journeyDefinitionId, journeyId, locale, journeyCallback, stepCallback) => {
|
|
36
|
-
console.log('IDWise - resumeDynamicJourney');
|
|
37
|
-
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
38
|
-
(0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
|
|
39
|
-
RNIDWise.resumeDynamicJourney(journeyDefinitionId, journeyId, locale);
|
|
27
|
+
RNIDWise.startJourney(journeyDefinitionId, referenceNo, locale, applicantDetails);
|
|
40
28
|
};
|
|
41
29
|
const resumeJourney = (journeyDefinitionId, journeyId, locale, journeyCallback) => {
|
|
42
30
|
console.log('IDWise - resumeJourney');
|
|
43
31
|
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
44
32
|
RNIDWise.resumeJourney(journeyDefinitionId, journeyId, locale);
|
|
45
33
|
};
|
|
46
|
-
const startStep = stepId => RNIDWise.startStep(stepId);
|
|
47
|
-
const skipStep = stepId => RNIDWise.skipStep(stepId);
|
|
48
|
-
const getJourneySummary = callback => {
|
|
49
|
-
console.log('IDWise - getJourneySummary');
|
|
50
|
-
(0, _IDWiseEventListeners.setJourneySummaryEventListener)(callback);
|
|
51
|
-
RNIDWise.getJourneySummary();
|
|
52
|
-
};
|
|
53
|
-
const finishDynamicJourney = () => {
|
|
54
|
-
console.log('IDWise - finishDynamicJourney');
|
|
55
|
-
RNIDWise.finishDynamicJourney();
|
|
56
|
-
};
|
|
57
|
-
const unloadSDK = () => {
|
|
58
|
-
console.log('IDWise - unloadSDK');
|
|
59
|
-
RNIDWise.unloadSDK();
|
|
60
|
-
};
|
|
61
34
|
const IDWise = exports.IDWise = {
|
|
62
35
|
initialize,
|
|
63
36
|
startJourney,
|
|
64
|
-
|
|
65
|
-
resumeDynamicJourney,
|
|
66
|
-
startStep,
|
|
67
|
-
getJourneySummary,
|
|
68
|
-
finishDynamicJourney,
|
|
69
|
-
skipStep,
|
|
70
|
-
//TODO: uncomment below once it is implemented on iOS
|
|
71
|
-
//resumeJourney,
|
|
72
|
-
unloadSDK
|
|
37
|
+
resumeJourney
|
|
73
38
|
};
|
|
74
39
|
//# sourceMappingURL=IDWise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_IDWiseEventListeners","LINKING_ERROR","Platform","select","ios","default","RNIDWise","NativeModules","IdwiseMobileSdk","Proxy","get","Error","initialize","clientKey","theme","callback","console","log","setInitializeEventListeners","startJourney","journeyDefinitionId","referenceNo","locale","journeyCallback","setJourneyEventListeners","setStepEventListeners","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_IDWiseEventListeners","LINKING_ERROR","Platform","select","ios","default","RNIDWise","NativeModules","IdwiseMobileSdk","Proxy","get","Error","initialize","clientKey","theme","callback","console","log","setInitializeEventListeners","startJourney","journeyDefinitionId","referenceNo","locale","applicantDetails","journeyCallback","setJourneyEventListeners","setStepEventListeners","resumeJourney","journeyId","IDWise","exports"],"sourceRoot":"../../src","sources":["IDWise.js"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAMA,MAAME,aAAa,GACjB,4EAA4E,GAC5EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;A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
exports.
|
|
6
|
+
exports.IDWiseTheme = exports.IDWiseEvents = void 0;
|
|
7
7
|
const IDWiseEvents = exports.IDWiseEvents = {
|
|
8
8
|
EVENT_INITIALIZE_ERRROR: 'onInitializeError',
|
|
9
9
|
EVENT_JOURNEY_STARTED: 'onJourneyStarted',
|
|
10
10
|
EVENT_JOURNEY_RESUMED: 'onJourneyResumed',
|
|
11
|
-
EVENT_JOURNEY_FINISHED: '
|
|
11
|
+
EVENT_JOURNEY_FINISHED: 'onJourneyCompleted',
|
|
12
12
|
EVENT_JOURNEY_CANCELLED: 'onJourneyCancelled',
|
|
13
13
|
EVENT_JOURNEY_ERROR: 'onJourneyError',
|
|
14
14
|
EVENT_JOURNEY_SUMMARY: 'onJourneySummary',
|
|
@@ -18,7 +18,7 @@ const IDWiseEvents = exports.IDWiseEvents = {
|
|
|
18
18
|
EVENT_STEP_CANCELLED: 'onStepCancelled',
|
|
19
19
|
EVENT_STEP_SKIPPED: 'onStepSkipped'
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const IDWiseTheme = exports.IDWiseTheme = {
|
|
22
22
|
LIGHT: 'LIGHT',
|
|
23
23
|
DARK: 'DARK',
|
|
24
24
|
SYSTEM_DEFAULT: 'SYSTEM_DEFAULT'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IDWiseEvents","exports","EVENT_INITIALIZE_ERRROR","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","
|
|
1
|
+
{"version":3,"names":["IDWiseEvents","exports","EVENT_INITIALIZE_ERRROR","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","IDWiseTheme","LIGHT","DARK","SYSTEM_DEFAULT"],"sourceRoot":"../../src","sources":["IDWiseConstants.js"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,uBAAuB,EAAE,mBAAmB;EAE5CC,qBAAqB,EAAE,kBAAkB;EACzCC,qBAAqB,EAAE,kBAAkB;EACzCC,sBAAsB,EAAE,oBAAoB;EAC5CC,uBAAuB,EAAE,oBAAoB;EAC7CC,mBAAmB,EAAE,gBAAgB;EAErCC,qBAAqB,EAAE,kBAAkB;EACzCC,2BAA2B,EAAE,uBAAuB;EAEpDC,mBAAmB,EAAE,gBAAgB;EACrCC,iBAAiB,EAAE,cAAc;EACjCC,oBAAoB,EAAE,iBAAiB;EACvCC,kBAAkB,EAAE;AACtB,CAAC;AAEM,MAAMC,WAAW,GAAAb,OAAA,CAAAa,WAAA,GAAG;EACzBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,cAAc,EAAE;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.IDWiseDynamic = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _IDWiseEventListeners = require("./IDWiseEventListeners");
|
|
9
|
+
const LINKING_ERROR = `The package 'idwise-mobile-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
10
|
+
ios: "- You have run 'pod install'\n",
|
|
11
|
+
default: ''
|
|
12
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
13
|
+
const RNIDWise = _reactNative.NativeModules.IdwiseMobileSdk ? _reactNative.NativeModules.IdwiseMobileSdk : new Proxy({}, {
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const initialize = (clientKey, theme, callback) => {
|
|
19
|
+
console.log('IDWise - initialize');
|
|
20
|
+
(0, _IDWiseEventListeners.setInitializeEventListeners)(callback);
|
|
21
|
+
RNIDWise.initialize(clientKey, theme);
|
|
22
|
+
};
|
|
23
|
+
const startJourney = (journeyDefinitionId, referenceNo, locale, applicantDetails, journeyCallback, stepCallback) => {
|
|
24
|
+
console.log('IDWise - startDynamicJourney');
|
|
25
|
+
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
26
|
+
(0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
|
|
27
|
+
RNIDWise.startDynamicJourney(journeyDefinitionId, referenceNo, locale, applicantDetails);
|
|
28
|
+
};
|
|
29
|
+
const resumeJourney = (journeyDefinitionId, journeyId, locale, journeyCallback, stepCallback) => {
|
|
30
|
+
console.log('IDWise - resumeDynamicJourney');
|
|
31
|
+
(0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
|
|
32
|
+
(0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
|
|
33
|
+
RNIDWise.resumeDynamicJourney(journeyDefinitionId, journeyId, locale);
|
|
34
|
+
};
|
|
35
|
+
const startStep = stepId => RNIDWise.startStep(stepId);
|
|
36
|
+
const skipStep = stepId => RNIDWise.skipStep(stepId);
|
|
37
|
+
const getJourneySummary = callback => {
|
|
38
|
+
console.log('IDWise - getJourneySummary');
|
|
39
|
+
(0, _IDWiseEventListeners.setJourneySummaryEventListener)(callback);
|
|
40
|
+
RNIDWise.getJourneySummary();
|
|
41
|
+
};
|
|
42
|
+
const finishJourney = () => {
|
|
43
|
+
console.log('IDWise - finishDynamicJourney');
|
|
44
|
+
RNIDWise.finishDynamicJourney();
|
|
45
|
+
};
|
|
46
|
+
const unloadSDK = () => {
|
|
47
|
+
console.log('IDWise - unloadSDK');
|
|
48
|
+
RNIDWise.unloadSDK();
|
|
49
|
+
};
|
|
50
|
+
const IDWiseDynamic = exports.IDWiseDynamic = {
|
|
51
|
+
initialize,
|
|
52
|
+
startJourney,
|
|
53
|
+
startStep,
|
|
54
|
+
getJourneySummary,
|
|
55
|
+
finishJourney,
|
|
56
|
+
skipStep,
|
|
57
|
+
resumeJourney,
|
|
58
|
+
unloadSDK
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=IDWiseDynamic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_IDWiseEventListeners","LINKING_ERROR","Platform","select","ios","default","RNIDWise","NativeModules","IdwiseMobileSdk","Proxy","get","Error","initialize","clientKey","theme","callback","console","log","setInitializeEventListeners","startJourney","journeyDefinitionId","referenceNo","locale","applicantDetails","journeyCallback","stepCallback","setJourneyEventListeners","setStepEventListeners","startDynamicJourney","resumeJourney","journeyId","resumeDynamicJourney","startStep","stepId","skipStep","getJourneySummary","setJourneySummaryEventListener","finishJourney","finishDynamicJourney","unloadSDK","IDWiseDynamic","exports"],"sourceRoot":"../../src","sources":["IDWiseDynamic.js"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAOA,MAAME,aAAa,GACjB,4EAA4E,GAC5EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,QAAQ,GAAGC,0BAAa,CAACC,eAAe,GAC1CD,0BAAa,CAACC,eAAe,GAC7B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAA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