Apple Watch

RSS for tag

Discuss hardware-specific topics related to Apple Watch.

Posts under Apple Watch tag

78 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Workout session active but "Return to app" option not displayed in menu
I have an iOS app, with a watch counterpart, used to enter scores for a match. The watch app starts a match (and a workout session) when it receives a notification from the mobile app, after the user started a match on their phone. Basically the watch app is just a more convenient way of inputing scores, so the user wouldn't have to reach for and unlock their phone every time - therefore the need for the watch app to always be displayed. The flow follows these steps: the user is prompted for workout session access when first launching the app; after they accept, I start the workout; the delegate method workoutSession(didChangeTo) returns the expected values; the app remains active, even when the user lowers their wrist; when I go to the clock, the app's icon is displayed in a circle at the top (bringing the app back to foreground on tap). The only problem is that the "Return to app" option in the "Return to Clock" settings menu is missing, what do I need to do in order to display it? Here's an example of what it looks like for the Strava app: and how it looks for mine.
0
0
128
5d
Watch OS 11 not charging
Just upgraded to Watch OS11 Beta with the watch on charge and put the watch on and it was only 40% charged. I put it back on the charger and it didn’t charge. I erased it and went to repair and it is flat 20 minutes after it was on 40% and sitting on the charger. the message on screen is ‘LOW BATTERY to continue, connect Apple Watch to it’s charger.’ Have I bricked my watch? Thanks
3
1
235
6d
Apple Watch HealthKit Queries Beyond 7 Days?
This has long been a frustration of mine on Apple Watch, and I've brought it up at WWDC labs every year to no avail but while the limitation on the Apple Watch to only be able to query 7 days of HealthKit data may have made sense early in the AW's lifetime for battery preservation etc., it really no longer makes sense in modern AW development. Especially not with stand alone watch apps, as a developer I am prohibited from building the same experience on the Apple Watch that I can in an iPhone app. For example, my app looks at your current health metrics and compares them to your 60 day baseline to identify any deviations from your normal ranges. I cannot create the same experience on the watch using purely HealthKit queries, and am limited to using either iCloud or Watch Connectivity which have their own drawbacks and are not an option for a stand alone watch app. Can we finally expand the length of HealthKit queries the AW can make so that we can build the same powerful experience on the watch that we can on iPhone? Thank you! Gary See also Feedback FB7649612 (from April 2020).
1
0
210
2w
Is there a way to know users have enabled pausing their Activity Rings?
Hi everyone, With iOS 18 and watchOS 11 it is possible to pause your activity rings so that a streak is not broken when you are ill or something like that. When we request data from the HealthStore, is there a way to know that a user has set this option for a particular date or period? Or will the data for that date just return nil for all 3 ring values or even skip the day in the dataset? I have an app in which I also keep track of people's streaks, so it would really useful to know if the activity rings are paused. Thanks in advance!
1
0
209
2w
Any changes in HRV sample frequency in watchOS 11?
Are there any changes in the frequency of HRV samples the Apple Watch takes in watchOS 11? Currently sample rates are very low except for users who have Afib History turned on. There should be some other way for users to get the benefit of more HRV sampling per day without needing to turn Afib History on if they haven't been diagnosed with Afib. Also is it possible for a 3rd party app to trigger an HRV sample? Thanks! Gary
2
1
304
2w
Seeking Advice on Real-Time Heartbeat Data from Apple Watch: Heart Rate vs. HKElectrocardiogram
Hello, I am developing an Apple Watch app in Swift and SwiftUI that needs to receive real-time heartbeat data to visualize the time intervals between heartbeats. The app draws circles on the screen where the size and position of each circle are based on the time interval between consecutive heartbeats. I am currently using the HKQuantityType for .heartRate from HealthKit to get heart rate data and calculate the intervals. However, I am wondering if this is the best approach for my requirement. I came across the HKElectrocardiogram class, and I am not sure if it would be a better fit for obtaining real-time heartbeat intervals. My questions are: Real-Time Heartbeats: Is HKQuantityType for .heartRate the most appropriate way to get real-time heartbeat data for calculating intervals between beats? Can HKElectrocardiogram provide real-time heartbeat intervals, or is it more suited for detailed ECG recordings rather than instantaneous heartbeats? Accuracy and Performance: Which method provides the most accurate and real-time data for heartbeat intervals? Are there any other APIs or services in the Apple Watch ecosystem that I should consider for this purpose? Best Practices: What are the best practices for implementing real-time heartbeat monitoring in an Apple Watch app? Are there any sample projects or documentation that could help me understand the optimal way to achieve this? Here is a brief overview of my current implementation using HKQuantityType for .heartRate: import Foundation import HealthKit class HeartRateMonitor: NSObject, ObservableObject { @Published var heartRate: Double = 0.0 @Published var intervals: [TimeInterval] = [] private var lastHeartRateTimestamp: Date? private var healthStore: HKHealthStore? private let heartRateQuantityType = HKObjectType.quantityType(forIdentifier: .heartRate) private let appStartTime: Date override init() { self.appStartTime = Date() super.init() if HKHealthStore.isHealthDataAvailable() { self.healthStore = HKHealthStore() self.requestAuthorization() } } private func requestAuthorization() { guard let heartRateQuantityType = self.heartRateQuantityType else { return } healthStore?.requestAuthorization(toShare: nil, read: [heartRateQuantityType]) { success, error in if success { self.startMonitoring() } } } func startMonitoring() { guard let heartRateQuantityType = self.heartRateQuantityType else { return } let query = HKAnchoredObjectQuery( type: heartRateQuantityType, predicate: nil, anchor: nil, limit: HKObjectQueryNoLimit) { (query, samples, deletedObjects, newAnchor, error) in guard let samples = samples as? [HKQuantitySample] else { return } self.process(samples: samples) } query.updateHandler = { (query, samples, deletedObjects, newAnchor, error) in guard let samples = samples as? [HKQuantitySample] else { return } self.process(samples: samples) } healthStore?.execute(query) } private func process(samples: [HKQuantitySample]) { for sample in samples { if sample.endDate > appStartTime { let heartRateUnit = HKUnit.count().unitDivided(by: HKUnit.minute()) let heartRate = sample.quantity.doubleValue(for: heartRateUnit) DispatchQueue.main.async { self.heartRate = heartRate if let lastTimestamp = self.lastHeartRateTimestamp { let interval = sample.endDate.timeIntervalSince(lastTimestamp) self.intervals.append(interval) } self.lastHeartRateTimestamp = sample.endDate } } } } } Thank you for your guidance and suggestions!
1
0
337
4w
Watch app wont install after download with Business Manager
We created an app for iphone which includes a Watch app. The app works well during debugging, and also in TestFlight the Watch app installs nicely and does what it is supposed to do. However, when we make the app available through the Apple Business Manager (the app is for internal use by a company) the Iphone app downloads without problems, but the app for the Apple Watch does not work. When I go to the Watch app on my Iphone (where you can manage the apps on your Watch and so on) my app is listed, but when I press install I see a loader for a few seconds, then it stops but nothing else happens. So the code seems to be good, but after I download the app with a code through the Business Manager, then I cannot install the Watch version of the app.
0
0
161
May ’24
Apple Watch can't always reconnect
Using Xcode to build and deploy the app to my watch, this is what I get: “Waiting to reconnect to Apple Watch. Previous preparation error: Transport error." And then “Connecting to Apple Watch. Xcode will continue when the operation completes.” And these messages continue to switch between each other. Sometimes the watch to connect and the application starts, but more often a scenario occurs with endless reconnection. I'm using: MacOS 14.4.1 (MacBook Pro 2019; 1.4 GHz Quad-Core Intel Core i5), Xcode 15.3, Watch OS 10.2 (Apple Watch SE 1), iOS 17.1.1 (iPhone 15 Pro). Methods I tried: Connecting Macbook, iPhone and Watch to the same WIfi network; Disabling Watch (and IPhone) from the "Devices and Simulators" menu and setting up Watch (and IPhone) from the beginning. Any help?
4
1
447
May ’24
File transfer to watch fails after OS update
When transferring files from iPhone to Watch, if you run the app and try to transfer after updating the OS, the transfer may not be possible. (or transmission seems to be too slow) Just completely close the app, restart it, and try again. Does anyone know the cause or solution to this problem? It happened after the last 17.5 update and today after the 17.5.1 update. The app doesn't crash or anything, and it doesn't happen often, so I didn't send any feedback or anything, but it's strange.
3
0
303
1w
Does WatchOS kill apps when in extreme temperatures?
I have noticed that my Apple Watch app seems to randomly quit from time to time. It's not crashing and I have not been able to reproduce it in a controlled setting, but have noticed that it seems to only happen when I'm in very high or low temperatures. For instance, I was skiing recently and my app was supposed to stay running the whole time, but often when I would raise my wrist it would be back on the home screen and my app wasn't running. This also happened when I was on the beach on a very hot day. But when I'm testing it at home I can keep it running for hours and it never crashes, which leads me to believe it may have to do with the temperature. Does the OS kill apps when it's running in very high or low temperatures? If so, is there anything I can do to prevent this from occurring? Would doing less things in my app possibly prevent this? For instance, I have a timer, and use a bunch of sensors, would turning those off at times and using less of the display make a difference or does the OS not care what the apps are actually doing? If not, any other ideas? Thanks
1
0
302
3w
How to release an iOS app that depends on having specific data in HealthKit?
I am developing an iOS app that utilizes the timeInDaylight data from HealthKit. This feature is available starting from iOS 17.0+, but it can only be recorded using the Apple Watch SE (2nd generation) and Apple Watch Series 6 or later. How should I release this app given its dependency on timeInDaylight data? Without this data, the app is useless. I understand that the App Store does not allow setting specific health data requirements. I am also concerned that including a "device requirements" warning in the App Store description might not pass the review process. Could you provide any advice on how to approach this situation? Thank you.
0
0
220
May ’24
WidgetKit - complication doesn't sync between watch and iPhone
I'm currently working with complication using widgetkit for watchOS. When I select complication from Watch app in iPhone, The complication does not show content. In complication gallery, untitled complication is selecting. But when I select complication from watch, it's OK. This bug occurs in both real device and simulator. But it happen in some pair. Example: watch ultra (os 10.4) pair with iPhone 14 pro (os 17.0): NG watch ultra (os 10.4) pair with iPhone 14 pro (os 16.1): NG watch ultra (os 10.0) pair with iPhone 14 pro (os 17.0): OK I tried create simple project to check this bug. But this bug still occurs This is sample project: Github
0
1
301
May ’24
WebKit Framework for watchOS
As part of a university project, we need to be able to display a website on an Apple Watch and log in to a service. Is it possible to get access to the WebKit framework in a watchOS app? We also need to be able to execute JavaScripts in the browser so that the login process works.
2
0
302
Apr ’24
My Apple Watch is not available as a build destination for xcode
A few days ago I was able to build to my apple watch which is paired to my iphone. I upgraded to the current release of IOS which is 17.4.1. I also updated my apple watch to 10.4. Once I completed these updates I had issue where the watch was running 10.4, but when I. viewed the apple watch using manage run destinations. It still said 10.1 I unplugged the iphone from mac a few times, restarted XCode but still could not use the apple watch to build a 10.4 build to it. I did my basic research and read that you also you might need to reboot the mac. After some time i decided to break the trust with my mac and apple watch, then since that time I have not been able to view it in the device list. Next steps taken, was to unpair the apple watch from my I phone and repair. Next on the Iphone I cleared trusted devices. Then I attached my iphone to the mac, and retrusted my iphone and apple watch. I also have the mac up to the newest version Sonoma 14.4.1 Xcode can see my IPhone, but not the watch xcrun devicectl list devices shows Devices: Name Hostname Identifier State Model Barry's IPhone 14 Pro Barrys-IPhone-14-Pro.coredevice.local xxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxA209B connected iPhone 14 Pro (iPhone15,2) Manage Run Destinations shows my IPhone details but still does not show any paired devices. I have made sure that the watch is in Developer Mode I have Associated Domains Developement enabled WidgetKit Developer Mode is disabled What would be my next steps in resolving this issue? Thanks
1
0
409
Apr ’24
WatchConnectivity
Good morning, I come to you for a question: When I install my application on my iPhone for the first time, and I install the watch application from the native "Watch" application, the Watch Connectivity function does not work, I have to do the installation from Xcode to the watch for this function to work. Is this normal? if yes, the problem will not arise during a publication? I have the same problem when using watch and iPhone simulators, WatchConnectivity does not work. I am this error code in Xcode: -[WCSession handleIncomingUserInfoWithPairingID:]_block_invoke delegate (null) does not implement session:didReceiveUserInfo:, discarding incoming content Here is the code for the iPhone and the watch: In my iPhone app: import WatchConnectivity let userDefaultsDataVenantWatch = UserDefaults.standard class PhoneDataModel : NSObject, WCSessionDelegate, ObservableObject { static let shared = PhoneDataModel() let session = WCSession.default @Published var TableauSynchroIphoneVersWatch : [String:String] = ["0":"0"] @Published var dataWatchVersIphone: [String:String] = ["":""] override init() { super.init() if WCSession.isSupported() { session.delegate = self session.activate() } else { print("ERROR: Watch session not supported") } } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { if let error = error { print("session activation failed with error: \(error.localizedDescription)") return } } func sessionDidBecomeInactive(_ session: WCSession) { session.activate() } func sessionDidDeactivate(_ session: WCSession) { session.activate() } func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any]) { guard let newCount = userInfo["TableauSynchroIphoneWatch"] as? [String:String] else { print("ERROR: unknown data received from Watch TableauSynchroIphoneWatch") return } DispatchQueue.main.async { print(newCount) } } } In my Watch app: import WatchConnectivity let userDefaultsDataVenantIphone = UserDefaults.standard var TableauVenantIphone:[String:String] = ["":""] class WatchDataModel : NSObject, WCSessionDelegate, ObservableObject { static let shared = WatchDataModel() let session = WCSession.default @Published var TableauSynchroIphoneWatch : [String:String] = ["0":"0"] override init() { super.init() if WCSession.isSupported() { session.delegate = self session.activate() } else { print("ERROR: Watch session not supported") } } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { if let error = error { print("session activation failed with error: \(error.localizedDescription)") return } } func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any]) { guard let newCount = userInfo["TableauSynchroIphoneVersWatch"] as? [String:String] else { print("ERROR: unknown data received from Watch TableauSynchroIphoneWatch") return } DispatchQueue.main.async { print(newCount) } } } Thank for your answers !
2
0
419
Apr ’24