react-native-mytatva-rn-sdk 1.2.44 → 1.2.46
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 +21 -4
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +18 -3
- package/android/src/main/java/com/mytatvarnsdk/activity/HelpActivity.kt +118 -59
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +370 -351
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +7 -2
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +10 -4
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +30 -53
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +9 -2
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +11 -3
- package/android/src/main/java/com/mytatvarnsdk/model/BaseViewModel.java +1 -1
- package/ios/MyReactNativeBridge.m +60 -55
- package/ios/Support/API.swift +1 -1
- package/ios/ViewControllers/AttachTransmitterViewController.swift +1 -0
- package/ios/ViewControllers/ChatWithExpertViewController.swift +4 -0
- package/ios/ViewControllers/ConnectToSensorViewController.swift +1 -0
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +19 -6
- package/ios/ViewControllers/ProvidePermissionViewController.swift +3 -0
- package/ios/ViewControllers/PutOnTheSensorViewController.swift +1 -0
- package/ios/ViewControllers/StartConnectionViewController.swift +4 -2
- package/ios/ViewModel/FinalViewModel.swift +15 -22
- package/package.json +1 -1
|
@@ -105,29 +105,25 @@ import Foundation
|
|
|
105
105
|
startDate: String,
|
|
106
106
|
endDate: String
|
|
107
107
|
) -> [String: Any] {
|
|
108
|
-
|
|
108
|
+
var updatedResponse = response
|
|
109
109
|
|
|
110
110
|
if viewModel.isCurrentDateInRange(startDate: startDate, endDate: endDate) {
|
|
111
111
|
print("Current date is in range")
|
|
112
|
-
|
|
112
|
+
|
|
113
|
+
let canConnectOther = KLTLocalSettingManager.shareInstance().canConnectOtherDevice
|
|
114
|
+
let connectedPeripheral = viewModel.manager.connectedPeripheral
|
|
115
|
+
|
|
116
|
+
if connectedPeripheral == nil && !canConnectOther {
|
|
113
117
|
viewModel.manager.startScan()
|
|
114
118
|
viewModel.debouncer.update(with: .transmitterDisconnect)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
//self.manager.closeBleSensor()
|
|
125
|
-
//manager.startScan()
|
|
126
|
-
//self.debouncer.update(with: .disconnected)
|
|
127
|
-
//debouncer.update(with: .transmitterDisconnectBox)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if KLTBluetoothManager.shared().currentDevice.connectedDateTime == nil && KLTBluetoothManager.shared().currentDevice.disconnectedDateTime == nil {
|
|
119
|
+
} else {
|
|
120
|
+
if let device = KLTBluetoothManager.shared().currentDevice {
|
|
121
|
+
if device.connectedDateTime == nil && device.disconnectedDateTime == nil {
|
|
122
|
+
viewModel.manager.startScan()
|
|
123
|
+
viewModel.debouncer.update(with: .transmitterDisconnect)
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
print("⚠️ currentDevice is nil")
|
|
131
127
|
viewModel.manager.startScan()
|
|
132
128
|
viewModel.debouncer.update(with: .transmitterDisconnect)
|
|
133
129
|
}
|
|
@@ -136,9 +132,6 @@ import Foundation
|
|
|
136
132
|
|
|
137
133
|
return updatedResponse
|
|
138
134
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
135
|
}
|
|
143
136
|
|
|
144
137
|
class FinalViewModel: NSObject {
|
|
@@ -335,7 +328,7 @@ class FinalViewModel: NSObject {
|
|
|
335
328
|
let batches = stride(from: 0, to: data.count, by: batchSize).map {
|
|
336
329
|
Array(data[$0..<min($0 + batchSize, data.count)])
|
|
337
330
|
}
|
|
338
|
-
|
|
331
|
+
|
|
339
332
|
uploadBatch(batches: batches, index: 0)
|
|
340
333
|
}
|
|
341
334
|
|