react-native-mytatva-rn-sdk 1.2.12 → 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.
@@ -199,5 +199,6 @@
199
199
  <string name="verification_fail">verification failed</string>
200
200
  <string name="txt_provide_camera_permisison"><u>Provide Camera Permissions</u></string>
201
201
  <string name="txt_know_more"><u>Know More</u></string>
202
+ <string name="txt_open_setting"><u>Open System Settings</u></string>
202
203
 
203
204
  </resources>
@@ -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
- self.navigationController?.presentingViewController?.dismiss(animated: true, completion: nil)
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
- if self.isForReconnect {
96
- NotificationCenter.default.post(name: Notification.Name("cgmDeviceEvent"), object: nil, userInfo: ["a":"a"])
97
- self.navigationController?.presentingViewController?.dismiss(animated: true, completion: nil)
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
- let vc = ConnectToSensorViewController.instantiate(fromStoryboard: Enum_stroyboard.Main.rawValue)
101
- vc.connected = {
102
- //self.showConfirmInsulinUser()
103
- }
104
- self.navigationController?.pushViewController(vc, animated: false)
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
- // Wait an hour, then you’ll get the success callback if type hasn't changed
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mytatva-rn-sdk",
3
- "version": "1.2.12",
3
+ "version": "1.2.15",
4
4
  "description": "a package to inject data into visit health pwa",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",