idwise-react-native-sdk 5.7.7 → 5.7.9
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.
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
18
|
|
|
19
|
-
s.dependency 'IDWise', '5.7.
|
|
19
|
+
s.dependency 'IDWise', '5.7.8'
|
|
20
20
|
s.pod_target_xcconfig = {
|
|
21
21
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
22
22
|
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
@@ -9,6 +9,9 @@ import androidx.annotation.Nullable
|
|
|
9
9
|
import com.facebook.react.bridge.*
|
|
10
10
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
11
11
|
import com.fasterxml.jackson.databind.ObjectMapper
|
|
12
|
+
import com.fasterxml.jackson.databind.MapperFeature
|
|
13
|
+
import com.fasterxml.jackson.annotation.PropertyAccessor
|
|
14
|
+
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility
|
|
12
15
|
import com.idwise.sdk.IDWise
|
|
13
16
|
import com.idwise.sdk.IDWiseDynamic
|
|
14
17
|
import com.idwise.sdk.IDWiseJourneyCallbacks
|
|
@@ -20,6 +23,7 @@ import java.io.ByteArrayOutputStream
|
|
|
20
23
|
class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationContext) :
|
|
21
24
|
NativeIdwiseReactNativeSdkSpec(reactContext) {
|
|
22
25
|
|
|
26
|
+
val objectMapper = ObjectMapper()
|
|
23
27
|
override fun getName(): String {
|
|
24
28
|
return NAME
|
|
25
29
|
}
|
|
@@ -42,6 +46,12 @@ class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationConte
|
|
|
42
46
|
|
|
43
47
|
@ReactMethod
|
|
44
48
|
override fun initialize(clientKey: String, theme: String) {
|
|
49
|
+
|
|
50
|
+
objectMapper.configure(MapperFeature.AUTO_DETECT_IS_GETTERS, false);
|
|
51
|
+
objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
|
|
52
|
+
objectMapper.setVisibility(PropertyAccessor.GETTER, Visibility.NONE);
|
|
53
|
+
objectMapper.setVisibility(PropertyAccessor.SETTER, Visibility.NONE);
|
|
54
|
+
|
|
45
55
|
val idwiseTheme: IDWiseTheme = try {
|
|
46
56
|
IDWiseTheme.valueOf(theme!!)
|
|
47
57
|
} catch (e: Exception) {
|
|
@@ -50,7 +60,7 @@ class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationConte
|
|
|
50
60
|
|
|
51
61
|
IDWise.initialize(clientKey, idwiseTheme) { error ->
|
|
52
62
|
val params: WritableMap = Arguments.createMap()
|
|
53
|
-
params.putString("data",
|
|
63
|
+
params.putString("data",objectMapper.writeValueAsString(error))
|
|
54
64
|
sendEvent("onInitializeError", params)
|
|
55
65
|
}
|
|
56
66
|
}
|
|
@@ -149,7 +159,7 @@ class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationConte
|
|
|
149
159
|
|
|
150
160
|
val summaryResponse = JourneySummaryExposed(summary,error)
|
|
151
161
|
|
|
152
|
-
argsMap.putString("data",
|
|
162
|
+
argsMap.putString("data", objectMapper.writeValueAsString(summaryResponse))
|
|
153
163
|
sendEvent("onJourneySummary", argsMap)
|
|
154
164
|
|
|
155
165
|
}
|
|
@@ -172,37 +182,37 @@ class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationConte
|
|
|
172
182
|
override fun onJourneyStarted(journeyInfo: JourneyStartedInfo) {
|
|
173
183
|
val params: WritableMap = Arguments.createMap()
|
|
174
184
|
|
|
175
|
-
params.putString("data",
|
|
185
|
+
params.putString("data", objectMapper.writeValueAsString(journeyInfo))
|
|
176
186
|
sendEvent("onJourneyStarted", params)
|
|
177
187
|
}
|
|
178
188
|
|
|
179
189
|
override fun onJourneyResumed(journeyInfo: JourneyResumedInfo) {
|
|
180
190
|
val params: WritableMap = Arguments.createMap()
|
|
181
|
-
params.putString("data",
|
|
191
|
+
params.putString("data", objectMapper.writeValueAsString(journeyInfo))
|
|
182
192
|
sendEvent("onJourneyResumed", params)
|
|
183
193
|
}
|
|
184
194
|
|
|
185
195
|
override fun onJourneyCompleted(journeyInfo: JourneyCompletedInfo) {
|
|
186
196
|
val params: WritableMap = Arguments.createMap()
|
|
187
|
-
params.putString("data",
|
|
197
|
+
params.putString("data", objectMapper.writeValueAsString(journeyInfo))
|
|
188
198
|
sendEvent("onJourneyCompleted", params)
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
override fun onJourneyBlocked(journeyInfo: JourneyBlockedInfo) {
|
|
192
202
|
val params: WritableMap = Arguments.createMap()
|
|
193
|
-
params.putString("data",
|
|
203
|
+
params.putString("data", objectMapper.writeValueAsString(journeyInfo))
|
|
194
204
|
sendEvent("onJourneyBlocked", params)
|
|
195
205
|
}
|
|
196
206
|
|
|
197
207
|
override fun onJourneyCancelled(journeyInfo: JourneyCancelledInfo) {
|
|
198
208
|
val params: WritableMap = Arguments.createMap()
|
|
199
|
-
params.putString("data",
|
|
209
|
+
params.putString("data", objectMapper.writeValueAsString(journeyInfo))
|
|
200
210
|
sendEvent("onJourneyCancelled", params)
|
|
201
211
|
}
|
|
202
212
|
|
|
203
213
|
override fun onError(error: IDWiseError) {
|
|
204
214
|
val params: WritableMap = Arguments.createMap()
|
|
205
|
-
params.putString("data",
|
|
215
|
+
params.putString("data", objectMapper.writeValueAsString(error))
|
|
206
216
|
sendEvent("onJourneyError", params)
|
|
207
217
|
}
|
|
208
218
|
}
|
|
@@ -217,25 +227,25 @@ class IdwiseReactNativeSdkModule(private val reactContext: ReactApplicationConte
|
|
|
217
227
|
val croppedImageBack = convertImageToBase64String(stepCapturedInfo.croppedImageBack)
|
|
218
228
|
val response = OnStepCapturedInfoExposed(stepCapturedInfo.stepId.toString(),originalImage,croppedImage,originalImageBack,croppedImageBack)
|
|
219
229
|
|
|
220
|
-
params.putString("data",
|
|
230
|
+
params.putString("data", objectMapper.writeValueAsString(response))
|
|
221
231
|
sendEvent("onStepCaptured", params)
|
|
222
232
|
}
|
|
223
233
|
|
|
224
234
|
override fun onStepResult(stepInfo:StepResultInfo) {
|
|
225
235
|
val argsMap: WritableMap = Arguments.createMap()
|
|
226
|
-
argsMap.putString("data",
|
|
236
|
+
argsMap.putString("data", objectMapper.writeValueAsString(stepInfo))
|
|
227
237
|
sendEvent("onStepResult", argsMap)
|
|
228
238
|
}
|
|
229
239
|
|
|
230
240
|
override fun onStepSkipped(stepInfo:StepSkippedInfo) {
|
|
231
241
|
val params: WritableMap = Arguments.createMap()
|
|
232
|
-
params.putString("data",
|
|
242
|
+
params.putString("data", objectMapper.writeValueAsString(stepInfo))
|
|
233
243
|
sendEvent("onStepSkipped", params)
|
|
234
244
|
}
|
|
235
245
|
|
|
236
246
|
override fun onStepCancelled(stepInfo:StepCancelledInfo) {
|
|
237
247
|
val params: WritableMap = Arguments.createMap()
|
|
238
|
-
params.putString("data",
|
|
248
|
+
params.putString("data", objectMapper.writeValueAsString(stepInfo))
|
|
239
249
|
sendEvent("onStepCancelled", params)
|
|
240
250
|
}
|
|
241
251
|
}
|