diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 61b6c0af..6fe4859d 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -35,12 +35,14 @@ var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil flutterViewController = mainViewController HMGPlatformBridge.initialize(flutterViewController: flutterViewController) BLEPlatformBridge.initialize(flutterViewController: flutterViewController) +// BLEPlatformBridgeEKG.initialize(flutterViewController: flutterViewController) // platform initialization for EKG OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok")) }else if let mainViewController = initialViewController(){ // platform initialization suppose to be in background flutterViewController = mainViewController HMGPlatformBridge.initialize(flutterViewController: flutterViewController) BLEPlatformBridge.initialize(flutterViewController: flutterViewController) +// BLEPlatformBridgeEKG.initialize(flutterViewController: flutterViewController) // platform initialization for EKG OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok")) } } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index d93c2a0c..7209328e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -573,8 +573,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { }, onLoginClick: () { // login(); - Navigator.push(context, FadePage(page: BpTrackerBLE())); - // Navigator.push(context, FadePage(page: EKG_BLE())); + // Navigator.push(context, FadePage(page: BpTrackerBLE())); + Navigator.push(context, FadePage(page: EKG_BLE())); + // Navigator.push(context, FadePage(page: Oxymeter_BLE())); }, onMedicalFileClick: () { changeCurrentTab(1); diff --git a/lib/pages/medical/my_trackers/viatom_devices/ekg_tracker_ble.dart b/lib/pages/medical/my_trackers/viatom_devices/ekg_tracker_ble.dart index 5a590543..872ebdbd 100644 --- a/lib/pages/medical/my_trackers/viatom_devices/ekg_tracker_ble.dart +++ b/lib/pages/medical/my_trackers/viatom_devices/ekg_tracker_ble.dart @@ -26,6 +26,9 @@ class EKG_BLE extends StatefulWidget { class _EKG_BLEState extends State { EventChannel eventChannel = EventChannel('BLE-Platform-Bridge-Event'); + + // EventChannel eventChannelIOSEKG = EventChannel('BLE-Platform-Bridge-IOS-EKG'); + String receivedData = ''; final ekgValueNotifier = ValueNotifier("start"); @@ -164,7 +167,10 @@ class _EKG_BLEState extends State { parseEKGRealTimeDataObject(event['data']); } }); - await BleChannel.getScanningResult(["oximeter", "ekg"]); + // eventChannelIOSEKG.receiveBroadcastStream().listen((event) { + // print('Received eventChannelIOSEKG event---: $event'); + // }); + await BleChannel.getScanningResult(["ekg", "DuoEK"]); }, textColor: Colors.white, ), diff --git a/lib/pages/medical/my_trackers/viatom_devices/oxymeter_ble.dart b/lib/pages/medical/my_trackers/viatom_devices/oxymeter_ble.dart index 9277018c..a4792c08 100644 --- a/lib/pages/medical/my_trackers/viatom_devices/oxymeter_ble.dart +++ b/lib/pages/medical/my_trackers/viatom_devices/oxymeter_ble.dart @@ -17,8 +17,8 @@ class _Oxymeter_BLEState extends State { final oxymeterValueNotifier = ValueNotifier("start"); - // String deviceName = "CheckMeO2"; - String deviceName = "POD"; + String deviceName = "CheckMeO2"; + // String deviceName = "POD"; @override void dispose() { diff --git a/lib/viatom_ble/ble_connect.dart b/lib/viatom_ble/ble_connect.dart index 4284b44e..4eb29b25 100644 --- a/lib/viatom_ble/ble_connect.dart +++ b/lib/viatom_ble/ble_connect.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/services.dart'; class BleChannel { @@ -5,11 +7,18 @@ class BleChannel { static const platform_ios_ekg = MethodChannel('BLE-Platform-Bridge-IOS-EKG'); + // static const platform_ios_ekg = MethodChannel('BLE-Platform-Bridge-IOS-EKG'); + //BLE-Platform-Bridge static Future getScanningResult(List deviceType) async { try { + String result; print("----------Flutter Init -------"); - final String result = await platform.invokeMethod('scan', deviceType); + // if (Platform.isIOS && deviceType[0] == "ekg") { + // result = await platform_ios_ekg.invokeMethod('scanEKG', deviceType); + // } else { + result = await platform.invokeMethod('scan', deviceType); + // } print("----------Flutter Result -------"); print(result); return result;