idwise-cordova-sdk 5.0.3 → 5.2.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idwise-cordova-sdk",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "IDWise SDK wrapper for Cordova projects",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "idwise-cordova-sdk",
|
|
@@ -15,5 +15,6 @@
|
|
|
15
15
|
"cordova-android"
|
|
16
16
|
],
|
|
17
17
|
"author": "Waqar-Khan",
|
|
18
|
-
"license": "ISC"
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"type": "module"
|
|
19
20
|
}
|
package/plugin.xml
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<platform name="ios">
|
|
12
12
|
<config-file parent="/*" target="config.xml">
|
|
13
13
|
<preference name="UseSwiftLanguageVersion" value="4.2" />
|
|
14
|
-
<preference name="deployment-target" value="
|
|
14
|
+
<preference name="deployment-target" value="13.0" />
|
|
15
15
|
<feature name="IDWiseCordovaSDK">
|
|
16
16
|
<param name="ios-package" value="IDWiseCordovaSDK" />
|
|
17
17
|
</feature>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<source url="https://github.com/idwise/ios-sdk.git" />
|
|
25
25
|
</config>
|
|
26
26
|
<pods use-frameworks="true">
|
|
27
|
-
<pod name="IDWise" spec="5.0
|
|
27
|
+
<pod name="IDWise" spec="5.2.0" />
|
|
28
28
|
</pods>
|
|
29
29
|
</podspec>
|
|
30
30
|
</platform>
|
|
@@ -17,6 +17,7 @@ import org.json.JSONObject
|
|
|
17
17
|
import java.io.ByteArrayOutputStream
|
|
18
18
|
import android.graphics.Bitmap
|
|
19
19
|
import android.util.Base64
|
|
20
|
+
import com.google.gson.JsonObject
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* This class echoes a string called from JavaScript.
|
|
@@ -51,19 +52,21 @@ class IDWiseCordovaSDK : CordovaPlugin() {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
"startJourney" -> {
|
|
55
|
+
Log.d("startJourney","$args")
|
|
54
56
|
val flowId = args.getString(0)
|
|
55
57
|
val referenceNumber = args.getString(1)
|
|
56
58
|
val locale = args.getString(2)
|
|
57
|
-
val applicantDetails = args.
|
|
59
|
+
val applicantDetails = args.getJSONObject(3)
|
|
58
60
|
startJourney(flowId, referenceNumber, locale, applicantDetails, callbackContext)
|
|
59
61
|
return true
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
"startDynamicJourney" -> {
|
|
65
|
+
Log.d("startJourney","$args")
|
|
63
66
|
val flowId = args.getString(0)
|
|
64
67
|
val referenceNumber = args.getString(1)
|
|
65
68
|
val locale = args.getString(2)
|
|
66
|
-
val applicantDetails = args.
|
|
69
|
+
val applicantDetails = args.getJSONObject(3)
|
|
67
70
|
startDynamicJourney(flowId, referenceNumber, locale, applicantDetails, callbackContext)
|
|
68
71
|
return true
|
|
69
72
|
}
|
|
@@ -140,14 +143,14 @@ class IDWiseCordovaSDK : CordovaPlugin() {
|
|
|
140
143
|
flowId: String,
|
|
141
144
|
referenceNumber: String,
|
|
142
145
|
locale: String,
|
|
143
|
-
applicantDetails:
|
|
146
|
+
applicantDetails: JSONObject?,
|
|
144
147
|
callbackContext: CallbackContext
|
|
145
148
|
) {
|
|
146
149
|
journeyCallbackContext = callbackContext
|
|
147
150
|
|
|
148
151
|
val applicantDetailsObject: HashMap<String, String>? =
|
|
149
|
-
if (applicantDetails == null
|
|
150
|
-
|
|
152
|
+
if (applicantDetails == null) null else Gson().fromJson(
|
|
153
|
+
applicantDetails.toString(), object : TypeToken<HashMap<String, String>>() {}.type
|
|
151
154
|
)
|
|
152
155
|
|
|
153
156
|
IDWise.startJourney(
|
|
@@ -192,16 +195,16 @@ class IDWiseCordovaSDK : CordovaPlugin() {
|
|
|
192
195
|
flowId: String,
|
|
193
196
|
referenceNumber: String,
|
|
194
197
|
locale: String,
|
|
195
|
-
applicantDetails:
|
|
198
|
+
applicantDetails: JSONObject?,
|
|
196
199
|
callbackContext: CallbackContext
|
|
197
200
|
) {
|
|
198
201
|
journeyCallbackContext = callbackContext
|
|
199
202
|
|
|
200
203
|
val applicantDetailsObject: HashMap<String, String>? =
|
|
201
|
-
if (applicantDetails == null
|
|
202
|
-
|
|
204
|
+
if (applicantDetails == null) null else Gson().fromJson(
|
|
205
|
+
applicantDetails.toString(), object : TypeToken<HashMap<String, String>>() {}.type
|
|
203
206
|
)
|
|
204
|
-
|
|
207
|
+
|
|
205
208
|
IDWiseDynamic.startJourney(
|
|
206
209
|
this.cordova.activity,
|
|
207
210
|
flowId,
|
|
@@ -320,8 +323,10 @@ class IDWiseCordovaSDK : CordovaPlugin() {
|
|
|
320
323
|
|
|
321
324
|
val originalImage = convertImageToBase64String(stepCapturedInfo.originalImage)
|
|
322
325
|
val croppedImage = convertImageToBase64String(stepCapturedInfo.croppedImage)
|
|
326
|
+
val originalImageBack = convertImageToBase64String(stepCapturedInfo.originalImageBack)
|
|
327
|
+
val croppedImageBack = convertImageToBase64String(stepCapturedInfo.croppedImageBack)
|
|
323
328
|
|
|
324
|
-
val capturedResponse = OnStepCapturedInfoExposed(stepCapturedInfo.stepId,originalImage,croppedImage)
|
|
329
|
+
val capturedResponse = OnStepCapturedInfoExposed(stepCapturedInfo.stepId.toString(),originalImage,croppedImage,originalImageBack,croppedImageBack)
|
|
325
330
|
|
|
326
331
|
params.put("data", gson.toJson(capturedResponse))
|
|
327
332
|
|
|
@@ -379,9 +384,11 @@ class IDWiseCordovaSDK : CordovaPlugin() {
|
|
|
379
384
|
return Base64.encodeToString(b, Base64.DEFAULT)
|
|
380
385
|
}
|
|
381
386
|
|
|
382
|
-
|
|
387
|
+
internal data class OnStepCapturedInfoExposed(
|
|
383
388
|
val stepId:String,
|
|
384
389
|
val originalImage:String?,
|
|
385
|
-
val croppedImage:String
|
|
390
|
+
val croppedImage:String?,
|
|
391
|
+
val originalImageBack:String?,
|
|
392
|
+
val croppedImageBack:String
|
|
386
393
|
)
|
|
387
394
|
}
|
|
@@ -46,13 +46,13 @@ import Foundation
|
|
|
46
46
|
let flowId = command.arguments[0] as? String ?? ""
|
|
47
47
|
let referenceNumber = command.arguments[1] as? String ?? ""
|
|
48
48
|
let locale = command.arguments[2] as? String ?? ""
|
|
49
|
-
let applicantDetails = command.arguments[3] as? String
|
|
49
|
+
let applicantDetails = command.arguments[3] as? [String:String]
|
|
50
50
|
|
|
51
51
|
self.journeyCallbackId = command.callbackId
|
|
52
52
|
|
|
53
53
|
IDWise.startJourney(
|
|
54
54
|
flowId: flowId, referenceNumber: referenceNumber,
|
|
55
|
-
locale: locale, applicantDetails:
|
|
55
|
+
locale: locale, applicantDetails: applicantDetails, journeyCallbacks: self)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
@objc(startDynamicJourney:)
|
|
@@ -60,13 +60,13 @@ import Foundation
|
|
|
60
60
|
let flowId = command.arguments[0] as? String ?? ""
|
|
61
61
|
let referenceNumber = command.arguments[1] as? String ?? ""
|
|
62
62
|
let locale = command.arguments[2] as? String ?? ""
|
|
63
|
-
let applicantDetails = command.arguments[3] as? String
|
|
63
|
+
let applicantDetails = command.arguments[3] as? [String:String]
|
|
64
64
|
|
|
65
65
|
self.journeyCallbackId = command.callbackId
|
|
66
66
|
|
|
67
67
|
IDWiseDynamic.startJourney(
|
|
68
68
|
flowId: flowId, referenceNumber: referenceNumber,
|
|
69
|
-
locale: locale, applicantDetails:
|
|
69
|
+
locale: locale, applicantDetails: applicantDetails, journeyCallbacks: self, stepCallbacks: self)
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
@objc(resumeJourney:)
|
|
@@ -119,9 +119,9 @@ import Foundation
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
} else {
|
|
122
|
-
if let err =
|
|
122
|
+
if let err = summaryError {
|
|
123
123
|
do {
|
|
124
|
-
let responseSummary = JourneySummaryExposed(summary:
|
|
124
|
+
let responseSummary = JourneySummaryExposed(summary: journeySummary,error: summaryError)
|
|
125
125
|
let jsonData = try JSONEncoder().encode(responseSummary)
|
|
126
126
|
let jsonString = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
127
127
|
let arguments = ["data": jsonString] as [String: Any]
|
|
@@ -206,8 +206,10 @@ extension IDWiseCordovaSDK: IDWiseJourneyCallbacks {
|
|
|
206
206
|
status: CDVCommandStatus_OK,
|
|
207
207
|
messageAs: arguments
|
|
208
208
|
)
|
|
209
|
+
print(arguments)
|
|
209
210
|
pluginResult?.keepCallback = true
|
|
210
211
|
self.commandDelegate!.send(pluginResult, callbackId: self.journeyCallbackId)
|
|
212
|
+
|
|
211
213
|
} catch {
|
|
212
214
|
print(error)
|
|
213
215
|
}
|
|
@@ -313,8 +315,10 @@ extension IDWiseCordovaSDK: IDWiseStepCallbacks {
|
|
|
313
315
|
|
|
314
316
|
let originalImage = convertImageToBase64String(img: stepCapturedInfo.originalImage)
|
|
315
317
|
let croppedImage = convertImageToBase64String(img: stepCapturedInfo.croppedImage)
|
|
318
|
+
let originalImageBack = convertImageToBase64String(img: stepCapturedInfo.originalImageBack)
|
|
319
|
+
let croppedImageBack = convertImageToBase64String(img: stepCapturedInfo.croppedImageBack)
|
|
316
320
|
|
|
317
|
-
let captureResponse = OnStepCapturedExposed(stepId: stepCapturedInfo.stepId, originalImage: originalImage, croppedImage: croppedImage)
|
|
321
|
+
let captureResponse = OnStepCapturedExposed(stepId: stepCapturedInfo.stepId, originalImage: originalImage, croppedImage: croppedImage, originalImageBack:originalImageBack, croppedImageBack: croppedImageBack)
|
|
318
322
|
|
|
319
323
|
let jsonData = try JSONEncoder().encode(captureResponse)
|
|
320
324
|
let json = String(data: jsonData, encoding: String.Encoding.utf8)
|
|
@@ -348,5 +352,7 @@ private struct OnStepCapturedExposed: Codable {
|
|
|
348
352
|
var stepId: String
|
|
349
353
|
var originalImage: String?
|
|
350
354
|
var croppedImage: String?
|
|
355
|
+
var originalImageBack: String?
|
|
356
|
+
var croppedImageBack: String?
|
|
351
357
|
}
|
|
352
358
|
|