react-native-mytatva-rn-sdk 1.2.49 → 1.2.51
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 +4 -4
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +10 -4
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +1 -1
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +5 -1
- package/package.json +1 -1
|
@@ -129,7 +129,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
129
129
|
userToken = token
|
|
130
130
|
|
|
131
131
|
/*authenticateSDKService.getCGMData(
|
|
132
|
-
environment =
|
|
132
|
+
environment = TATVA_ENVIRONMENT.PROD,
|
|
133
133
|
token = userToken,
|
|
134
134
|
responseListener = object : AuthenticateSDKService.ResponseListener {
|
|
135
135
|
override fun onResponseSuccess(response: String) {
|
|
@@ -301,7 +301,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
authenticateSDKService.postDeviceData(
|
|
304
|
-
environment =
|
|
304
|
+
environment = TATVA_ENVIRONMENT.PROD,
|
|
305
305
|
data = obj.toString(),
|
|
306
306
|
token = userToken,
|
|
307
307
|
loaderListener = object : LoaderListener {
|
|
@@ -483,7 +483,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
483
483
|
Log.d("Glucose data 3 min==> ", "Glucose data 3 min==> final Json: $json")
|
|
484
484
|
|
|
485
485
|
authenticateSDKService.postCGMData(
|
|
486
|
-
environment =
|
|
486
|
+
environment = TATVA_ENVIRONMENT.PROD,
|
|
487
487
|
data = json,
|
|
488
488
|
token = userToken,
|
|
489
489
|
responseListener = object : AuthenticateSDKService.ResponseListener {
|
|
@@ -842,7 +842,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
842
842
|
return suspendCoroutine { continuation ->
|
|
843
843
|
try {
|
|
844
844
|
authenticateSDKService.postCGMData(
|
|
845
|
-
environment =
|
|
845
|
+
environment = TATVA_ENVIRONMENT.PROD,
|
|
846
846
|
data = json,
|
|
847
847
|
token = userToken,
|
|
848
848
|
responseListener = object : AuthenticateSDKService.ResponseListener {
|
|
@@ -94,17 +94,23 @@ class PermissionActivity : BasePermissionActivity() {
|
|
|
94
94
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
95
95
|
val connectPermission = ContextCompat.checkSelfPermission(
|
|
96
96
|
context,
|
|
97
|
-
|
|
97
|
+
Manifest.permission.BLUETOOTH_CONNECT
|
|
98
98
|
) == PackageManager.PERMISSION_GRANTED
|
|
99
99
|
|
|
100
100
|
val scanPermission = ContextCompat.checkSelfPermission(
|
|
101
101
|
context,
|
|
102
|
-
|
|
102
|
+
Manifest.permission.BLUETOOTH_SCAN
|
|
103
103
|
) == PackageManager.PERMISSION_GRANTED
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
val advertisePermission = ContextCompat.checkSelfPermission(
|
|
106
|
+
context,
|
|
107
|
+
Manifest.permission.BLUETOOTH_ADVERTISE
|
|
108
|
+
) == PackageManager.PERMISSION_GRANTED
|
|
109
|
+
|
|
110
|
+
// Include advertisePermission only if your app uses Bluetooth advertising
|
|
111
|
+
connectPermission && scanPermission && advertisePermission
|
|
106
112
|
} else {
|
|
107
|
-
// For Android 11 and below, permission is granted at install time
|
|
113
|
+
// For Android 11 and below, permission is granted at install time or via location
|
|
108
114
|
true
|
|
109
115
|
}
|
|
110
116
|
}
|
|
@@ -171,7 +171,7 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
171
171
|
obj.put("rawData", rawData)
|
|
172
172
|
|
|
173
173
|
authenticateSDKService.postDeviceData(
|
|
174
|
-
environment =
|
|
174
|
+
environment = TATVA_ENVIRONMENT.PROD,
|
|
175
175
|
data = obj.toString(),
|
|
176
176
|
token = CgmTrackyLibModule.userToken,
|
|
177
177
|
loaderListener = object : LoaderListener {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.mytatvarnsdk.activity
|
|
2
2
|
|
|
3
3
|
import android.app.Dialog
|
|
4
|
+
import android.bluetooth.BluetoothAdapter
|
|
4
5
|
import android.content.Intent
|
|
5
6
|
import android.content.pm.PackageManager
|
|
6
7
|
import android.graphics.Color
|
|
@@ -33,6 +34,9 @@ class StartCGMActivity : AppCompatActivity() {
|
|
|
33
34
|
private lateinit var binding: ActivityStartCgmactivityBinding
|
|
34
35
|
private var isForReconnect: Boolean = false
|
|
35
36
|
private val reactContext = CgmTrackyLibModule.mReactContext
|
|
37
|
+
private val bluetoothAdapter: BluetoothAdapter? by lazy {
|
|
38
|
+
BluetoothAdapter.getDefaultAdapter()
|
|
39
|
+
}
|
|
36
40
|
|
|
37
41
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
38
42
|
super.onCreate(savedInstanceState)
|
|
@@ -63,7 +67,7 @@ class StartCGMActivity : AppCompatActivity() {
|
|
|
63
67
|
sendDataToRN("", "cgm_start_connection_journey_clicked")
|
|
64
68
|
|
|
65
69
|
if (isForReconnect) {
|
|
66
|
-
val intent = if (areAllPermissionsGranted()) {
|
|
70
|
+
val intent = if (areAllPermissionsGranted() && bluetoothAdapter!!.isEnabled) {
|
|
67
71
|
Intent(this, SearchTransmitterActivity::class.java).putExtra(
|
|
68
72
|
"IsForReconnect",
|
|
69
73
|
true
|