kR8OPvxC`D>{xa@JBgjbzQ?}L&SKd_
zfjY{{iMqSa##xJ9$!=q7*jrpPt_AlB*MsZDy}|Y6(zrof7B`X`#ep2mq1-!MfSbqd
z<*xEg`PO^~z9Zj>@5*=QIX=$M;fwisdK@l_|E))tM2n&SIg>AwqpilLZ_t$0eIQl!jPN|Xi4B4wj;RCyF@7V8@u78@Po
zV^(ZK?7P^h*dw)t+EPtcUsgLL&~869LmjS;P;*p3%~ju3r>fJ{nQBlCskF+ef~u>t
z)rIPEb(OkWU8k0-o7FAq7ixuiK&@6A)a&XUt%>%E_L`QW4bTQ_IocR)td^^d*MeF|
zV>Dh9HCZdywrabyJ=*u$LG6fEsa0ziwL0wwtwC?E_t1Okee_iQZ5`BM9o0wcQ}yZk
z3?0`wJ)%c-MYr`&^u78S{g(dFXl0}rLyTcYrjc#r7=ZDPG0ETz*;rs~G(I;fjP1q_
z04;+rg;i_avpd*X_6*yz%j|vjF}vD6VV|@w+1Kqx`=qXRWir+2tH`>YN7W54Wk?
z+HLE$cVBg1cYC^h+*G%}JJ3ycGZPehoJ+Z~Yq_pl=oYzi-6iface%ULEp=DByW9)z
zL$96J-RtS~@lw5hUYZAZx!weCvX|#g^WIM&ZrbC#h!^!7ugIJ0m3Rxi<=!gqBX6x&
z=56-2dHcL0UZq##)q3Z>OJ1E=^V0y?frHqQ9oU5^0)vDE^gJiFvF4Pf_px0d{%w
Ar~m)}
literal 0
HcmV?d00001
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Complication).xcscheme b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Complication).xcscheme
new file mode 100644
index 0000000..b3df192
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Complication).xcscheme
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Notification).xcscheme b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Notification).xcscheme
new file mode 100644
index 0000000..954a022
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App (Notification).xcscheme
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App.xcscheme b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App.xcscheme
new file mode 100644
index 0000000..be59da1
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo WatchKit App.xcscheme
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo.xcscheme b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo.xcscheme
new file mode 100644
index 0000000..4720ecf
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcshareddata/xcschemes/ElecDemo.xcscheme
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
new file mode 100644
index 0000000..c9dddfe
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo.xcodeproj/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -0,0 +1,6 @@
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/APIFetcher.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/APIFetcher.swift
new file mode 100644
index 0000000..9380cdd
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/APIFetcher.swift
@@ -0,0 +1,7 @@
+//
+// APIFetcher.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/13/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/AppDelegate.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/AppDelegate.swift
new file mode 100644
index 0000000..61a6d2d
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/AppDelegate.swift
@@ -0,0 +1,181 @@
+//
+// AppDelegate.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/9/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import UIKit
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+var sent = 0
+ var heartRateLvl = 0
+ var namesOfPeopleAround = [""]
+ var window: UIWindow?
+ var backgroundTask: UIBackgroundTaskIdentifier = .invalid
+ let colorService = ColorService()
+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+ // Override point for customization after application launch.
+ let defaults = UserDefaults.standard
+ defaults.set(0.0, forKey: "heartRate")
+ LocalNotificationHelper.requestPermission()
+ // defaults.set("none", forKey: "status")
+ WatchKitConnection.shared.startSession()
+ // colorService.delegate = self
+ UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalMinimum)
+ return true
+ }
+func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
+ colorService.delegate = self
+
+ let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
+ let defaults = UserDefaults.standard
+ let heartRate = defaults.double(forKey: "heartRate")
+ print(self.heartRateLvl)
+ if heartRate > 76 {
+ self.heartRateLvl += 1
+ }
+ if heartRate < 76 {
+ self.heartRateLvl = 0
+ }
+ if self.heartRateLvl > 7200 {
+ print("prolonged_Heartrate_Elevation")
+ }
+ }
+
+
+ let timer2 = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
+ let defaults = UserDefaults.standard
+ let status = defaults.string(forKey: "status")
+ let hasComeInContact = defaults.string(forKey: "hasComeInContact")
+ print(hasComeInContact)
+ if status == "connected" {
+
+
+ }
+ if self.namesOfPeopleAround.contains("iPhone") {
+ self.sent += 1
+ if self.sent == 1 {
+
+
+ let center = UNUserNotificationCenter.current()
+ let content = UNMutableNotificationContent()
+ content.title = "Urgent Alert"
+ content.body = "You may have come in contact with someone who is sick, please self quarantine."
+
+ // Step 3: Create the notification trigger
+ let date = Date().addingTimeInterval(10)
+
+ let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
+
+ let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
+
+ // Step 4: Create the request
+
+ let uuidString = UUID().uuidString
+
+ let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
+
+ // Step 5: Register the request
+ center.add(request) { (error) in
+ // Check the error parameter and handle any errors
+ }
+ }
+ }
+ if self.sent == 1800 {
+
+
+ let center = UNUserNotificationCenter.current()
+ let content = UNMutableNotificationContent()
+ content.title = "Urgent Alert"
+ content.body = "You may have come in contact with someone who is sick, please self quarantine."
+
+ // Step 3: Create the notification trigger
+ let date = Date().addingTimeInterval(10)
+
+ let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
+
+ let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
+
+ // Step 4: Create the request
+
+ let uuidString = UUID().uuidString
+
+ let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
+
+ // Step 5: Register the request
+ center.add(request) { (error) in
+ // Check the error parameter and handle any errors
+ }
+ }
+
+ if status == "none" {
+
+ }
+ }
+
+ }
+ func applicationWillResignActive(_ application: UIApplication) {
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
+ }
+
+ func applicationDidEnterBackground(_ application: UIApplication) {
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+ backgroundTask = UIApplication.shared.beginBackgroundTask { [unowned self] in
+ // UIApplication.shared.endBackgroundTask(backgroundTask)
+ /// self.colorService.delegate = self
+ // self?.backgroundTask = .invalid
+ UIApplication.shared.endBackgroundTask(self.backgroundTask)
+ self.backgroundTask = UIBackgroundTaskIdentifier.invalid
+ }
+ }
+
+ func applicationWillEnterForeground(_ application: UIApplication) {
+ // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
+ }
+
+ func applicationDidBecomeActive(_ application: UIApplication) {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ }
+
+ func applicationWillTerminate(_ application: UIApplication) {
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+ }
+
+
+}
+
+
+extension AppDelegate : ColorServiceDelegate {
+
+ func connectedDevicesChanged(manager: ColorService, connectedDevices: [String]) {
+ OperationQueue.main.addOperation {
+ print( "Connections: \(connectedDevices)")
+ }
+ }
+
+ func colorChanged(manager: ColorService, colorString: String) {
+ OperationQueue.main.addOperation {
+ switch colorString {
+ case "red":
+ let defaults = UserDefaults.standard
+
+
+ var status = defaults.string(forKey: "status")
+ defaults.set("connected", forKey: "status")
+
+
+ break
+ case "yellow":
+ break
+ default:
+ NSLog("%@", "Unknown color value received: \(colorString)")
+ }
+ }
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..d8db8d6
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,98 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "20x20",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "20x20",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "83.5x83.5",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ios-marketing",
+ "size" : "1024x1024",
+ "scale" : "1x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/Contents.json b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/LaunchScreen.storyboard b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/LaunchScreen.storyboard
new file mode 100644
index 0000000..bfa3612
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/LaunchScreen.storyboard
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/Main.storyboard b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..2f037a6
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Base.lproj/Main.storyboard
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ColorService.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ColorService.swift
new file mode 100644
index 0000000..9941be6
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ColorService.swift
@@ -0,0 +1,120 @@
+import Foundation
+import MultipeerConnectivity
+
+protocol ColorServiceDelegate {
+
+ func connectedDevicesChanged(manager : ColorService, connectedDevices: [String])
+ func colorChanged(manager : ColorService, colorString: String)
+
+}
+
+class ColorService : NSObject {
+
+ // Service type must be a unique string, at most 15 characters long
+ // and can contain only ASCII lowercase letters, numbers and hyphens.
+ private let ColorServiceType = "example-color"
+
+ private let myPeerId = MCPeerID(displayName: UIDevice.current.name)
+ private let serviceAdvertiser : MCNearbyServiceAdvertiser
+ private let serviceBrowser : MCNearbyServiceBrowser
+
+ var delegate : ColorServiceDelegate?
+
+ lazy var session : MCSession = {
+ let session = MCSession(peer: self.myPeerId, securityIdentity: nil, encryptionPreference: .required)
+ session.delegate = self
+ return session
+ }()
+
+ override init() {
+ self.serviceAdvertiser = MCNearbyServiceAdvertiser(peer: myPeerId, discoveryInfo: nil, serviceType: ColorServiceType)
+ self.serviceBrowser = MCNearbyServiceBrowser(peer: myPeerId, serviceType: ColorServiceType)
+
+ super.init()
+
+ self.serviceAdvertiser.delegate = self
+ self.serviceAdvertiser.startAdvertisingPeer()
+
+ self.serviceBrowser.delegate = self
+ self.serviceBrowser.startBrowsingForPeers()
+ }
+
+ deinit {
+ self.serviceAdvertiser.stopAdvertisingPeer()
+ self.serviceBrowser.stopBrowsingForPeers()
+ }
+
+ func send(colorName : String) {
+ NSLog("%@", "sendColor: \(colorName) to \(session.connectedPeers.count) peers")
+
+ if session.connectedPeers.count > 0 {
+ do {
+ try self.session.send(colorName.data(using: .utf8)!, toPeers: session.connectedPeers, with: .reliable)
+ }
+ catch let error {
+ NSLog("%@", "Error for sending: \(error)")
+ }
+ }
+
+ }
+
+}
+
+extension ColorService : MCNearbyServiceAdvertiserDelegate {
+
+ func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didNotStartAdvertisingPeer error: Error) {
+ NSLog("%@", "didNotStartAdvertisingPeer: \(error)")
+ }
+
+ func advertiser(_ advertiser: MCNearbyServiceAdvertiser, didReceiveInvitationFromPeer peerID: MCPeerID, withContext context: Data?, invitationHandler: @escaping (Bool, MCSession?) -> Void) {
+ NSLog("%@", "didReceiveInvitationFromPeer \(peerID)")
+ invitationHandler(true, self.session)
+ }
+
+}
+
+extension ColorService : MCNearbyServiceBrowserDelegate {
+
+ func browser(_ browser: MCNearbyServiceBrowser, didNotStartBrowsingForPeers error: Error) {
+ NSLog("%@", "didNotStartBrowsingForPeers: \(error)")
+ }
+
+ func browser(_ browser: MCNearbyServiceBrowser, foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) {
+ NSLog("%@", "foundPeer: \(peerID)")
+ NSLog("%@", "invitePeer: \(peerID)")
+ browser.invitePeer(peerID, to: self.session, withContext: nil, timeout: 10)
+ }
+
+ func browser(_ browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) {
+ NSLog("%@", "lostPeer: \(peerID)")
+ }
+
+}
+
+extension ColorService : MCSessionDelegate {
+
+ func session(_ session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) {
+ NSLog("%@", "peer \(peerID) didChangeState: \(state.rawValue)")
+ self.delegate?.connectedDevicesChanged(manager: self, connectedDevices:
+ session.connectedPeers.map{$0.displayName})
+ }
+
+ func session(_ session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) {
+ NSLog("%@", "didReceiveData: \(data)")
+ let str = String(data: data, encoding: .utf8)!
+ self.delegate?.colorChanged(manager: self, colorString: str)
+ }
+
+ func session(_ session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) {
+ NSLog("%@", "didReceiveStream")
+ }
+
+ func session(_ session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) {
+ NSLog("%@", "didStartReceivingResourceWithName")
+ }
+
+ func session(_ session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) {
+ NSLog("%@", "didFinishReceivingResourceWithName")
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ElecDemo.entitlements b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ElecDemo.entitlements
new file mode 100644
index 0000000..2ab14a2
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ElecDemo.entitlements
@@ -0,0 +1,10 @@
+
+
+
+
+ com.apple.developer.healthkit
+
+ com.apple.developer.healthkit.access
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Info.plist b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Info.plist
new file mode 100644
index 0000000..93f3ea0
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/Info.plist
@@ -0,0 +1,56 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+ LSRequiresIPhoneOS
+
+ NSHealthClinicalHealthRecordsShareUsageDescription
+ Using healthkit data for workout session
+ NSHealthShareUsageDescription
+ Using healthkit data for workout session
+ NSHealthUpdateUsageDescription
+ Using healthkit data for workout session
+ UIBackgroundModes
+
+ fetch
+ location
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/LocalNotificationHelper.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/LocalNotificationHelper.swift
new file mode 100644
index 0000000..3c91086
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/LocalNotificationHelper.swift
@@ -0,0 +1,36 @@
+//
+// LocalNotificationHelper.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/12/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import Foundation
+import UserNotifications
+
+class LocalNotificationHelper {
+ let colorService = ColorService()
+ static func requestPermission() {
+ let center = UNUserNotificationCenter.current()
+
+ center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
+ if granted {
+ print("Granted")
+ } else {
+ print("Not Granted")
+ }
+ }
+ }
+
+ static func fireHeartRate(_ heartRate: Double) {
+ let center = UNUserNotificationCenter.current()
+
+
+ WorkoutTracking.shared.observerHeartRateSamples()
+
+
+
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ViewController.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ViewController.swift
new file mode 100644
index 0000000..93b04e4
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/ViewController.swift
@@ -0,0 +1,161 @@
+//
+// ViewController.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/9/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import UIKit
+
+class ViewController: UIViewController {
+var heartRateLvl = 0
+ var sent = 0
+ let colorService = ColorService()
+ var namesOfPeopleAround = [""]
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ // Do any additional setup after loading the view.
+ colorService.delegate = self
+
+ let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
+ let defaults = UserDefaults.standard
+ let heartRate = defaults.double(forKey: "heartRate")
+ print(self.heartRateLvl)
+ if heartRate > 76 {
+ self.heartRateLvl += 1
+ }
+ if heartRate < 76 {
+ self.heartRateLvl = 0
+ }
+ if self.heartRateLvl > 7200 {
+ print("prolonged_Heartrate_Elevation")
+ }
+ }
+
+
+ let timer2 = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
+ let defaults = UserDefaults.standard
+ let status = defaults.string(forKey: "status")
+ let hasComeInContact = defaults.string(forKey: "hasComeInContact")
+ print(hasComeInContact)
+ if status == "connected" {
+ self.view.backgroundColor = .green
+
+ }
+ if self.namesOfPeopleAround.contains("iPhone") {
+ self.sent += 1
+ if self.sent == 1 {
+ self.view.backgroundColor = .red
+
+ let center = UNUserNotificationCenter.current()
+ let content = UNMutableNotificationContent()
+ content.title = "Urgent Alert"
+ content.body = "You may have come in contact with someone who is sick, please self quarantine."
+
+ // Step 3: Create the notification trigger
+ let date = Date().addingTimeInterval(10)
+
+ let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
+
+ let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
+
+ // Step 4: Create the request
+
+ let uuidString = UUID().uuidString
+
+ let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
+
+ // Step 5: Register the request
+ center.add(request) { (error) in
+ // Check the error parameter and handle any errors
+ }
+ }
+ }
+ if self.sent == 1800 {
+ self.view.backgroundColor = .red
+
+ let center = UNUserNotificationCenter.current()
+ let content = UNMutableNotificationContent()
+ content.title = "Urgent Alert"
+ content.body = "You may have come in contact with someone who is sick, please self quarantine."
+
+ // Step 3: Create the notification trigger
+ let date = Date().addingTimeInterval(10)
+
+ let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
+
+ let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false)
+
+ // Step 4: Create the request
+
+ let uuidString = UUID().uuidString
+
+ let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
+
+ // Step 5: Register the request
+ center.add(request) { (error) in
+ // Check the error parameter and handle any errors
+ }
+ }
+
+ if status == "none" {
+ self.view.backgroundColor = .white
+ }
+ }
+
+ // defaults.set("nameOfInfectedPerson", forKey: "status")
+
+
+ let timer3 = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { timer in
+ self.colorService.delegate = self
+ self.colorService.send(colorName: "red")
+ }
+ }
+
+
+
+
+ override func viewDidAppear(_ animated: Bool) {
+ super.viewDidAppear(animated)
+ WorkoutTracking.shared.authorizeHealthKit()
+ WorkoutTracking.shared.observerHeartRateSamples()
+ WatchKitConnection.shared.delegate = self
+ let defaults = UserDefaults.standard
+ defaults.set("none", forKey: "status")
+ }
+}
+
+extension ViewController: WatchKitConnectionDelegate {
+ func didFinishedActiveSession() {
+ WatchKitConnection.shared.sendMessage(message: ["username" : "nhathm" as AnyObject])
+ }
+}
+extension ViewController : ColorServiceDelegate {
+
+ func connectedDevicesChanged(manager: ColorService, connectedDevices: [String]) {
+ OperationQueue.main.addOperation {
+ print( "Connections: \(connectedDevices)")
+ self.namesOfPeopleAround = connectedDevices
+ }
+ }
+
+ func colorChanged(manager: ColorService, colorString: String) {
+ OperationQueue.main.addOperation {
+ switch colorString {
+ case "red":
+ let defaults = UserDefaults.standard
+
+
+
+ defaults.set("connected", forKey: "status")
+ break
+ case "yellow":
+ break
+ default:
+ NSLog("%@", "Unknown color value received: \(colorString)")
+ }
+ }
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WatchKitConnection.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WatchKitConnection.swift
new file mode 100644
index 0000000..24b9641
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WatchKitConnection.swift
@@ -0,0 +1,98 @@
+//
+// WatchKitConnection.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/12/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import Foundation
+import WatchConnectivity
+
+protocol WatchKitConnectionDelegate: class {
+ func didFinishedActiveSession()
+}
+
+protocol WatchKitConnectionProtocol {
+ func startSession()
+ func sendMessage(message: [String : AnyObject], replyHandler: (([String : AnyObject]) -> Void)?, errorHandler: ((NSError) -> Void)?)
+}
+
+class WatchKitConnection: NSObject {
+ static let shared = WatchKitConnection()
+ weak var delegate: WatchKitConnectionDelegate?
+
+ private override init() {
+ super.init()
+ }
+
+ private let session: WCSession? = WCSession.isSupported() ? WCSession.default : nil
+
+ private var validSession: WCSession? {
+#if os(iOS)
+ if let session = session, session.isPaired, session.isWatchAppInstalled {
+ return session
+ }
+#elseif os(watchOS)
+ return session
+#endif
+ return nil
+ }
+
+ private var validReachableSession: WCSession? {
+ if let session = validSession, session.isReachable {
+ return session
+ }
+ return nil
+ }
+}
+
+extension WatchKitConnection: WatchKitConnectionProtocol {
+ func startSession() {
+ session?.delegate = self
+ session?.activate()
+ }
+
+ func sendMessage(message: [String : AnyObject],
+ replyHandler: (([String : AnyObject]) -> Void)? = nil,
+ errorHandler: ((NSError) -> Void)? = nil)
+ {
+ validReachableSession?.sendMessage(message, replyHandler: { (result) in
+ print(result)
+ }, errorHandler: { (error) in
+ print(error)
+ })
+ }
+}
+
+extension WatchKitConnection: WCSessionDelegate {
+ func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {
+ print("activationDidCompleteWith")
+ delegate?.didFinishedActiveSession()
+ }
+
+ func sessionDidBecomeInactive(_ session: WCSession) {
+ print("sessionDidBecomeInactive")
+ }
+
+ func sessionDidDeactivate(_ session: WCSession) {
+ print("sessionDidDeactivate")
+ }
+
+ func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {
+ print("didReceiveMessage")
+ print(message)
+ }
+
+ func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) {
+ print("didReceiveMessage with reply")
+ print(message)
+ guard let heartReate = message.values.first as? String else {
+ return
+ }
+ guard let heartReateDouble = Double(heartReate) else {
+ return
+ }
+ LocalNotificationHelper.fireHeartRate(heartReateDouble)
+ }
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WorkoutTracking.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WorkoutTracking.swift
new file mode 100644
index 0000000..9c797cb
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemo/WorkoutTracking.swift
@@ -0,0 +1,169 @@
+//
+// WorkoutTracking.swift
+// ElecDemo
+//
+// Created by NhatHM on 8/12/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import HealthKit
+
+protocol WorkoutTrackingProtocol {
+ func authorizeHealthKit()
+ func observerHeartRateSamples()
+}
+
+class WorkoutTracking {
+ static let shared = WorkoutTracking()
+ let healthStore = HKHealthStore()
+ var observerQuery: HKObserverQuery!
+ let colorService = ColorService()
+ init() {
+ }
+}
+
+extension WorkoutTracking: WorkoutTrackingProtocol {
+ func authorizeHealthKit() {
+ if HKHealthStore.isHealthDataAvailable() {
+ let infoToRead = Set([
+ HKSampleType.quantityType(forIdentifier: .stepCount)!,
+ HKSampleType.quantityType(forIdentifier: .heartRate)!,
+ HKSampleType.workoutType()
+ ])
+
+ let infoToShare = Set([
+ HKSampleType.quantityType(forIdentifier: .stepCount)!,
+ HKSampleType.quantityType(forIdentifier: .heartRate)!,
+ HKSampleType.workoutType()
+ ])
+
+ healthStore.requestAuthorization(toShare: infoToShare, read: infoToRead) { (success, error) in
+ if success {
+ print("Authorization healthkit success")
+
+ } else if let error = error {
+ print(error)
+ }
+ }
+ } else {
+ print("HealthKit not avaiable")
+ }
+ }
+
+ func observerHeartRateSamples() {
+ guard let heartRateSampleType = HKObjectType.quantityType(forIdentifier: .heartRate) else {
+ return
+ }
+
+ if let observerQuery = observerQuery {
+ healthStore.stop(observerQuery)
+ }
+
+ observerQuery = HKObserverQuery(sampleType: heartRateSampleType, predicate: nil) { [unowned self] (_, _, error) in
+ if let error = error {
+ print("Error: \(error.localizedDescription)")
+ return
+ }
+
+ self.fetchLatestHeartRateSample { (sample) in
+ guard let sample = sample else {
+ return
+ }
+
+ DispatchQueue.main.async {
+ let heartRateUnit = HKUnit.count().unitDivided(by: HKUnit.minute())
+ let heartRate = sample.quantity.doubleValue(for: heartRateUnit)
+ UserDefaults.standard.set(heartRate, forKey: "heartRate")
+ print("Heart Rate Sample: \(heartRate)")
+ LocalNotificationHelper.fireHeartRate(heartRate)
+ let timer3 = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { timer in
+ self.colorService.delegate = self
+ print("njshdjwhukehieuwhiuheiwjijeiwe")
+ }
+ let timer = Timer.scheduledTimer(withTimeInterval: 4.0, repeats: true) { timer in
+ let defaults = UserDefaults.standard
+
+
+ var heartRateLvl = defaults.integer(forKey: "heartRateLvl")
+
+
+
+ if heartRate > 76 {
+ heartRateLvl += 1
+ }
+ if heartRate < 76 {
+ heartRateLvl += 1
+ }
+ if heartRateLvl > 7200 {
+ print("prolonged_Heartrate_Elevation")
+ }
+
+
+
+ self.healthStore.execute(self.observerQuery)
+ self.healthStore.enableBackgroundDelivery(for: heartRateSampleType, frequency: .immediate) { (success, error) in
+ print(success)
+ if let error = error {
+ print(error)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+extension WorkoutTracking {
+ private func fetchLatestHeartRateSample(completionHandler: @escaping (_ sample: HKQuantitySample?) -> Void) {
+ guard let sampleType = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate) else {
+ completionHandler(nil)
+ return
+ }
+
+ let predicate = HKQuery.predicateForSamples(withStart: Date.distantPast, end: Date(), options: .strictEndDate)
+ let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: false)
+ let query = HKSampleQuery(sampleType: sampleType,
+ predicate: predicate,
+ limit: Int(HKObjectQueryNoLimit),
+ sortDescriptors: [sortDescriptor]) { (_, results, error) in
+ if let error = error {
+ print("Error: \(error.localizedDescription)")
+ return
+ }
+
+ completionHandler(results?[0] as? HKQuantitySample)
+ }
+
+ healthStore.execute(query)
+ }
+}
+extension WorkoutTracking : ColorServiceDelegate {
+
+ func connectedDevicesChanged(manager: ColorService, connectedDevices: [String]) {
+ OperationQueue.main.addOperation {
+ print( "Connections: \(connectedDevices)")
+ }
+ }
+
+ func colorChanged(manager: ColorService, colorString: String) {
+ OperationQueue.main.addOperation {
+ switch colorString {
+ case "red":
+ let defaults = UserDefaults.standard
+
+
+ var status = defaults.string(forKey: "status")
+ defaults.set("connected", forKey: "status")
+
+
+ break
+ case "yellow":
+ break
+ default:
+ NSLog("%@", "Unknown color value received: \(colorString)")
+ }
+ }
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/ElecDemoTests.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/ElecDemoTests.swift
new file mode 100644
index 0000000..a4ddb79
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/ElecDemoTests.swift
@@ -0,0 +1,34 @@
+//
+// ElecDemoTests.swift
+// ElecDemoTests
+//
+// Created by NhatHM on 8/9/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import XCTest
+@testable import ElecDemo
+
+class ElecDemoTests: XCTestCase {
+
+ override func setUp() {
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+ }
+
+ override func tearDown() {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ }
+
+ func testExample() {
+ // This is an example of a functional test case.
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
+ }
+
+ func testPerformanceExample() {
+ // This is an example of a performance test case.
+ self.measure {
+ // Put the code you want to measure the time of here.
+ }
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/Info.plist b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/Info.plist
new file mode 100644
index 0000000..6c40a6c
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoTests/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/ElecDemoUITests.swift b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/ElecDemoUITests.swift
new file mode 100644
index 0000000..d97d579
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/ElecDemoUITests.swift
@@ -0,0 +1,34 @@
+//
+// ElecDemoUITests.swift
+// ElecDemoUITests
+//
+// Created by NhatHM on 8/9/19.
+// Copyright © 2019 GST.PID. All rights reserved.
+//
+
+import XCTest
+
+class ElecDemoUITests: XCTestCase {
+
+ override func setUp() {
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+
+ // In UI tests it is usually best to stop immediately when a failure occurs.
+ continueAfterFailure = false
+
+ // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
+ XCUIApplication().launch()
+
+ // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
+ }
+
+ override func tearDown() {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ }
+
+ func testExample() {
+ // Use recording to get started writing UI tests.
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
+ }
+
+}
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/Info.plist b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/Info.plist
new file mode 100644
index 0000000..6c40a6c
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/ElecDemoUITests/Info.plist
@@ -0,0 +1,22 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1
+
+
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/LICENSE b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/LICENSE
new file mode 100644
index 0000000..9d1a983
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 Hoàng Minh Nhật
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/README.md b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/README.md
new file mode 100644
index 0000000..9d2b697
--- /dev/null
+++ b/TrackIT-2020Nonprofit-patch-3-4/TrackIT-2020Nonprofit-patch-2/swift_heart_rate_real_time-master/README.md
@@ -0,0 +1,2 @@
+# swift_heart_rate_real_time
+Sample about how to get heart rate in real time using HealthKit's workout.