@infilectorg/infiviz-shots-react-sdk 1.2.6 → 1.2.7
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.6'
|
|
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
|
@@ -374,41 +374,10 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
|
|
|
374
374
|
) {
|
|
375
375
|
InfiVizShotsSDK.fetchSessionDetails(
|
|
376
376
|
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
|
-
}
|
|
377
|
+
temporarySessionID, object : SDKCallback<InfiSession> {
|
|
378
|
+
override fun onSuccess(response: InfiSession) {
|
|
379
|
+
val responseJson = Gson().toJson(response)
|
|
380
|
+
promise.resolve(responseJson)
|
|
412
381
|
}
|
|
413
382
|
|
|
414
383
|
override fun onError(e: SDKExceptions) {
|