react-native-mytatva-rn-sdk 1.2.5 → 1.2.6

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.
Files changed (23) hide show
  1. package/android/build.gradle +4 -2
  2. package/android/src/main/AndroidManifestNew.xml +21 -10
  3. package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +6 -6
  4. package/android/src/main/java/com/mytatvarnsdk/MainApplication.kt +4 -6
  5. package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +412 -363
  6. package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +1 -1
  7. package/android/src/main/res/drawable/bg_dark_blue.xml +6 -0
  8. package/android/src/main/res/drawable/bg_green_progress.xml +6 -0
  9. package/android/src/main/res/drawable/bg_grey.xml +6 -0
  10. package/android/src/main/res/layout/activity_connect_sensor.xml +98 -1
  11. package/android/src/main/res/layout/activity_permission.xml +106 -8
  12. package/android/src/main/res/layout/activity_place_sensor.xml +98 -1
  13. package/android/src/main/res/layout/activity_place_transmitter.xml +98 -1
  14. package/android/src/main/res/layout/activity_search_transmitter.xml +99 -4
  15. package/android/src/main/res/layout/activity_sensor_connect_success.xml +98 -1
  16. package/android/src/main/res/values/strings.xml +1 -0
  17. package/android/src/main/res/values/styles.xml +71 -58
  18. package/ios/MyReactNativeBridge.m +67 -2
  19. package/ios/Support/API.swift +3 -1
  20. package/ios/ViewControllers/ConnectToSensorViewController.swift +21 -10
  21. package/ios/ViewControllers/ConnectToTransmitterViewController.swift +23 -1
  22. package/ios/ViewControllers/ProvidePermissionViewController.swift +12 -0
  23. package/package.json +1 -1
@@ -13,12 +13,109 @@
13
13
  app:layout_constraintStart_toStartOf="parent"
14
14
  app:layout_constraintTop_toTopOf="parent" />
15
15
 
16
+ <androidx.constraintlayout.widget.ConstraintLayout
17
+ android:id="@+id/llProgress"
18
+ android:layout_width="match_parent"
19
+ android:layout_height="wrap_content"
20
+ app:layout_constraintTop_toBottomOf="@+id/toolbar">
21
+
22
+ <View
23
+ android:id="@+id/view1"
24
+ android:layout_width="0dp"
25
+ android:layout_height="4dp"
26
+ android:layout_marginHorizontal="5dp"
27
+ android:layout_marginVertical="10dp"
28
+ android:background="@drawable/bg_green_progress"
29
+ app:layout_constraintEnd_toStartOf="@id/view2"
30
+ app:layout_constraintHorizontal_chainStyle="spread"
31
+ app:layout_constraintHorizontal_weight="1.3"
32
+ app:layout_constraintStart_toStartOf="parent"
33
+ app:layout_constraintTop_toTopOf="parent" />
34
+
35
+ <TextView
36
+ android:id="@+id/tvDivide1"
37
+ android:layout_width="wrap_content"
38
+ android:layout_height="wrap_content"
39
+ android:layout_marginTop="5dp"
40
+ android:fontFamily="@font/roboto_semibold"
41
+ android:text="Connect Sensor"
42
+ android:textColor="#299D6B"
43
+ android:textSize="11sp"
44
+ app:layout_constraintEnd_toEndOf="@+id/view3"
45
+ app:layout_constraintStart_toStartOf="@+id/view3"
46
+ app:layout_constraintTop_toBottomOf="@+id/view3" />
47
+
48
+ <View
49
+ android:id="@+id/view2"
50
+ android:layout_width="0dp"
51
+ android:layout_height="4dp"
52
+ android:layout_marginHorizontal="5dp"
53
+ android:layout_marginVertical="10dp"
54
+ android:background="@drawable/bg_green_progress"
55
+ app:layout_constraintEnd_toStartOf="@id/view3"
56
+ app:layout_constraintHorizontal_weight="1.3"
57
+ app:layout_constraintStart_toEndOf="@id/view1"
58
+ app:layout_constraintTop_toTopOf="parent" />
59
+
60
+ <TextView
61
+ android:id="@+id/tvDivide2"
62
+ android:layout_width="wrap_content"
63
+ android:layout_height="wrap_content"
64
+ android:layout_marginTop="5dp"
65
+ android:fontFamily="@font/roboto_semibold"
66
+ android:text="Place Sensor"
67
+ android:textColor="#D0D5DD"
68
+ android:textSize="11sp"
69
+ app:layout_constraintEnd_toEndOf="@+id/view4"
70
+ app:layout_constraintStart_toStartOf="@+id/view4"
71
+ app:layout_constraintTop_toBottomOf="@+id/view4" />
72
+
73
+ <View
74
+ android:id="@+id/view3"
75
+ android:layout_width="0dp"
76
+ android:layout_height="4dp"
77
+ android:layout_marginHorizontal="5dp"
78
+ android:layout_marginVertical="10dp"
79
+ android:background="@drawable/bg_green_progress"
80
+ app:layout_constraintEnd_toStartOf="@id/view4"
81
+ app:layout_constraintHorizontal_weight="3"
82
+ app:layout_constraintStart_toEndOf="@id/view2"
83
+ app:layout_constraintTop_toTopOf="parent" />
84
+
85
+ <View
86
+ android:id="@+id/view4"
87
+ android:layout_width="0dp"
88
+ android:layout_height="4dp"
89
+ android:layout_marginHorizontal="5dp"
90
+ android:layout_marginVertical="10dp"
91
+ android:background="@drawable/bg_grey"
92
+ app:layout_constraintEnd_toStartOf="@id/view5"
93
+ app:layout_constraintHorizontal_weight="3"
94
+ app:layout_constraintStart_toEndOf="@id/view3"
95
+ app:layout_constraintTop_toTopOf="parent" />
96
+
97
+ <View
98
+ android:id="@+id/view5"
99
+ android:layout_width="0dp"
100
+ android:layout_height="4dp"
101
+ android:layout_marginHorizontal="5dp"
102
+ android:layout_marginVertical="10dp"
103
+ android:background="@drawable/bg_grey"
104
+ app:layout_constraintEnd_toEndOf="parent"
105
+ app:layout_constraintHorizontal_weight="1.3"
106
+ app:layout_constraintStart_toEndOf="@id/view4"
107
+ app:layout_constraintTop_toTopOf="parent" />
108
+
109
+ </androidx.constraintlayout.widget.ConstraintLayout>
110
+
111
+
16
112
  <View
17
113
  android:id="@+id/divider"
18
114
  android:layout_width="match_parent"
19
115
  android:layout_height="2dp"
116
+ android:layout_marginTop="5dp"
20
117
  android:background="#F2F4F7"
21
- app:layout_constraintTop_toBottomOf="@+id/toolbar" />
118
+ app:layout_constraintTop_toBottomOf="@+id/llProgress" />
22
119
 
23
120
 
24
121
  <androidx.constraintlayout.widget.ConstraintLayout
@@ -198,5 +198,6 @@
198
198
  <string name="qr_wrong">The QR code version is wrong, please scan another QR code.</string>
199
199
  <string name="verification_fail">verification failed</string>
200
200
  <string name="txt_provide_camera_permisison"><u>Provide Camera Permissions</u></string>
201
+ <string name="txt_know_more"><u>Know More</u></string>
201
202
 
202
203
  </resources>
@@ -1,62 +1,73 @@
1
1
  <resources xmlns:tools="http://schemas.android.com/tools">
2
- <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
3
- <!-- <style name="MyTheme" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">-->
4
- <!-- 底部导航栏透明,但是会有一层灰度-->
5
- <!-- <item name="android:windowTranslucentNavigation">false</item>-->
6
-
7
- <!-- <item name="android:windowFullscreen">true</item>-->
8
- <!-- 顶部状态栏透明,但是会有一层灰度-->
9
- <!-- <item name="android:windowTranslucentStatus">false</item>-->
10
- <!-- 界面控件文字显示在顶部状态栏直下,底部导航栏之上-->
11
- <!-- <item name="android:fitsSystemWindows">true</item>-->
12
- <!-- ActionBar 标题栏的颜色-->
13
- <!-- <item name="android:windowBackground">@drawable/star</item>-->
14
- <item name="colorPrimary">@color/transparent</item>
15
- <!-- 顶部状态栏的背景颜色-->
16
- <item name="colorPrimaryDark">@color/color_33353F67</item>
17
- <!-- statusBarColor colorPrimaryDark高级,同时存在时会覆盖 colorPrimaryDark-->
18
- <item name="android:statusBarColor">@color/color_33353F67</item>
19
- <!-- 底部导航栏的颜色-->
20
- <item name="android:navigationBarColor">@color/color_33353F67</item>
21
- <!-- 默认控件的颜色 比如说CheckBox 等-->
22
- <item name="colorAccent">@color/colorAccent</item>
23
- <!-- 默认按钮的颜色-->
24
- <item name="colorButtonNormal">@color/colorAccent</item>
25
- <!-- 默认文字的颜色-->
26
- <item name="android:textColor">@color/textColor</item>
27
- <!-- 是否默认文字全部大写-->
28
- <item name="textAllCaps">false</item>
29
-
30
- <item name="android:autofilledHighlight" tools:targetApi="o">@color/transparent</item>
31
- </style>
32
-
33
- <style name="AnimBottom" parent="@android:style/Animation">
34
- <item name="android:windowEnterAnimation">@anim/pop_up_in</item>
35
- <item name="android:windowExitAnimation">@anim/pop_down_out</item>
36
- </style>
37
-
38
- <style name="AnimSide" parent="@android:style/Animation">
39
- <item name="android:windowEnterAnimation">@anim/pop_left_right</item>
40
- <item name="android:windowExitAnimation">@anim/pop_right_left</item>
41
- </style>
42
-
43
- <style name="WarnDialog" parent="android:style/Theme.Dialog">
44
- <!--背景颜色及和透明程度-->
45
- <item name="android:background">@android:color/transparent</item>
46
- <item name="android:windowBackground">@android:color/transparent</item>
47
- <!--是否去除标题 -->
48
- <item name="android:windowNoTitle">true</item>
49
- <!--是否去除边框-->
50
- <item name="android:windowFrame">@null</item>
51
- <!--是否浮现在activity之上-->
52
- <item name="android:windowIsFloating">true</item>
53
- <!--是否模糊-->
54
- <item name="android:backgroundDimEnabled">true</item>
55
- </style>
56
-
57
- <declare-styleable name="MaxHeightRecyclerView">
58
- <attr name="maxHeight" format="dimension" />
59
- </declare-styleable>
2
+
3
+ <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
4
+ <!-- <style name="MyTheme" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">-->
5
+ <!-- 底部导航栏透明,但是会有一层灰度-->
6
+ <!-- <item name="android:windowTranslucentNavigation">false</item>-->
7
+
8
+ <!-- <item name="android:windowFullscreen">true</item>-->
9
+ <!-- 顶部状态栏透明,但是会有一层灰度-->
10
+ <!-- <item name="android:windowTranslucentStatus">false</item>-->
11
+ <!-- 界面控件文字显示在顶部状态栏直下,底部导航栏之上-->
12
+ <!-- <item name="android:fitsSystemWindows">true</item>-->
13
+ <!-- ActionBar 标题栏的颜色-->
14
+ <!-- <item name="android:windowBackground">@drawable/star</item>-->
15
+ <item name="colorPrimary">@color/transparent</item>
16
+ <!-- 顶部状态栏的背景颜色-->
17
+ <item name="colorPrimaryDark">@color/color_33353F67</item>
18
+ <!-- statusBarColor 比 colorPrimaryDark高级,同时存在时会覆盖 colorPrimaryDark-->
19
+ <item name="android:statusBarColor">@color/color_33353F67</item>
20
+ <!-- 底部导航栏的颜色-->
21
+ <item name="android:navigationBarColor">@color/color_33353F67</item>
22
+ <!-- 默认控件的颜色 比如说CheckBox 等-->
23
+ <item name="colorAccent">@color/colorAccent</item>
24
+ <!-- 默认按钮的颜色-->
25
+ <item name="colorButtonNormal">@color/colorAccent</item>
26
+ <!-- 默认文字的颜色-->
27
+ <item name="android:textColor">@color/textColor</item>
28
+ <!-- 是否默认文字全部大写-->
29
+ <item name="textAllCaps">false</item>
30
+
31
+ <item name="android:autofilledHighlight" tools:targetApi="o">@color/transparent</item>
32
+
33
+ <item name="android:windowAnimationStyle">@style/Animation.None</item>
34
+
35
+ </style>
36
+
37
+ <style name="Animation.None" parent="@android:style/Animation">
38
+ <item name="android:activityOpenEnterAnimation">@null</item>
39
+ <item name="android:activityOpenExitAnimation">@null</item>
40
+ <item name="android:activityCloseEnterAnimation">@null</item>
41
+ <item name="android:activityCloseExitAnimation">@null</item>
42
+ </style>
43
+
44
+ <style name="AnimBottom" parent="@android:style/Animation">
45
+ <item name="android:windowEnterAnimation">@anim/pop_up_in</item>
46
+ <item name="android:windowExitAnimation">@anim/pop_down_out</item>
47
+ </style>
48
+
49
+ <style name="AnimSide" parent="@android:style/Animation">
50
+ <item name="android:windowEnterAnimation">@anim/pop_left_right</item>
51
+ <item name="android:windowExitAnimation">@anim/pop_right_left</item>
52
+ </style>
53
+
54
+ <style name="WarnDialog" parent="android:style/Theme.Dialog">
55
+ <!--背景颜色及和透明程度-->
56
+ <item name="android:background">@android:color/transparent</item>
57
+ <item name="android:windowBackground">@android:color/transparent</item>
58
+ <!--是否去除标题 -->
59
+ <item name="android:windowNoTitle">true</item>
60
+ <!--是否去除边框-->
61
+ <item name="android:windowFrame">@null</item>
62
+ <!--是否浮现在activity之上-->
63
+ <item name="android:windowIsFloating">true</item>
64
+ <!--是否模糊-->
65
+ <item name="android:backgroundDimEnabled">true</item>
66
+ </style>
67
+
68
+ <declare-styleable name="MaxHeightRecyclerView">
69
+ <attr name="maxHeight" format="dimension" />
70
+ </declare-styleable>
60
71
 
61
72
  <style name="RoundedCornerImage">
62
73
  <item name="cornerFamily">rounded</item>
@@ -95,4 +106,6 @@
95
106
  <item name="android:fontFamily">@font/roboto_regular</item>
96
107
  <item name="android:textColor">@color/radio_text_selector</item>
97
108
  </style>
109
+
110
+
98
111
  </resources>
@@ -11,17 +11,22 @@
11
11
 
12
12
  @implementation MyReactNativeBridge
13
13
 
14
+ // static FinalViewModel *sharedViewModel = nil;
15
+
14
16
  RCT_EXPORT_MODULE();
15
17
 
16
- RCT_EXPORT_METHOD(openNativeFlow)
18
+ RCT_EXPORT_METHOD(startCgmTracky:(NSString *)token)
17
19
  {
20
+ [[NSUserDefaults standardUserDefaults] setObject:token forKey:@"authToken"];
21
+ [[NSUserDefaults standardUserDefaults] synchronize];
22
+
18
23
  dispatch_async(dispatch_get_main_queue(), ^{
19
24
  UIWindow *keyWindow = [UIApplication sharedApplication].delegate.window;
20
25
  UIViewController *rootVC = keyWindow.rootViewController;
21
26
 
22
27
  // Try to get the topmost navigation controller
23
28
 
24
- UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainCGM" bundle:nil];
29
+ UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
25
30
  UIViewController *nativeVC = [storyboard instantiateViewControllerWithIdentifier:@"StartConnectionViewController"];
26
31
 
27
32
 
@@ -33,4 +38,64 @@ RCT_EXPORT_METHOD(openNativeFlow)
33
38
  });
34
39
  }
35
40
 
41
+ RCT_EXPORT_METHOD(reconnectCgmTracky)
42
+ {
43
+ dispatch_async(dispatch_get_main_queue(), ^{
44
+ UIWindow *keyWindow = [UIApplication sharedApplication].delegate.window;
45
+ UIViewController *rootVC = keyWindow.rootViewController;
46
+
47
+ // Load the storyboard
48
+ UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
49
+
50
+ // Instantiate the target ViewController
51
+ UIViewController *reconnectVC = [storyboard instantiateViewControllerWithIdentifier:@"ConnectToTransmitterViewController"];
52
+
53
+ // Set presentation style
54
+ reconnectVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
55
+ // Set isForReconnect = YES
56
+ if ([reconnectVC respondsToSelector:@selector(setIsForReconnect:)]) {
57
+ [reconnectVC setValue:@(YES) forKey:@"isForReconnect"];
58
+ }
59
+ // Present it directly without navigation
60
+ if (reconnectVC) {
61
+ [rootVC presentViewController:reconnectVC animated:YES completion:nil];
62
+ }
63
+ });
64
+ }
65
+
66
+
67
+ RCT_EXPORT_METHOD(openHelpSupport)
68
+ {
69
+ dispatch_async(dispatch_get_main_queue(), ^{
70
+ UIWindow *keyWindow = [UIApplication sharedApplication].delegate.window;
71
+ UIViewController *rootVC = keyWindow.rootViewController;
72
+
73
+ // Load the storyboard
74
+ UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
75
+
76
+ // Instantiate the target ViewController
77
+ UIViewController *chatWithExpertVC = [storyboard instantiateViewControllerWithIdentifier:@"ChatWithExpertViewController"];
78
+
79
+ // Set presentation style
80
+ chatWithExpertVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
81
+
82
+ // Present it directly without navigation
83
+ if (chatWithExpertVC) {
84
+ [rootVC presentViewController:chatWithExpertVC animated:YES completion:nil];
85
+ }
86
+ });
87
+ }
88
+
89
+ RCT_EXPORT_METHOD(observeAllGlucoseData:(NSString *)token)
90
+ {
91
+ // [[NSUserDefaults standardUserDefaults] setObject:token forKey:@"authToken"];
92
+ // [[NSUserDefaults standardUserDefaults] synchronize];
93
+
94
+
95
+ // if (!sharedViewModel) {
96
+ // sharedViewModel = [[FinalViewModel alloc] init];
97
+ // }
98
+ // [sharedViewModel initialize];
99
+ }
100
+
36
101
  @end
@@ -20,7 +20,9 @@ let STAGE_ENC_KEY = "9Ddyaf6rfywpiTvTiax2iq6ykKpaxgJ6"
20
20
  let PROD_ENC_IV = "9Ddyaf6rfywpiTvT"
21
21
  let STAGE_ENC_IV = "9Ddyaf6rfywpiTvT"
22
22
 
23
- let TOKEN = "ILtFcw+xtbuy8IgsBCSyD6nSpgZd5AOz7T+g3N8Tef/IN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KyQbQudW7gLH8WjqORNG2dsplOLzDQ0y7nQdQ0tWrLJtnAch0p5PyTXtunlkNWeuzrldkqVMTUPaAtGcEnmS4RFncD3C6sq9V6lpBKLdrh99vnH3EX81DTH2Hrqm0bN5Tl3UqzUJ7n/JQCR3phDmOo+Uk81y3z3ikiGZZpZikN7c3DtSP34Vc+cNUosWrChqj1gLL4Eg/jMDxE4+bdAGr03ALxEAj2uLGEsDaZRuio6e8/iMcA0z3oqhtAxQ0nU1ivAK7cHeddjRFtvrNb0l+TgrcQI9UVffMOoGDEfAQNUpT2+R5dIysw=="
25
+ let TOKEN = UserDefaults.standard.string(forKey: "authToken") ?? defaultToken
24
26
 
25
27
 
26
28
  /*TatvaEncryptionConfig {
@@ -42,7 +42,8 @@ class ConnectToSensorViewController: UIViewController {
42
42
  case success
43
43
  case error
44
44
  }
45
-
45
+
46
+ var connectedTime: Date?
46
47
  var connected:(()->())?
47
48
  var screenType: enumScreenType = .camera
48
49
  var isCodeDetected = false
@@ -222,7 +223,7 @@ class ConnectToSensorViewController: UIViewController {
222
223
  let btStatus: BluetoothManagerStatus = BluetoothManagerStatus(rawValue: newValue) ?? .scanStart
223
224
 
224
225
  if btStatus == .initialStart {
225
-
226
+ self.connectedTime = Date()
226
227
  print("Success")
227
228
  screenType = .success
228
229
  tableView.reloadData()
@@ -329,15 +330,25 @@ extension ConnectToSensorViewController: UITableViewDelegate, UITableViewDataSou
329
330
  return cell
330
331
  }
331
332
  case .success:
332
- switch enumSuccessTableRow(rawValue: indexPath.row)! {
333
- case .success:
334
- let cell: ConnectSuccessTVC = tableView.dequeueReusableCell(for: indexPath)
335
- cell.labelDate.text = "Connected on 12:00PM, 03:00 PM"
336
- cell.labelDesc.isHidden = true
337
- cell.labelTitle.text = "Sensor Connected Successfully"
338
- cell.setImageForCGM()
339
- return cell
333
+ switch enumSuccessTableRow(rawValue: indexPath.row)! {
334
+ case .success:
335
+ let cell: ConnectSuccessTVC = tableView.dequeueReusableCell(for: indexPath)
336
+ let dateFormatter = DateFormatter()
337
+ dateFormatter.dateFormat = "dd-MM-yyyy hh:mm a"
338
+ dateFormatter.timeZone = TimeZone.current
339
+
340
+ if let connectedTime = connectedTime {
341
+ // Convert the Date to a String
342
+ let dateString = dateFormatter.string(from: connectedTime)
343
+ cell.labelDate.text = "Connected on \(String(describing: dateString))"
344
+ } else {
345
+ cell.labelDate.text = ""
340
346
  }
347
+ cell.labelDesc.isHidden = true
348
+ cell.labelTitle.text = "Sensor Connected Successfully"
349
+ cell.setImageForCGM()
350
+ return cell
351
+ }
341
352
  case .error:
342
353
  switch enumFailureTableRow(rawValue: indexPath.row)! {
343
354
  case .failAnimation:
@@ -51,7 +51,8 @@ class ConnectToTransmitterViewController: UIViewController, KLTBluetoothDelegate
51
51
 
52
52
  var screenType: enumScreenType = .searching
53
53
  var devices: [(peripheral: CBPeripheral,name: String)] = []
54
- var isForReconnect: Bool = false
54
+ @objc var isForReconnect: Bool = false
55
+ var connectedTime: Date?
55
56
 
56
57
  var foundDevices: NSMutableArray = []
57
58
  let manager = KLTBluetoothManager.shared()
@@ -91,11 +92,16 @@ class ConnectToTransmitterViewController: UIViewController, KLTBluetoothDelegate
91
92
  bottomButton.hideRightArrow()
92
93
  }
93
94
  bottomButton.buttonTapCallback = {
95
+ if self.isForReconnect {
96
+ self.dismiss(animated:true)
97
+ } else {
98
+
94
99
  let vc = ConnectToSensorViewController.instantiate(fromStoryboard: Enum_stroyboard.Main.rawValue)
95
100
  vc.connected = {
96
101
  //self.showConfirmInsulinUser()
97
102
  }
98
103
  self.navigationController?.pushViewController(vc, animated: false)
104
+ }
99
105
  }
100
106
 
101
107
  customTopView.onCloseTapped = {
@@ -227,6 +233,7 @@ extension ConnectToTransmitterViewController: UITableViewDelegate, UITableViewDa
227
233
  let peripheral = self.foundDevices[indexPath.row] as! CBPeripheral
228
234
  if let device = KLTDatabaseHandler.shared().queryDevice(withId: peripheral.identifier.uuidString) {
229
235
  //let snLocalName = device.advertise?.localName?.trimmingCharacters(in: .whitespacesAndNewlines)
236
+ self.connectedTime = Date()
230
237
  print("Connected device", device)
231
238
  self.manager?.readyToConnectedPeripheral = peripheral
232
239
  self.screenType = .success
@@ -240,6 +247,21 @@ extension ConnectToTransmitterViewController: UITableViewDelegate, UITableViewDa
240
247
  switch enumSuccessTableRow(rawValue: indexPath.row)! {
241
248
  case .success:
242
249
  let cell: ConnectSuccessTVC = tableView.dequeueReusableCell(for: indexPath)
250
+ if let device = KLTDatabaseHandler.shared().queryDevice(withId: manager?.readyToConnectedPeripheral.identifier.uuidString) {
251
+ let name = device.advertise?.localName?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
252
+ let dateFormatter = DateFormatter()
253
+ dateFormatter.dateFormat = "dd-MM-yyyy hh:mm a"
254
+ dateFormatter.timeZone = TimeZone.current
255
+
256
+ if let connectedTime = connectedTime {
257
+ // Convert the Date to a String
258
+ let dateString = dateFormatter.string(from: connectedTime)
259
+ cell.labelDate.text = "Connected on \(String(describing: dateString))"
260
+ } else {
261
+ cell.labelDate.text = ""
262
+ }
263
+ cell.labelDesc.text = "Sno: \(name)"
264
+ }
243
265
  return cell
244
266
  case .importantNote:
245
267
  let cell: NoteTVC = tableView.dequeueReusableCell(for: indexPath)
@@ -59,6 +59,18 @@ class ProvidePermissionViewController: UIViewController {
59
59
  self.navigationController?.pushViewController(vc, animated: false)
60
60
  }
61
61
  updateBottomButtonState()
62
+
63
+ // Initialize the CBCentralManager with the current view controller as the delegate
64
+ centralManager = CBCentralManager(delegate: self, queue: nil)
65
+ // If the switch is turned on, check if Bluetooth is powered on
66
+ checkBluetoothPermission()
67
+
68
+ // Initialize the CLLocationManager
69
+ locationManager = CLLocationManager()
70
+ locationManager?.delegate = self
71
+ locationManager?.requestWhenInUseAuthorization()
72
+ // Check location permission on view load
73
+ checkLocationPermission()
62
74
  }
63
75
 
64
76
  private func updateBottomButtonState() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mytatva-rn-sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "a package to inject data into visit health pwa",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",