@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.
@@ -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.5'
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'
@@ -374,41 +374,10 @@ class InfivizShotsReactSdkModule(private val reactContext: ReactApplicationConte
374
374
  ) {
375
375
  InfiVizShotsSDK.fetchSessionDetails(
376
376
  currentActivity!!,
377
- temporarySessionID, object : SDKCallback<String> {
378
- override fun onSuccess(response: String) {
379
- try {
380
- // Parse the response JSON string
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infilectorg/infiviz-shots-react-sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "React Native package for native libraries",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",