Health & Fitness

RSS for tag

Explore the technical aspects of health and fitness features, including sensor data acquisition, health data processing, and integration with the HealthKit framework.

Health & Fitness Documentation

Post

Replies

Boosts

Views

Activity

Health Export not complete
Good evening, when I use the automatic export feature from my iPhone, it successfully exports data. When reading the Export.xml file it is dispayed completely, with about 3 mio lines. When I check the file I see, that a lot of data is missing. E.g. the iPhone dispays the heart rates for several exercises (from last year), which don't have any correspondence in the export.xml file. Current exercises have. I am a developer myself and parsed all files without any error. My iPhone has enough free space (200GB or so) and iCloud has more than a TB free. Internet is connected via 1GBit line, WLAN with 800MBit and everything runs smooth. I would like to get a COMPLETE export of all the health data, without having to write a program on my own to accomplish this. Thank you. /C
0
0
231
Aug ’24
Developer Build Icon not showing in Apple Fitness
I am building an app that sends workout data to Apple Fitness. During development I noticed that my App Icon does not show up in Apple Fitness and it's just a blank space. The Icon seems to show just fine in Apple Health but not in Apple Fitness. I did the same test with the production version of my app and I can see the production icon just fine in Apple Fitness. I am trying to find information about which app Apple Fitness uses since it seems to differ from the one Apple Health uses. ChatGPT seems to think that Apple Fitness uses the App Store Connect icon (which I have for my prod app but not my dev app), but I cannot seem to verify that assumption with any kind of documentation. Can I please get information about which icon specifically Apple Fitness uses when displaying third party app integration information?
0
0
236
Aug ’24
CMBatchedSensorManager referenced on a iOS 15 device
We have an app that takes data from the accelerometer of the iPhone and watchOS. Some updates ago we included the high-frequency accelerometer for the watchOS with the CMBatchedSensorManager framework. We didn't test our app on iOS 16 or 15 devices, where that framework is unavailable, because the update was just for watchOS. We refer to that class just on a shared class, and was wrapped with an #if os(watchOS) condition. In our iPhone app, we import the CoreMotion framework but CMBatchedSensorManager is not used. Now, when you run the app on a device with iOS 15 you find this issue: dyld[17071]: Symbol not found: (OBJC_CLASS$_CMBatchedSensorManager) Referenced from: '/private/var/containers/Bundle/Application/C3CC754F-1674-4CBD-AD83-93229DDCF38D/Spleeft.app/Spleeft' Expected in: '/System/Library/Frameworks/CoreMotion.framework/CoreMotion' We need a solution to keep running our app on devices with iOS 15.0
2
0
356
Aug ’24
Missing app icon in the Fitness app
My iOS app has a correctly configured HealthKit integration. It successfully delivers all samples and data to HealthKit. For every workout sent to HealthKit, I can see the duration, workout name, calories, and other details. However, the app icon is missing. My project uses the Single Size setting for the app icon in the XCAssets folder. The app is available in the App Store in some regions. What can I do to fix this issue? The problem persists regardless of whether the device is running iOS 17 or 18.
3
1
400
Aug ’24
watchOS 11 beta 5 - Problem workout duration wrong on automatically appearing widget
On watchOS 11 when starting a workout session a widget appears automatically on the smart stack showing the pause or resume button. It´s a great feature, but my problem is that the duration is not showed correctly because the prepare phase of the workout and the pause / resume events are not taken into account calculating the duration. In my project I don´t use the workout builder. I have made a sample project with workout builder and there the duration is shown correctly. It would be great if this automatically appearing widget would also show the time correctly in case the workout builder is not used (prepare phase and pause resume events considered, otherwise it looks like a bug). Is there any way to opt out of this automatically appearing widget or could this be fixed? Any comments from an Apple engineer on this?
1
0
399
Aug ’24
Health app iOS 18 Public Beta: Can't record Sleep Process with iPhone only (without wearable)
Hello! My sleep process isn't recorded with iPhone only (without wearable device) on iOS 18. On previous iOS versions it was recorded but now it doesn't work. I compare iOS 17 and iOS 18 Beta and I see the difference that in Full Schedule was deleted tumbler "Track Time in Bed with iPhone" that helped to track sleep process without wearable device (I found it here: Health app -> Browse -> Sleep -> Your schedule block and tap on "Full Schedule & Options" -> Scroll to the bottom). I didn't find any information from Apple about this changes in change log. And one more time: I don't use Apple Watch or any wearable device. Do you have any information about sleep tracking with iPhone only? Can I track sleep process only with iPhone?
0
1
718
Aug ’24
Hi everyone,I'm developing a visionOS app using SwiftUI and RealityKit. I'm facing a challenge with fetching step data from HealthKit.
I have integrated HealthKit into my app to track and display step data. On my iPhone, the step data syncs and shows up immediately. However, when I try to fetch and display this data on my Vision Pro app, there's a noticeable delay before the data appears, even though I've given the necessary permissions and synced data through iCloud. Memory updated Here is your question in a similar format: Hi everyone, I'm developing a visionOS app using SwiftUI and RealityKit. I'm facing a challenge with fetching step data from HealthKit. Scenario: I have integrated HealthKit into my app to track and display step data. On my iPhone, the step data syncs and shows up immediately. However, when I try to fetch and display this data on my Vision Pro app, there's a noticeable delay before the data appears, even though I've given the necessary permissions and synced data through iCloud. Question: Why is there a delay in fetching step data from HealthKit on my Vision Pro app, and how can I reduce this delay to ensure real-time data display? Additional Information: I'm using HKStatisticsQuery to fetch the step data for the current day. The authorization for HealthKit is requested successfully. The data shows up after some time, but the initial delay is causing a poor user experience. Here is the relevant code snippet for fetching today's steps: class HealthManager: ObservableObject { let healthStore = HKHealthStore() @Published var activities: [String: Activity] = [:] init() { let steps = HKQuantityType(.stepCount) let healthTypes: Set = [steps] Task { do { try await healthStore.requestAuthorization(toShare: [], read: healthTypes) } catch { print("error fetching health data") } } } func fetchTodaySteps() { let steps = HKQuantityType(.stepCount) let predicate = HKQuery.predicateForSamples(withStart: .startOfDay, end: Date()) let query = HKStatisticsQuery(quantityType: steps, quantitySamplePredicate: predicate) { _, result, error in guard let quantity = result?.sumQuantity(), error == nil else { print("error fetching today's step data") return } let stepCount = quantity.doubleValue(for: .count()) print("stepCount \(stepCount)") } healthStore.execute(query) } } I'm open to alternative approaches if this method isn't the most efficient for real-time data fetching. Thanks in advance for any insights or suggestions! Best, Siddharth
3
0
584
Aug ’24
Can my iOS app access live cycling workout session data from the workouts app on the apple watch
Hello, I am trying to build a features where I want to monitor a user's biking workout session metrics like the current speed, average speed and distance travelled. I want to get these metrics as the user is actively doing a workout session in the Workouts app of the apple watch. Is it possible? Or it is not possible to get data from an active workout session from the workouts app.
0
0
329
Jul ’24
Linker errors when building with Xcode 15 and CocoaPods — building for iOS
** BUILD FAILED ** The following build commands failed: Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods') (1 failure) Testing with xcodebuild. -> mySDK_Staging (8.8.0) - WARN | attributes: Missing required attribute license. - WARN | license: Missing license type. - WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred. - WARN | [iOS] license: Unable to find a license file - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. - NOTE | xcodebuild: note: Using codesigning identity override: - - NOTE | [iOS] xcodebuild: note: Building targets in dependency order - NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
0
0
261
Jul ’24
Linker errors when building with Xcode 12 and CocoaPods — building for iOS
** BUILD FAILED ** The following build commands failed: Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods') (1 failure) Testing with xcodebuild. -> mySDK_Staging (8.8.0) - WARN | attributes: Missing required attribute license. - WARN | license: Missing license type. - WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred. - WARN | [iOS] license: Unable to find a license file - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. - NOTE | xcodebuild: note: Using codesigning identity override: - - NOTE | [iOS] xcodebuild: note: Building targets in dependency order - NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
0
0
247
Jul ’24
Xcode 15 and CocoaPods — building for iOS failed with Ld error
** BUILD FAILED ** The following build commands failed: Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods') (1 failure) Testing with xcodebuild. -> mySDK_Staging (8.8.0) - WARN | attributes: Missing required attribute license. - WARN | license: Missing license type. - WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred. - WARN | [iOS] license: Unable to find a license file - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. - NOTE | xcodebuild: note: Using codesigning identity override: - - NOTE | [iOS] xcodebuild: note: Building targets in dependency order - NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
0
0
254
Jul ’24
Resting Heart Rate - Individual readings?
I receive multiple resting heart rate readings throughout the day. I understand these readings are taken during the day while sedentary. However, if I query for: HKQuantityType.quantityType(forIdentifier: .restingHeartRate) I only receive ONE sample for the day, even though throughout the day multiple samples are observed. This is confirmed by looking at the Apple Health app and seeing only one recorded resting heart rate each day. Is there a way to get the individual resting heart rate readings for the .restingHeartRate type or am I stuck with querying the raw heart rate data for sedentary values (which don't always match Apples reported rhr)?
1
0
440
Jul ’24
Workout validation and Scheduler logic
Hey folks, a couple of questions regarding WorkoutKit: What happened to validation errors? They are mentioned in the WWDC23 video, but no longer are present in the API. It seems a fatal error is thrown if the workout fails validation (for example setting a negative distance in a workout goal). What is the logic of the WorkoutScheduler, if we try to add more workouts than is allowed? If the limit is 50, what happens when we try to add a 51st? Are workouts de-queued based on date or anything? API documentation is very sparse Do completed workouts and workouts with a scheduled date in the past stay in the WorkoutScheduler? Are we responsible for removing these? I guess my overall question regarding the WorkoutScheduler is, what are we responsible for managing and what is handled gracefully for us. None of these answers seem to be openly available, but if anyone know anecdotally or even better from the WorkoutKit team, I'd be very grateful! Thanks!
1
1
387
Jul ’24
Step Data Duplication Issue with Apple Health Integration
We are integrating Apple Health step data into our mobile application, Diyetkolik. However, we have received feedback from our users indicating that the step data appears to be significantly higher than expected. After conducting thorough research, we discovered that users who wear a smartwatch are experiencing step data duplication. Both the smartwatch and the phone's step data are being collected and combined, leading to inflated step counts in our application. We kindly request your assistance in addressing the following issues: How can we differentiate between step data from the smartwatch and the phone to avoid duplication? Are there best practices or specific APIs we should use to filter and manage step data more accurately? Can you provide guidance on how to implement a solution that ensures accurate step count data for users wearing multiple devices? We appreciate your support in resolving this matter to enhance the accuracy of our application and improve user experience.
1
0
488
Jul ’24
Scale app for coffee and small dishes
I just want to make my V60 coffee I found out that my electronic scale ran out of battery and there is no charger in my work location and I also work on a remote area nearest city about 100 km so, I grab my iPhone to find out is there any app can scale my coffee grams and water mills by putting coffee bin above the iPhone for measuring it’s weight. The answer is no, there are no apps for measuring weight of coffee bens and water droplets to make V60 coffee. Still I have made my coffee perfectly from my experience. I am writing this post just to have scale app at my iPhone and also if I can get some money it is good because no one can say no for the money
4
0
473
Jul ’24