@infilectorg/infiviz-shots-react-sdk 1.2.6 → 1.2.8
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
CHANGED
|
@@ -108,7 +108,7 @@ dependencies {
|
|
|
108
108
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
implementation 'com.infilect:infivizshots-sdk:RN-1.2.
|
|
111
|
+
implementation 'com.infilect:infivizshots-sdk:RN-1.2.7'
|
|
112
112
|
|
|
113
113
|
testImplementation 'junit:junit:4.13.2'
|
|
114
114
|
implementation 'com.github.bumptech.glide:glide:4.14.2'
|
package/android/src/main/java/com/infilect/infivizshotsreactsdk/InfivizShotsReactSdkModule.kt
CHANGED
|
@@ -288,6 +288,7 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
|
|
|
288
288
|
currentActivity!!,
|
|
289
289
|
tempSessionId, 22, metadataMap, object : SDKCallback<String?> {
|
|
290
290
|
override fun onSuccess(response: String?) {
|
|
291
|
+
Log.d("RESUME CAMERA",response + " Sample ")
|
|
291
292
|
promise.resolve(response)
|
|
292
293
|
}
|
|
293
294
|
|
|
@@ -374,41 +375,10 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
|
|
|
374
375
|
) {
|
|
375
376
|
InfiVizShotsSDK.fetchSessionDetails(
|
|
376
377
|
currentActivity!!,
|
|
377
|
-
temporarySessionID, object : SDKCallback<
|
|
378
|
-
override fun onSuccess(response:
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
val jsonObject = JSONObject(response)
|
|
382
|
-
// Check if data field exists and is a string
|
|
383
|
-
if (jsonObject.has("data")) {
|
|
384
|
-
val dataValue = jsonObject.get("data")
|
|
385
|
-
if (dataValue is String) {
|
|
386
|
-
val dataString = jsonObject.getString("data")
|
|
387
|
-
|
|
388
|
-
val sessionData = JSONObject(dataString)
|
|
389
|
-
// Create a new response object with parsed session data
|
|
390
|
-
val finalResponse = JSONObject()
|
|
391
|
-
finalResponse.put("data", sessionData)
|
|
392
|
-
finalResponse.put("status", jsonObject.optString("status", "723"))
|
|
393
|
-
finalResponse.put("message", jsonObject.optString("message", "Success"))
|
|
394
|
-
|
|
395
|
-
android.util.Log.i("InfivizShotsReactSdkModule", "Creating WritableMap for React Native...")
|
|
396
|
-
|
|
397
|
-
// Convert to WritableMap for React Native
|
|
398
|
-
val writableMap = Arguments.createMap()
|
|
399
|
-
writableMap.putMap("data", convertJsonToWritableMap(sessionData))
|
|
400
|
-
writableMap.putString("status", finalResponse.optString("status", "723"))
|
|
401
|
-
writableMap.putString("message", finalResponse.optString("message", "Success"))
|
|
402
|
-
promise.resolve(writableMap)
|
|
403
|
-
} else {
|
|
404
|
-
promise.resolve(convertJsonToWritableMap(jsonObject))
|
|
405
|
-
}
|
|
406
|
-
} else {
|
|
407
|
-
promise.resolve(convertJsonToWritableMap(jsonObject))
|
|
408
|
-
}
|
|
409
|
-
} catch (e: Exception) {
|
|
410
|
-
promise.resolve(response)
|
|
411
|
-
}
|
|
378
|
+
temporarySessionID, object : SDKCallback<InfiSession> {
|
|
379
|
+
override fun onSuccess(response: InfiSession) {
|
|
380
|
+
val responseJson = Gson().toJson(response)
|
|
381
|
+
promise.resolve(responseJson)
|
|
412
382
|
}
|
|
413
383
|
|
|
414
384
|
override fun onError(e: SDKExceptions) {
|