react-native-mytatva-rn-sdk 1.2.83 → 1.2.85
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/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +8 -0
- package/android/src/main/java/com/mytatvarnsdk/network/AuthenticateSDKService.kt +1 -1
- package/ios/Support/API.swift +1 -1
- package/ios/ViewControllers/ConnectToSensorViewController.swift +22 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ import android.content.pm.PackageManager
|
|
|
9
9
|
import android.graphics.Color
|
|
10
10
|
import android.os.Bundle
|
|
11
11
|
import android.util.Log
|
|
12
|
+
import android.util.TypedValue
|
|
12
13
|
import android.view.Gravity
|
|
13
14
|
import android.view.View
|
|
14
15
|
import android.view.ViewGroup
|
|
@@ -144,6 +145,11 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
144
145
|
|
|
145
146
|
Glide.with(this).asGif().load(R.drawable.warning).into(binding.ivGif)
|
|
146
147
|
|
|
148
|
+
// Restore original text size (24sp) for non-validation API errors
|
|
149
|
+
binding.tvFailTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24f)
|
|
150
|
+
binding.tvFailTitle.text = "Unable to detect sensor"
|
|
151
|
+
binding.tvFailTitle.setTextColor(Color.parseColor("#101828"))
|
|
152
|
+
|
|
147
153
|
binding.btnSupport.tvProceed.text = "Contact Support"
|
|
148
154
|
binding.btnRetry.tvProceed.text = "Retry"
|
|
149
155
|
|
|
@@ -428,6 +434,8 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
428
434
|
// Replace "Unable to detect sensor" title with the error message in RED
|
|
429
435
|
binding.tvFailTitle.text = message
|
|
430
436
|
binding.tvFailTitle.setTextColor(Color.RED)
|
|
437
|
+
// Set text size to 16sp (same as iOS) for validation API error message
|
|
438
|
+
binding.tvFailTitle.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f)
|
|
431
439
|
binding.tvFailInstructions.visibility = View.GONE
|
|
432
440
|
binding.tvReason.visibility = View.GONE
|
|
433
441
|
|
|
@@ -253,7 +253,7 @@ class AuthenticateSDKService(val scope: CoroutineScope) {
|
|
|
253
253
|
)
|
|
254
254
|
|
|
255
255
|
val baseUrl = if (environment == TATVA_ENVIRONMENT.PROD) PROD_BASE_URL else STAGE_BASE_URL
|
|
256
|
-
val url = "$baseUrl/helper/
|
|
256
|
+
val url = "$baseUrl/helper/device_verification?deviceId=$sensorId&deviceType=CGM&vendor=diasens"
|
|
257
257
|
|
|
258
258
|
Log.d("API Response", "Device Verification URL: $url")
|
|
259
259
|
|
package/ios/Support/API.swift
CHANGED
|
@@ -322,7 +322,7 @@ class API {
|
|
|
322
322
|
onSuccess: @escaping (Int, Bool, String) -> Void,
|
|
323
323
|
onFailure: @escaping () -> Void
|
|
324
324
|
) {
|
|
325
|
-
let urlString = (envType.lowercased() == "uat" ? STAGE_BASE_URL : PROD_BASE_URL) + "/helper/
|
|
325
|
+
let urlString = (envType.lowercased() == "uat" ? STAGE_BASE_URL : PROD_BASE_URL) + "/helper/device_verification?deviceId=\(sensorId)&deviceType=CGM&vendor=diasens"
|
|
326
326
|
|
|
327
327
|
guard let url = URL(string: urlString) else {
|
|
328
328
|
print("===>verifyDevice: Invalid URL")
|
|
@@ -469,7 +469,8 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
|
|
|
469
469
|
case .error:
|
|
470
470
|
switch enumFailureTableRow(rawValue: indexPath.row) {
|
|
471
471
|
case .failAnimation:
|
|
472
|
-
|
|
472
|
+
// Reduced height for validation API error, normal for other errors
|
|
473
|
+
return (deviceVerificationErrorMessage != nil) ? 80 : 120
|
|
473
474
|
case .image:
|
|
474
475
|
return (UIScreen.main.bounds.width * 120 / 390) + 20
|
|
475
476
|
default:
|
|
@@ -548,6 +549,17 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
|
|
|
548
549
|
let cell: ImageTVC = tableView.dequeueReusableCell(for: indexPath)
|
|
549
550
|
cell.displayImageView.loadGif(named: "failure")
|
|
550
551
|
cell.bottomConstraint.constant = 11
|
|
552
|
+
// Hide camera view to prevent it from overlapping error content (cell reuse)
|
|
553
|
+
cell.cameraView.isHidden = true
|
|
554
|
+
cell.displayImageView.isHidden = false
|
|
555
|
+
// Scale down only for validation API error (65% of original size)
|
|
556
|
+
if deviceVerificationErrorMessage != nil {
|
|
557
|
+
cell.displayImageView.contentMode = .scaleAspectFit
|
|
558
|
+
cell.displayImageView.clipsToBounds = true
|
|
559
|
+
cell.displayImageView.transform = CGAffineTransform(scaleX: 0.65, y: 0.65)
|
|
560
|
+
} else {
|
|
561
|
+
cell.displayImageView.transform = .identity
|
|
562
|
+
}
|
|
551
563
|
return cell
|
|
552
564
|
case .details:
|
|
553
565
|
let cell: VerticalLabelsTVC = tableView.dequeueReusableCell(for: indexPath)
|
|
@@ -556,9 +568,15 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
|
|
|
556
568
|
if let verificationError = deviceVerificationErrorMessage {
|
|
557
569
|
cell.label2.text = verificationError
|
|
558
570
|
cell.label2.textColor = .red
|
|
571
|
+
// Use smaller font for validation API error message (default title is 32pt)
|
|
572
|
+
cell.label2.font = FontManager.font(ofSize: 16, weight: .medium)
|
|
573
|
+
cell.label2.numberOfLines = 0
|
|
559
574
|
cell.label3.text = ""
|
|
560
575
|
} else {
|
|
561
576
|
cell.label2.text = "Unable to detect sensor"
|
|
577
|
+
// Restore default title font for normal error
|
|
578
|
+
cell.label2.font = FontManager.title
|
|
579
|
+
cell.label2.textColor = CustomColor.shared.primaryBlack
|
|
562
580
|
cell.label3.text = "Make sure there is proper lighting in the room"
|
|
563
581
|
}
|
|
564
582
|
return cell
|
|
@@ -567,6 +585,9 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
|
|
|
567
585
|
cell.topConstraint.constant = 0
|
|
568
586
|
cell.displayImageView.image = loadImage(named: "flip_the_reference")
|
|
569
587
|
cell.displayImageView.contentMode = .scaleAspectFill
|
|
588
|
+
// Hide camera view to prevent it from overlapping error content (cell reuse)
|
|
589
|
+
cell.cameraView.isHidden = true
|
|
590
|
+
cell.displayImageView.isHidden = false
|
|
570
591
|
return cell
|
|
571
592
|
case .watchVideo:
|
|
572
593
|
let cell: WatchVideoTVC = tableView.dequeueReusableCell(for: indexPath)
|