react-native-mytatva-rn-sdk 1.2.14 → 1.2.15
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/ios/MyReactNativeBridge.m +2 -1
- package/ios/Support/gif/success.gif +0 -0
- package/ios/ViewControllers/AttachTransmitterViewController.swift +8 -3
- package/ios/ViewControllers/ConnectToSensorViewController.swift +0 -1
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +17 -10
- package/ios/ViewModel/FinalViewModel.swift +14 -5
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#import <UIKit/UIKit.h>
|
|
11
11
|
#import <React/RCTEventDispatcher.h>
|
|
12
12
|
#import <React/RCTEventEmitter.h>
|
|
13
|
-
|
|
13
|
+
#import "react_native_mytatva_rn_sdk-Swift.h"
|
|
14
14
|
@implementation MyEventEmitterManager
|
|
15
15
|
|
|
16
16
|
RCT_EXPORT_MODULE();
|
|
@@ -144,6 +144,7 @@ RCT_EXPORT_METHOD(openHelpSupport)
|
|
|
144
144
|
|
|
145
145
|
RCT_EXPORT_METHOD(observeAllGlucoseData:(NSString *)token)
|
|
146
146
|
{
|
|
147
|
+
FinalViewModelManager *manager = [FinalViewModelManager shared];
|
|
147
148
|
[[NSUserDefaults standardUserDefaults] setObject:token forKey:@"authToken"];
|
|
148
149
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
|
149
150
|
|
|
Binary file
|
|
@@ -57,10 +57,15 @@ class AttachTransmitterViewController: UIViewController {
|
|
|
57
57
|
print("===> arrayFromInitial count: ", arrayFromInitial.count)
|
|
58
58
|
self.viewModel.uploadData(data: arrayFromInitial)
|
|
59
59
|
}
|
|
60
|
-
|
|
61
60
|
NotificationCenter.default.post(name: Notification.Name("cgmDeviceEvent"), object: nil, userInfo: ["a":"a"])
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
if let rootVC = UIApplication.shared.connectedScenes
|
|
62
|
+
.compactMap({ ($0 as? UIWindowScene)?.windows.first?.rootViewController })
|
|
63
|
+
.first {
|
|
64
|
+
rootVC.dismiss(animated: true, completion: nil)
|
|
65
|
+
} else if let rootViewController = UIApplication.shared.keyWindow?.rootViewController {
|
|
66
|
+
rootViewController.dismiss(animated: true, completion: nil)
|
|
67
|
+
}
|
|
68
|
+
|
|
64
69
|
//let vc = ConnectToTransmitterViewController.instantiate(fromStoryboard: Enum_stroyboard.Main.rawValue)
|
|
65
70
|
//self.navigationController?.pushViewController(vc, animated: true)
|
|
66
71
|
}
|
|
@@ -336,7 +336,6 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
|
|
|
336
336
|
let dateFormatter = DateFormatter()
|
|
337
337
|
dateFormatter.dateFormat = "dd-MM-yyyy hh:mm a"
|
|
338
338
|
dateFormatter.timeZone = TimeZone.current
|
|
339
|
-
|
|
340
339
|
if let connectedTime = connectedTime {
|
|
341
340
|
// Convert the Date to a String
|
|
342
341
|
let dateString = dateFormatter.string(from: connectedTime)
|
|
@@ -92,19 +92,26 @@ class ConnectToTransmitterViewController: UIViewController, KLTBluetoothDelegate
|
|
|
92
92
|
bottomButton.hideRightArrow()
|
|
93
93
|
}
|
|
94
94
|
bottomButton.buttonTapCallback = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if self.isForReconnect {
|
|
96
|
+
NotificationCenter.default.post(name: Notification.Name("cgmDeviceEvent"), object: nil, userInfo: ["a":"a"])
|
|
97
|
+
if let rootVC = UIApplication.shared.connectedScenes
|
|
98
|
+
.compactMap({ ($0 as? UIWindowScene)?.windows.first?.rootViewController })
|
|
99
|
+
.first {
|
|
100
|
+
rootVC.dismiss(animated: true, completion: nil)
|
|
101
|
+
} else if let rootViewController = UIApplication.shared.keyWindow?.rootViewController {
|
|
102
|
+
rootViewController.dismiss(animated: true, completion: nil)
|
|
103
|
+
}
|
|
98
104
|
} else {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
|
|
106
|
+
let vc = ConnectToSensorViewController.instantiate(fromStoryboard: Enum_stroyboard.Main.rawValue)
|
|
107
|
+
vc.connected = {
|
|
108
|
+
//self.showConfirmInsulinUser()
|
|
109
|
+
}
|
|
110
|
+
self.navigationController?.pushViewController(vc, animated: false)
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
|
|
108
115
|
customTopView.onCloseTapped = {
|
|
109
116
|
let vc = ExitJourneyViewController.instantiate(fromStoryboard: Enum_stroyboard.Main.rawValue)
|
|
110
117
|
vc.modalPresentationStyle = .overFullScreen
|
|
@@ -253,7 +260,7 @@ extension ConnectToTransmitterViewController: UITableViewDelegate, UITableViewDa
|
|
|
253
260
|
let dateFormatter = DateFormatter()
|
|
254
261
|
dateFormatter.dateFormat = "dd-MM-yyyy hh:mm a"
|
|
255
262
|
dateFormatter.timeZone = TimeZone.current
|
|
256
|
-
|
|
263
|
+
cell.parentImageView.loadGif(named: "success")
|
|
257
264
|
if let connectedTime = connectedTime {
|
|
258
265
|
// Convert the Date to a String
|
|
259
266
|
let dateString = dateFormatter.string(from: connectedTime)
|
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
+
@objc public class FinalViewModelManager: NSObject {
|
|
10
|
+
@objc public static let shared = FinalViewModelManager()
|
|
11
|
+
@objc let viewModel = FinalViewModel()
|
|
12
|
+
|
|
13
|
+
private override init() {
|
|
14
|
+
super.init()
|
|
15
|
+
viewModel.initialize()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
9
18
|
|
|
10
19
|
class FinalViewModel: NSObject {
|
|
11
20
|
var initialPeriod = 0
|
|
@@ -18,18 +27,16 @@ class FinalViewModel: NSObject {
|
|
|
18
27
|
|
|
19
28
|
let debouncer = EnumDebouncer<CGMConnectionStatus>()
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
override init() {
|
|
30
|
+
@objc public override init() {
|
|
23
31
|
self.manager = KLTBluetoothManager.shared()
|
|
24
32
|
super.init()
|
|
25
33
|
debouncer.onDebounceSuccess = { value in
|
|
26
34
|
API.shared.sendStatus(status: value)
|
|
27
35
|
print("Same type held for an hour!")
|
|
28
36
|
}
|
|
37
|
+
}
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
func initialize() {
|
|
39
|
+
@objc public func initialize() {
|
|
33
40
|
startCountDown()
|
|
34
41
|
if ((manager.connectedPeripheral == nil) && !KLTLocalSettingManager.shareInstance().canConnectOtherDevice) {
|
|
35
42
|
manager.startScan()
|
|
@@ -257,6 +264,8 @@ class FinalViewModel: NSObject {
|
|
|
257
264
|
case .updateBindWatchSuccess:
|
|
258
265
|
//KLTLaunchConfiguration.sharedManager.bindSuccessRootViewController()
|
|
259
266
|
print("Success done")
|
|
267
|
+
case .closed:
|
|
268
|
+
API.shared.sendStatus(status: .transmitterDisconnectBox)
|
|
260
269
|
default:
|
|
261
270
|
break
|
|
262
271
|
}
|