react-native-mytatva-rn-sdk 1.2.96 → 1.2.98
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/CgmTrackyLibModule.kt +84 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +158 -18
- package/android/src/main/java/com/mytatvarnsdk/activity/HelpActivity.kt +3 -9
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +51 -16
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +29 -13
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +29 -13
- package/android/src/main/java/com/mytatvarnsdk/activity/QRActivity.kt +146 -5
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +108 -13
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +43 -16
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +26 -15
- package/android/src/main/java/com/mytatvarnsdk/activity/VideoActivity.kt +96 -50
- package/android/src/main/java/com/mytatvarnsdk/network/AuthenticateSDKService.kt +113 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/CgmModuleSentryLog.kt +205 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/CgmSentryLog.kt +28 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/CustomerSupportConfig.kt +137 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/ToolbarSupportHelper.kt +83 -0
- package/ios/Custom/CustomTopUIView.swift +25 -0
- package/ios/MyReactNativeBridge.m +4 -0
- package/ios/Support/API.swift +117 -18
- package/ios/Support/CustomTopViewSupportHelper.swift +55 -0
- package/ios/Support/CustomerSupportConfig.swift +169 -0
- package/ios/Support/Global.swift +2 -2
- package/ios/Support/GlobalYouTubePlayerView.swift +102 -11
- package/ios/ViewControllers/AttachTransmitterViewController.swift +16 -21
- package/ios/ViewControllers/ChatWithExpertViewController.swift +1 -7
- package/ios/ViewControllers/ConnectToSensorViewController.swift +16 -21
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +16 -21
- package/ios/ViewControllers/ProvidePermissionViewController.swift +16 -21
- package/ios/ViewControllers/PutOnTheSensorViewController.swift +16 -21
- package/ios/ViewControllers/StartConnectionViewController.swift +18 -25
- package/ios/ViewModel/FinalViewModel.swift +2 -2
- package/package.json +1 -1
|
@@ -15,6 +15,9 @@ import cgmblelib.utils.SharedPreferencesLibraryUtil
|
|
|
15
15
|
import com.myc.library_zxing.QRFragment
|
|
16
16
|
import com.myc.library_zxing.view.OnFragmentListener
|
|
17
17
|
import com.mytatvarnsdk.R
|
|
18
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
19
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
20
|
+
import io.sentry.SentryLogLevel
|
|
18
21
|
import ist.com.sdk.AlgorithmTools
|
|
19
22
|
import ist.com.sdk.KRDecodeData
|
|
20
23
|
|
|
@@ -28,6 +31,18 @@ class QRActivity : AppCompatActivity(), View.OnClickListener {
|
|
|
28
31
|
findViewById<View?>(R.id.btnLeft).setOnClickListener(this)
|
|
29
32
|
mPocDevice = intent.getParcelableExtra("device")
|
|
30
33
|
if (mPocDevice == null) {
|
|
34
|
+
safeLogModuleEvent {
|
|
35
|
+
logModuleEvent(
|
|
36
|
+
where = "QRActivity.missingDevice",
|
|
37
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | QR scan started without transmitter device",
|
|
38
|
+
level = SentryLogLevel.WARN,
|
|
39
|
+
attributes = mapOf(
|
|
40
|
+
"error_message" to "QR scan started without transmitter device",
|
|
41
|
+
"screen" to javaClass.simpleName,
|
|
42
|
+
),
|
|
43
|
+
logsOnly = true,
|
|
44
|
+
)
|
|
45
|
+
}
|
|
31
46
|
finish()
|
|
32
47
|
}
|
|
33
48
|
}
|
|
@@ -36,9 +51,41 @@ class QRActivity : AppCompatActivity(), View.OnClickListener {
|
|
|
36
51
|
super.onResume()
|
|
37
52
|
mQRFragment = QRFragment.newInstance(object : OnFragmentListener {
|
|
38
53
|
override fun onPermissionRequestFail(isForever: Boolean) {
|
|
54
|
+
val errorMessage = if (isForever) {
|
|
55
|
+
"Camera permission denied permanently"
|
|
56
|
+
} else {
|
|
57
|
+
"Camera permission denied"
|
|
58
|
+
}
|
|
59
|
+
safeLogModuleEvent {
|
|
60
|
+
logModuleEvent(
|
|
61
|
+
where = "QRActivity.cameraPermissionDenied",
|
|
62
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorMessage",
|
|
63
|
+
level = SentryLogLevel.WARN,
|
|
64
|
+
attributes = mapOf(
|
|
65
|
+
"error_message" to errorMessage,
|
|
66
|
+
"screen" to javaClass.simpleName,
|
|
67
|
+
"permission_denied_forever" to isForever.toString(),
|
|
68
|
+
),
|
|
69
|
+
logsOnly = true,
|
|
70
|
+
)
|
|
71
|
+
}
|
|
39
72
|
}
|
|
40
73
|
|
|
41
74
|
override fun onCameraOpenError(e: Exception?) {
|
|
75
|
+
val errorMessage = e?.message ?: "Camera failed to open"
|
|
76
|
+
safeLogModuleEvent {
|
|
77
|
+
logModuleEvent(
|
|
78
|
+
where = "QRActivity.cameraOpenError",
|
|
79
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorMessage",
|
|
80
|
+
level = SentryLogLevel.WARN,
|
|
81
|
+
throwable = e,
|
|
82
|
+
attributes = mapOf(
|
|
83
|
+
"error_message" to errorMessage,
|
|
84
|
+
"screen" to javaClass.simpleName,
|
|
85
|
+
),
|
|
86
|
+
logsOnly = true,
|
|
87
|
+
)
|
|
88
|
+
}
|
|
42
89
|
}
|
|
43
90
|
|
|
44
91
|
override fun onScanResult(messages: String?, bitmap: Bitmap?) {
|
|
@@ -71,12 +118,47 @@ class QRActivity : AppCompatActivity(), View.OnClickListener {
|
|
|
71
118
|
*/
|
|
72
119
|
private fun decodeMessageCt3(message: String) {
|
|
73
120
|
Log.d("QR Info ==> ", "decodeMessageCt3: $message")
|
|
121
|
+
try {
|
|
122
|
+
safeLogModuleEvent {
|
|
123
|
+
logModuleEvent(
|
|
124
|
+
where = "cgmJourney.cgm_qr_scanned",
|
|
125
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=cgm_qr_scanned",
|
|
126
|
+
level = SentryLogLevel.INFO,
|
|
127
|
+
jsonPayload = message,
|
|
128
|
+
attributes = mapOf(
|
|
129
|
+
"journey_step" to "cgm_qr_scanned",
|
|
130
|
+
"screen" to javaClass.simpleName,
|
|
131
|
+
),
|
|
132
|
+
logsOnly = true,
|
|
133
|
+
)
|
|
134
|
+
}
|
|
74
135
|
|
|
75
|
-
|
|
136
|
+
val decodeData: KRDecodeData = AlgorithmTools.getInstance().decodeCT(message.toCharArray())
|
|
76
137
|
|
|
77
|
-
|
|
138
|
+
Log.d("QR Info ==> ", "decodeData: $decodeData")
|
|
78
139
|
|
|
79
|
-
|
|
140
|
+
showMessage(message, decodeData.k, decodeData.r, message)
|
|
141
|
+
} catch (e: Exception) {
|
|
142
|
+
val errorMessage = e.message ?: "QR decode failed"
|
|
143
|
+
safeLogModuleEvent {
|
|
144
|
+
logModuleEvent(
|
|
145
|
+
where = "QRActivity.decodeMessageCt3",
|
|
146
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorMessage",
|
|
147
|
+
level = SentryLogLevel.WARN,
|
|
148
|
+
throwable = e,
|
|
149
|
+
attributes = mapOf(
|
|
150
|
+
"error_message" to errorMessage,
|
|
151
|
+
"screen" to javaClass.simpleName,
|
|
152
|
+
"qr_raw" to message,
|
|
153
|
+
),
|
|
154
|
+
logsOnly = true,
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
mQRFragment?.restartPreviewAfterDelay(0)
|
|
159
|
+
} catch (_: Throwable) {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
80
162
|
}
|
|
81
163
|
|
|
82
164
|
fun showMessage(message: String?, k: Float, r: Float, sensorInfo: String?) {
|
|
@@ -87,20 +169,79 @@ class QRActivity : AppCompatActivity(), View.OnClickListener {
|
|
|
87
169
|
val qrInformation: QRInformation? = prefsHelper.qrInformation
|
|
88
170
|
|
|
89
171
|
Log.d("qrInformation==> ", "mPocDevice: ${mPocDevice.toString()}")
|
|
90
|
-
|
|
172
|
+
val isEffective = qrInformation?.isEffective(mPocDevice?.name, r, k) ?: false
|
|
173
|
+
safeLogModuleEvent {
|
|
174
|
+
logModuleEvent(
|
|
175
|
+
where = "cgmJourney.cgm_qr_is_effective",
|
|
176
|
+
message = "CGM journey | screen=${javaClass.simpleName} | isEffective=$isEffective",
|
|
177
|
+
level = SentryLogLevel.INFO,
|
|
178
|
+
jsonPayload = isEffective.toString(),
|
|
179
|
+
attributes = mapOf(
|
|
180
|
+
"journey_step" to "cgm_qr_is_effective",
|
|
181
|
+
"screen" to javaClass.simpleName,
|
|
182
|
+
"is_effective" to isEffective.toString(),
|
|
183
|
+
),
|
|
184
|
+
logsOnly = true,
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
if (isEffective && qrInformation != null) {
|
|
91
188
|
Log.d("qrInformation==> ", "qrInformation: $qrInformation")
|
|
189
|
+
safeLogModuleEvent {
|
|
190
|
+
logModuleEvent(
|
|
191
|
+
where = "cgmJourney.cgm_qr_validation_success",
|
|
192
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=cgm_qr_validation_success",
|
|
193
|
+
level = SentryLogLevel.INFO,
|
|
194
|
+
jsonPayload = qrInformation.toString(),
|
|
195
|
+
attributes = mapOf(
|
|
196
|
+
"journey_step" to "cgm_qr_validation_success",
|
|
197
|
+
"screen" to javaClass.simpleName,
|
|
198
|
+
"transmitter_name" to (mPocDevice?.name ?: ""),
|
|
199
|
+
"sensor_id" to (qrInformation.sensor ?: ""),
|
|
200
|
+
),
|
|
201
|
+
logsOnly = true,
|
|
202
|
+
)
|
|
203
|
+
}
|
|
92
204
|
setResult(RESULT_OK, Intent().putExtra("device", mPocDevice as Parcelable))
|
|
93
205
|
finish()
|
|
94
206
|
} else {
|
|
207
|
+
val failMessage = getString(R.string.verification_fail)
|
|
208
|
+
safeLogModuleEvent {
|
|
209
|
+
logModuleEvent(
|
|
210
|
+
where = "QRActivity.qrValidationFailed",
|
|
211
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $failMessage",
|
|
212
|
+
level = SentryLogLevel.WARN,
|
|
213
|
+
attributes = mapOf(
|
|
214
|
+
"error_message" to failMessage,
|
|
215
|
+
"screen" to javaClass.simpleName,
|
|
216
|
+
"transmitter_name" to (mPocDevice?.name ?: ""),
|
|
217
|
+
"qr_raw" to (message ?: ""),
|
|
218
|
+
),
|
|
219
|
+
logsOnly = true,
|
|
220
|
+
)
|
|
221
|
+
}
|
|
95
222
|
Toast.makeText(
|
|
96
223
|
this@QRActivity,
|
|
97
|
-
|
|
224
|
+
failMessage,
|
|
98
225
|
Toast.LENGTH_SHORT
|
|
99
226
|
)
|
|
100
227
|
.show()
|
|
101
228
|
mQRFragment!!.restartPreviewAfterDelay(0)
|
|
102
229
|
}
|
|
103
230
|
} catch (e: Exception) {
|
|
231
|
+
val errorMessage = e.message ?: "QR validation exception"
|
|
232
|
+
safeLogModuleEvent {
|
|
233
|
+
logModuleEvent(
|
|
234
|
+
where = "QRActivity.showMessage",
|
|
235
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorMessage",
|
|
236
|
+
level = SentryLogLevel.WARN,
|
|
237
|
+
throwable = e,
|
|
238
|
+
attributes = mapOf(
|
|
239
|
+
"error_message" to errorMessage,
|
|
240
|
+
"screen" to javaClass.simpleName,
|
|
241
|
+
),
|
|
242
|
+
logsOnly = true,
|
|
243
|
+
)
|
|
244
|
+
}
|
|
104
245
|
e.printStackTrace()
|
|
105
246
|
finish()
|
|
106
247
|
}
|
|
@@ -52,6 +52,10 @@ import com.mytatvarnsdk.myView.dialog.WarnDialogUtils
|
|
|
52
52
|
import com.mytatvarnsdk.myView.progress.ProgressManagement
|
|
53
53
|
import com.mytatvarnsdk.myView.progress.ProgressType
|
|
54
54
|
import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
55
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
56
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
57
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
58
|
+
import io.sentry.SentryLogLevel
|
|
55
59
|
import kotlinx.coroutines.CoroutineScope
|
|
56
60
|
import kotlinx.coroutines.Dispatchers
|
|
57
61
|
import kotlinx.coroutines.Job
|
|
@@ -127,6 +131,21 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
127
131
|
|
|
128
132
|
fun manageErrorState(showError: Boolean, errorStatus: String) {
|
|
129
133
|
if (showError) {
|
|
134
|
+
if (errorStatus.isNotEmpty()) {
|
|
135
|
+
safeLogModuleEvent {
|
|
136
|
+
logModuleEvent(
|
|
137
|
+
where = "SearchTransmitterActivity.error",
|
|
138
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorStatus",
|
|
139
|
+
level = SentryLogLevel.WARN,
|
|
140
|
+
attributes = mapOf(
|
|
141
|
+
"error_message" to errorStatus,
|
|
142
|
+
"screen" to javaClass.simpleName,
|
|
143
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
144
|
+
),
|
|
145
|
+
logsOnly = true,
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
130
149
|
binding.clFail.visibility = View.VISIBLE
|
|
131
150
|
binding.clMain.visibility = View.GONE
|
|
132
151
|
binding.commonButton.root.visibility = View.GONE
|
|
@@ -296,11 +315,37 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
296
315
|
|
|
297
316
|
public override fun checkFailForLowPower() {
|
|
298
317
|
ProgressManagement.getInstance().dismissWait(this)
|
|
318
|
+
safeLogModuleEvent {
|
|
319
|
+
logModuleEvent(
|
|
320
|
+
where = "SearchTransmitterActivity.checkFailForLowPower",
|
|
321
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | Transmitter low power",
|
|
322
|
+
level = SentryLogLevel.WARN,
|
|
323
|
+
attributes = mapOf(
|
|
324
|
+
"error_message" to "Transmitter low power",
|
|
325
|
+
"screen" to javaClass.simpleName,
|
|
326
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
327
|
+
),
|
|
328
|
+
logsOnly = true,
|
|
329
|
+
)
|
|
330
|
+
}
|
|
299
331
|
WarnDialogUtils.getInstance().showWarnDialog(this, DialogType.TYPE_LOW_POWER)
|
|
300
332
|
}
|
|
301
333
|
|
|
302
334
|
public override fun checkFailErrorTemperature() {
|
|
303
335
|
ProgressManagement.getInstance().dismissWait(this)
|
|
336
|
+
safeLogModuleEvent {
|
|
337
|
+
logModuleEvent(
|
|
338
|
+
where = "SearchTransmitterActivity.checkFailErrorTemperature",
|
|
339
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | Transmitter temperature error",
|
|
340
|
+
level = SentryLogLevel.WARN,
|
|
341
|
+
attributes = mapOf(
|
|
342
|
+
"error_message" to "Transmitter temperature error",
|
|
343
|
+
"screen" to javaClass.simpleName,
|
|
344
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
345
|
+
),
|
|
346
|
+
logsOnly = true,
|
|
347
|
+
)
|
|
348
|
+
}
|
|
304
349
|
}
|
|
305
350
|
|
|
306
351
|
public override fun onlineLost() {
|
|
@@ -318,24 +363,33 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
318
363
|
}
|
|
319
364
|
} catch (e: Exception) {
|
|
320
365
|
Log.d("bind::-> ", "bind: ${e.message}")
|
|
366
|
+
safeLogModuleEvent {
|
|
367
|
+
val errorMessage = e.message ?: "Transmitter bind exception"
|
|
368
|
+
logModuleEvent(
|
|
369
|
+
where = "SearchTransmitterActivity.bind",
|
|
370
|
+
message = "CGM journey error | screen=${javaClass.simpleName} | $errorMessage",
|
|
371
|
+
level = SentryLogLevel.WARN,
|
|
372
|
+
throwable = e,
|
|
373
|
+
attributes = mapOf(
|
|
374
|
+
"error_message" to errorMessage,
|
|
375
|
+
"screen" to javaClass.simpleName,
|
|
376
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
377
|
+
),
|
|
378
|
+
logsOnly = true,
|
|
379
|
+
)
|
|
380
|
+
}
|
|
321
381
|
}
|
|
322
382
|
}
|
|
323
383
|
|
|
324
384
|
private fun setupClickListeners() {
|
|
325
|
-
binding.toolbar.btnWhatsapp
|
|
326
|
-
startActivity(
|
|
327
|
-
Intent(this, HelpActivity::class.java)
|
|
328
|
-
.putExtra("ScreenName", "Transmitter page")
|
|
329
|
-
)
|
|
330
|
-
}
|
|
385
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
331
386
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
387
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
388
|
+
context = this,
|
|
389
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
390
|
+
isForReconnect = isForReconnect,
|
|
391
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
392
|
+
)
|
|
339
393
|
|
|
340
394
|
binding.toolbar.btnClose.setOnClickListener {
|
|
341
395
|
openExitDialog()
|
|
@@ -440,6 +494,20 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
440
494
|
}
|
|
441
495
|
|
|
442
496
|
private fun sendDataToRN(data: String, status: String) {
|
|
497
|
+
safeLogModuleEvent {
|
|
498
|
+
logModuleEvent(
|
|
499
|
+
where = "cgmJourney.$status",
|
|
500
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=$status",
|
|
501
|
+
level = SentryLogLevel.INFO,
|
|
502
|
+
jsonPayload = data.takeIf { it.isNotEmpty() },
|
|
503
|
+
attributes = mapOf(
|
|
504
|
+
"journey_step" to status,
|
|
505
|
+
"screen" to javaClass.simpleName,
|
|
506
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
507
|
+
),
|
|
508
|
+
logsOnly = true,
|
|
509
|
+
)
|
|
510
|
+
}
|
|
443
511
|
if (reactContext != null) {
|
|
444
512
|
try {
|
|
445
513
|
val catalystInstance: CatalystInstance = reactContext.catalystInstance
|
|
@@ -487,6 +555,19 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
487
555
|
}
|
|
488
556
|
|
|
489
557
|
private fun startDeviceSearch() {
|
|
558
|
+
safeLogModuleEvent {
|
|
559
|
+
logModuleEvent(
|
|
560
|
+
where = "cgmJourney.cgm_transmitter_scan_started",
|
|
561
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=cgm_transmitter_scan_started",
|
|
562
|
+
level = SentryLogLevel.INFO,
|
|
563
|
+
attributes = mapOf(
|
|
564
|
+
"journey_step" to "cgm_transmitter_scan_started",
|
|
565
|
+
"screen" to javaClass.simpleName,
|
|
566
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
567
|
+
),
|
|
568
|
+
logsOnly = true,
|
|
569
|
+
)
|
|
570
|
+
}
|
|
490
571
|
mModel = ViewModelProviders.of(this)[MainActivityModel::class.java]
|
|
491
572
|
|
|
492
573
|
ReconnectManagement.getInstance()
|
|
@@ -544,6 +625,20 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
544
625
|
isTransmitterConnected = true
|
|
545
626
|
|
|
546
627
|
if (transmitterDeviceInfo != null) {
|
|
628
|
+
safeLogModuleEvent {
|
|
629
|
+
logModuleEvent(
|
|
630
|
+
where = "cgmJourney.cgm_transmitter_connect_clicked",
|
|
631
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=cgm_transmitter_connect_clicked",
|
|
632
|
+
level = SentryLogLevel.INFO,
|
|
633
|
+
jsonPayload = transmitterDeviceInfo?.pocDevice?.name ?: "",
|
|
634
|
+
attributes = mapOf(
|
|
635
|
+
"journey_step" to "cgm_transmitter_connect_clicked",
|
|
636
|
+
"screen" to javaClass.simpleName,
|
|
637
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
638
|
+
),
|
|
639
|
+
logsOnly = true,
|
|
640
|
+
)
|
|
641
|
+
}
|
|
547
642
|
if (isForReconnect) {
|
|
548
643
|
GattTool.unBindInDatabase(this, enumUnBind.UNBIND_FORCE)
|
|
549
644
|
}
|
|
@@ -31,6 +31,10 @@ import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
|
31
31
|
import com.mytatvarnsdk.network.AuthenticateSDKService.LoaderListener
|
|
32
32
|
import com.mytatvarnsdk.utils.DeviceStatus
|
|
33
33
|
import com.mytatvarnsdk.utils.TATVA_ENVIRONMENT
|
|
34
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
35
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
36
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
37
|
+
import io.sentry.SentryLogLevel
|
|
34
38
|
import kotlinx.coroutines.CoroutineScope
|
|
35
39
|
import kotlinx.coroutines.Dispatchers
|
|
36
40
|
import kotlinx.coroutines.Job
|
|
@@ -77,23 +81,14 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
77
81
|
|
|
78
82
|
authenticateSDKService = AuthenticateSDKService(scope = scope)
|
|
79
83
|
|
|
80
|
-
binding.toolbar.btnWhatsapp
|
|
81
|
-
startActivity(
|
|
82
|
-
Intent(this, HelpActivity::class.java)
|
|
83
|
-
.putExtra("ScreenName", "Sensor page")
|
|
84
|
-
)
|
|
85
|
-
}
|
|
84
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (isForReconnect) "n_pUrFoZ1wQ" else "r5Zemc4R044"
|
|
94
|
-
)
|
|
95
|
-
)
|
|
96
|
-
}
|
|
86
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
87
|
+
context = this,
|
|
88
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
89
|
+
isForReconnect = isForReconnect,
|
|
90
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
91
|
+
)
|
|
97
92
|
|
|
98
93
|
binding.commonButton.btnProceed.setOnClickListener {
|
|
99
94
|
sendDataToRN("", "cgm_connect_sensor_proceed_clicked")
|
|
@@ -121,6 +116,20 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
121
116
|
}
|
|
122
117
|
|
|
123
118
|
private fun sendDataToRN(data: String, status: String) {
|
|
119
|
+
safeLogModuleEvent {
|
|
120
|
+
logModuleEvent(
|
|
121
|
+
where = "cgmJourney.$status",
|
|
122
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=$status",
|
|
123
|
+
level = SentryLogLevel.INFO,
|
|
124
|
+
jsonPayload = data.takeIf { it.isNotEmpty() },
|
|
125
|
+
attributes = mapOf(
|
|
126
|
+
"journey_step" to status,
|
|
127
|
+
"screen" to javaClass.simpleName,
|
|
128
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
129
|
+
),
|
|
130
|
+
logsOnly = true,
|
|
131
|
+
)
|
|
132
|
+
}
|
|
124
133
|
if (reactContext != null) {
|
|
125
134
|
try {
|
|
126
135
|
val catalystInstance: CatalystInstance = reactContext.catalystInstance
|
|
@@ -173,6 +182,20 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
173
182
|
obj.put("status", DeviceStatus.CONNECTED.id)
|
|
174
183
|
obj.put("rawData", rawData)
|
|
175
184
|
|
|
185
|
+
safeLogModuleEvent {
|
|
186
|
+
logModuleEvent(
|
|
187
|
+
where = "SensorConnectSuccessActivity.postDeviceData.request",
|
|
188
|
+
message = "POST /cgm/connection CONNECTED on sensor success screen",
|
|
189
|
+
level = SentryLogLevel.INFO,
|
|
190
|
+
jsonPayload = "request=${obj}",
|
|
191
|
+
attributes = mapOf(
|
|
192
|
+
"cgm_status" to DeviceStatus.CONNECTED.id,
|
|
193
|
+
"sensor_id" to (information.sensor ?: ""),
|
|
194
|
+
),
|
|
195
|
+
logsOnly = true,
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
176
199
|
authenticateSDKService.postDeviceData(
|
|
177
200
|
environment = if (CgmTrackyLibModule.env.lowercase() == "uat") TATVA_ENVIRONMENT.STAGE else TATVA_ENVIRONMENT.PROD,
|
|
178
201
|
data = obj.toString(),
|
|
@@ -224,4 +247,8 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
224
247
|
dialog.show()
|
|
225
248
|
}
|
|
226
249
|
|
|
250
|
+
override fun onResume() {
|
|
251
|
+
super.onResume()
|
|
252
|
+
}
|
|
253
|
+
|
|
227
254
|
}
|
|
@@ -28,6 +28,10 @@ import com.mytatvarnsdk.CgmTrackyLibModule.Companion.mReactContext
|
|
|
28
28
|
import com.mytatvarnsdk.R
|
|
29
29
|
import com.mytatvarnsdk.databinding.ActivityStartCgmactivityBinding
|
|
30
30
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
31
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
32
|
+
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
33
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
34
|
+
import io.sentry.SentryLogLevel
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
class StartCGMActivity : AppCompatActivity() {
|
|
@@ -92,22 +96,15 @@ class StartCGMActivity : AppCompatActivity() {
|
|
|
92
96
|
openExitDialog()
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
binding.toolbar.btnWhatsapp
|
|
96
|
-
startActivity(
|
|
97
|
-
Intent(this, HelpActivity::class.java)
|
|
98
|
-
.putExtra("ScreenName", "connection journey page")
|
|
99
|
-
)
|
|
100
|
-
}
|
|
99
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
101
100
|
|
|
102
|
-
binding.toolbar.btnWatchDemo.setOnClickListener
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
)
|
|
110
|
-
}
|
|
101
|
+
binding.toolbar.btnWatchDemo.setOnClickListener(null)
|
|
102
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
103
|
+
context = this,
|
|
104
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
105
|
+
isForReconnect = isForReconnect,
|
|
106
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
107
|
+
)
|
|
111
108
|
|
|
112
109
|
val callback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
|
|
113
110
|
override fun handleOnBackPressed() {
|
|
@@ -168,6 +165,20 @@ class StartCGMActivity : AppCompatActivity() {
|
|
|
168
165
|
}
|
|
169
166
|
|
|
170
167
|
private fun sendDataToRN(data: String, status: String) {
|
|
168
|
+
safeLogModuleEvent {
|
|
169
|
+
logModuleEvent(
|
|
170
|
+
where = "cgmJourney.$status",
|
|
171
|
+
message = "CGM journey | screen=${javaClass.simpleName} | step=$status",
|
|
172
|
+
level = SentryLogLevel.INFO,
|
|
173
|
+
jsonPayload = data.takeIf { it.isNotEmpty() },
|
|
174
|
+
attributes = mapOf(
|
|
175
|
+
"journey_step" to status,
|
|
176
|
+
"screen" to javaClass.simpleName,
|
|
177
|
+
"is_reconnect" to isForReconnect.toString(),
|
|
178
|
+
),
|
|
179
|
+
logsOnly = true,
|
|
180
|
+
)
|
|
181
|
+
}
|
|
171
182
|
if (reactContext != null) {
|
|
172
183
|
try {
|
|
173
184
|
val catalystInstance: CatalystInstance = reactContext.catalystInstance
|