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

Posts under Health & Fitness subtopic

Post

Replies

Boosts

Views

Activity

Your app uses the HealthKit or CareKit APIs but does not indicate integration with the Health app in your app description and clearly identify the HealthKit and CareKit functionality in your app's user interface.
Please help me to find out the below error related to health kit. Sometimes before we have start health kit implementation in our application, so we have enable the health kit setting form identifier(bundle ID) but now we don't need health kit so we remove all the configuration and code related to health kit from our application. We have summited our app on apple store with some other changes but app rejected from the below error. Guideline 2.5.1 - Performance - Software Requirements Your app uses the HealthKit or CareKit APIs but does not indicate integration with the Health app in your app description and clearly identify the HealthKit and CareKit functionality in your app's user interface. Next Steps To resolve this issue, please revise your app description to specify that your app integrates with the Health app, and clearly identify the HealthKit functionality in app's user interface to avoid confusion.
0
0
1.2k
Jan ’22
Cannot add activeEnergyBurned sample to HKWorkoutSession
Hi, I am writing workout app for WatchOS and want to add activeEnergyBurned sample whenever user has finished exercise in workout. But whenever I add sample to builder it returns that it was successfully added but when checking added samples in Health app, it shows that it is always 0 and also sum of samples is also always 0. Does activeEnergyBurned has some additional requirements because when tried to write basalEnergyBurned it successfully wrote given calories. Writing sample here:     let energyBurnedType = HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)     if energyBurnedType != nil {       let energyBurned = HKQuantity(unit: HKUnit.largeCalorie(), doubleValue: Double(totalCalories))       let energyBurnedSample = HKQuantitySample(type: energyBurnedType!, quantity: energyBurned, start: self.exerciseStart, end: Date())       builder.add([energyBurnedSample]) { (success, error) in         print(success)         print(error)       }     } And reading data that always returns 0: func updateForStatistics(_ statistics: HKStatistics?) {     guard let statistics = statistics else { return }           DispatchQueue.main.async {       switch statistics.quantityType {       case HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned):         let energyUnit = HKUnit.largeCalorie()         let value = statistics.sumQuantity()?.doubleValue(for: energyUnit)         self.activeCalories = Double( round( 1 * value! ) / 1 )         print(value)         return       default:         return       }     }   } Any ideas on what am I missing? I checked my workout recordings and I see that samples get added but doesn't affect total active energy shown in Health app: And here you can see that sample is added:
0
0
575
Jan ’22
SmartCard Apple Wallet integration iOS 15.1
Our app supports SmartCardHealth and Apple Wallet-Health integration. We have seen an issue, when we try to add vaccine records with same Vaccine dose details of different users, the wallet app is taking the first one only the later one got automatically replaced by first showing the message "The Vaccination records already added" in Health app. Please help in resolving this issue, whether if have missed out any parameter in minified JSON response. Below are the response for our test records {"resource":{"vaccineCode":{"coding":[{"system":http://hl7.org/fhir/sid/cvx,"code":"208"}]},"status":"completed","resourceType":"Immunization","performer":[{"actor":{"display":"TESTING PREPMOD"}}],"patient":{"reference":"resource:0"},"occurrenceDateTime":"2022-01-23","lotNumber":"TESTAUTOMATIONLOTNUMBER_D"},"fullUrl":"resource:1"}]}}},"nbf":1643984735,"iss":https://health.ri.gov/sh.cards/test}   {"resource":{"vaccineCode":{"coding":[{"system":http://hl7.org/fhir/sid/cvx,"code":"208"}]},"status":"completed","resourceType":"Immunization","performer":[{"actor":{"display":"TESTING PREPMOD"}}],"patient":{"reference":"resource:0"},"occurrenceDateTime":"2022-01-23","lotNumber":"TESTAUTOMATIONLOTNUMBER_D"},"fullUrl":"resource:1"}]}}},"nbf":1643984914,"iss":https://health.ri.gov/sh.cards/test}
0
0
451
Feb ’22
Deploy app with HealthKit
Hello, I have problem with submision from App Store I use to activity ring in Watch extension in my App. I use activity rings to plot the values that the application has, but my application is not primarily intended for fitness. I enter my values that are obtained from the application in Iphone into the rings activity. how can I use activity rings to allow the app store to upload the app? can I use activitity rings without health kit? Issue with submission Guideline 2.5.1 - Performance - Software Requirements We noticed that your app uses HealthKit, but your app does not appear to include any primary features that require health or fitness data.  The intended use of HealthKit is generally to share health or fitness data with other apps or devices as a part of the app's core functionality.  Next Steps To resolve this issue, please remove any HealthKit functionality from your app, as well as any references to this app’s interactivity with HealthKit from the app or its metadata. This includes removing any HealthKit-related keys in your app's Info.plist as well as removing any calls to HealthKit APIs, including those from 3rd party platforms, from your app.
0
0
818
Feb ’22
HealthKit requestAuthorization dialog not appearing
I am making an app that collects information from Apple Health (HealthKit). When the application is installed for the first time, the apple screen appears with the permissions that will be used, but when it is in Testflight that screen never appears, is there any extra configuration that has to be done when it is released to production? if the app is installed from xcode, it works correctly
3
0
644
Feb ’22
How to display Step Count in a Watch App?
I am trying to display the steps of a user to a metrics view screen in an apple watch. Here is how I try to get the steps: KQuantityType.quantityType(forIdentifier: .stepCount):         let stepCount = HKUnit.meter()         self.stepCount = statistics.sumQuantity()?.doubleValue(for: stepCount) ?? 0         print("step count: \(self.stepCount ?? 0)") Where stepCount is a published variable. I then try to display the steps: Text("\(workoutManager.stepCount!) steps") I am not able to see the steps in a log when I try to print or through Text....any ideas on how to do this?
0
0
700
Mar ’22
How do I measure/get a heartbeat at thousands of seconds from Apple Watch?
Can Apple Watch provide complete data on the heartbeat for thousands of seconds during the workout or when using the "Breathe" app? When I exported data from Apple Health it shows the following data. The rows 195, 196 & 197 are measurements taken through the "Breathe" app. Thank you for your answers,
4
0
1.7k
Mar ’22
HealthKit authorization sheet in Landscape iOS15.4
So in iOS15.4 the HealthKit authorization sheet which gives you permissions to select HealthKit options comes up in Portrait Only, and my App is in Landscape. Wondering if there is a way to tell the authorization sheet to display in Landscape? Additionally in iOS15.4 this authorization sheet displays a high NavBar in Portrait by default instead of the compact NavBar, thus after the user accepts the HealthKit permissions and the authorization sheet is dismissed, the App switches back to Landscape, but is now stuck with the high NavBar instead of the compact NavBar, and there appears to be no way to switch it back to the compact NavBar after this. Calling the NavBar itself and programmatically setting compact doesn't work. So the only way to get the compact NavBar back is to restart the App. So my second question is there a way to get the HealthKit authorization sheet to come up with a compact NavBar instead of the high NavBar?
0
0
539
Mar ’22
Health Kit: How to set 'totalEnergyBurned' for workout?
Hello! Today I worked for the first time with Apple Health Kit and successfully saved a workout in Health with the basic informations (activityType, start and end). My app is in basic function an interval timer where you can create your own workout. Now in the next step I want to add the calories burned in the workout. This information is stored in the attribute 'totalEnergyBurned'. Do I need to calculate this value myself or can I query this value directly if the user is wearing an Apple Watch? Or maybe the value is even automatically added to the workout if there is the corresponding record? (So far I have only tested the app in the simulator, which is why I can't answer this possibility). My current code: func saveToHealthKit(entryID: String){             if HKHealthStore.isHealthDataAvailable() {                 let healthStore = HKHealthStore()                 if(healthStore.authorizationStatus(for: HKObjectType.workoutType()) == .sharingAuthorized && healthStore.authorizationStatus(for: HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.activeEnergyBurned)!) == .sharingAuthorized){                     let newWorkout = HKWorkout(activityType: HKWorkoutActivityType.highIntensityIntervalTraining, start: entry.date!, end: Date())                     healthStore.save(newWorkout) { success, error in                         guard success else {                             // Perform proper error handling here.                             return                         }                                                  // Add detail samples here.                     }                 }             }         }     } Thanks :)
0
0
760
Mar ’22
Your app uses the HealthKit or CareKit APIs but does not indicate integration with the Health app in your app description and clearly identify the HealthKit and CareKit functionality in your app's user interface.
Please help me to find out the below error related to health kit. Sometimes before we have start health kit implementation in our application, so we have enable the health kit setting form identifier(bundle ID) but now we don't need health kit so we remove all the configuration and code related to health kit from our application. We have summited our app on apple store with some other changes but app rejected from the below error. Guideline 2.5.1 - Performance - Software Requirements Your app uses the HealthKit or CareKit APIs but does not indicate integration with the Health app in your app description and clearly identify the HealthKit and CareKit functionality in your app's user interface. Next Steps To resolve this issue, please revise your app description to specify that your app integrates with the Health app, and clearly identify the HealthKit functionality in app's user interface to avoid confusion.
Replies
0
Boosts
0
Views
1.2k
Activity
Jan ’22
Cannot add activeEnergyBurned sample to HKWorkoutSession
Hi, I am writing workout app for WatchOS and want to add activeEnergyBurned sample whenever user has finished exercise in workout. But whenever I add sample to builder it returns that it was successfully added but when checking added samples in Health app, it shows that it is always 0 and also sum of samples is also always 0. Does activeEnergyBurned has some additional requirements because when tried to write basalEnergyBurned it successfully wrote given calories. Writing sample here:     let energyBurnedType = HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)     if energyBurnedType != nil {       let energyBurned = HKQuantity(unit: HKUnit.largeCalorie(), doubleValue: Double(totalCalories))       let energyBurnedSample = HKQuantitySample(type: energyBurnedType!, quantity: energyBurned, start: self.exerciseStart, end: Date())       builder.add([energyBurnedSample]) { (success, error) in         print(success)         print(error)       }     } And reading data that always returns 0: func updateForStatistics(_ statistics: HKStatistics?) {     guard let statistics = statistics else { return }           DispatchQueue.main.async {       switch statistics.quantityType {       case HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned):         let energyUnit = HKUnit.largeCalorie()         let value = statistics.sumQuantity()?.doubleValue(for: energyUnit)         self.activeCalories = Double( round( 1 * value! ) / 1 )         print(value)         return       default:         return       }     }   } Any ideas on what am I missing? I checked my workout recordings and I see that samples get added but doesn't affect total active energy shown in Health app: And here you can see that sample is added:
Replies
0
Boosts
0
Views
575
Activity
Jan ’22
Apple Health Data source
How do I remove a step data source in the Health app? Some of the devices are out of use now and I'd like to remove them from my Health data, but now it seems I can only drag them to the bottom in the priority list but am not able to remove them completely.
Replies
0
Boosts
0
Views
457
Activity
Jan ’22
Predicted period / menstrual data from HealthKit
HealthKit calculates when a user's period is likely to start next. Is there a way to get access to this data in order to display it in an app? I know one can access past data, but it is specifically future predictions that would be the most useful.
Replies
0
Boosts
0
Views
607
Activity
Jan ’22
SmartCard Apple Wallet integration iOS 15.1
Our app supports SmartCardHealth and Apple Wallet-Health integration. We have seen an issue, when we try to add vaccine records with same Vaccine dose details of different users, the wallet app is taking the first one only the later one got automatically replaced by first showing the message "The Vaccination records already added" in Health app. Please help in resolving this issue, whether if have missed out any parameter in minified JSON response. Below are the response for our test records {"resource":{"vaccineCode":{"coding":[{"system":http://hl7.org/fhir/sid/cvx,"code":"208"}]},"status":"completed","resourceType":"Immunization","performer":[{"actor":{"display":"TESTING PREPMOD"}}],"patient":{"reference":"resource:0"},"occurrenceDateTime":"2022-01-23","lotNumber":"TESTAUTOMATIONLOTNUMBER_D"},"fullUrl":"resource:1"}]}}},"nbf":1643984735,"iss":https://health.ri.gov/sh.cards/test}   {"resource":{"vaccineCode":{"coding":[{"system":http://hl7.org/fhir/sid/cvx,"code":"208"}]},"status":"completed","resourceType":"Immunization","performer":[{"actor":{"display":"TESTING PREPMOD"}}],"patient":{"reference":"resource:0"},"occurrenceDateTime":"2022-01-23","lotNumber":"TESTAUTOMATIONLOTNUMBER_D"},"fullUrl":"resource:1"}]}}},"nbf":1643984914,"iss":https://health.ri.gov/sh.cards/test}
Replies
0
Boosts
0
Views
451
Activity
Feb ’22
Sleep Analysis - Health Kit Six Month Graph Data Logic
I I'm implementing six month sleep analysis data for graph. I have 2 entries as shown in below screenshot. I'm not able to understand logic used to display this data in Six month mode graph in HealthKit. How sleep start time 10:22 PM and sleep end time 7:24 AM is calculated? Graph in Six Month Mode.
Replies
1
Boosts
0
Views
808
Activity
Feb ’22
Deploy app with HealthKit
Hello, I have problem with submision from App Store I use to activity ring in Watch extension in my App. I use activity rings to plot the values that the application has, but my application is not primarily intended for fitness. I enter my values that are obtained from the application in Iphone into the rings activity. how can I use activity rings to allow the app store to upload the app? can I use activitity rings without health kit? Issue with submission Guideline 2.5.1 - Performance - Software Requirements We noticed that your app uses HealthKit, but your app does not appear to include any primary features that require health or fitness data.  The intended use of HealthKit is generally to share health or fitness data with other apps or devices as a part of the app's core functionality.  Next Steps To resolve this issue, please remove any HealthKit functionality from your app, as well as any references to this app’s interactivity with HealthKit from the app or its metadata. This includes removing any HealthKit-related keys in your app's Info.plist as well as removing any calls to HealthKit APIs, including those from 3rd party platforms, from your app.
Replies
0
Boosts
0
Views
818
Activity
Feb ’22
Heath App
hi is or does anyone want to team up with a group of nurses and doctors to build apps
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’22
HealthKit requestAuthorization dialog not appearing
I am making an app that collects information from Apple Health (HealthKit). When the application is installed for the first time, the apple screen appears with the permissions that will be used, but when it is in Testflight that screen never appears, is there any extra configuration that has to be done when it is released to production? if the app is installed from xcode, it works correctly
Replies
3
Boosts
0
Views
644
Activity
Feb ’22
How to detect an apple watch is taken off using healthkit
I want to detect when the user has removed the watch from wrist in the middle of a work out. in iOS devices using the HealthKit framework. Been checking the docs, no luck so far. HealthKit
Replies
0
Boosts
0
Views
677
Activity
Feb ’22
How to display Step Count in a Watch App?
I am trying to display the steps of a user to a metrics view screen in an apple watch. Here is how I try to get the steps: KQuantityType.quantityType(forIdentifier: .stepCount):         let stepCount = HKUnit.meter()         self.stepCount = statistics.sumQuantity()?.doubleValue(for: stepCount) ?? 0         print("step count: \(self.stepCount ?? 0)") Where stepCount is a published variable. I then try to display the steps: Text("\(workoutManager.stepCount!) steps") I am not able to see the steps in a log when I try to print or through Text....any ideas on how to do this?
Replies
0
Boosts
0
Views
700
Activity
Mar ’22
How do I measure/get a heartbeat at thousands of seconds from Apple Watch?
Can Apple Watch provide complete data on the heartbeat for thousands of seconds during the workout or when using the "Breathe" app? When I exported data from Apple Health it shows the following data. The rows 195, 196 & 197 are measurements taken through the "Breathe" app. Thank you for your answers,
Replies
4
Boosts
0
Views
1.7k
Activity
Mar ’22
Healthkit data sync button
can you please guide can we add pause or sync button in our app for apple healthkit data synchronization, basically we are using long running queries for syncing new apple health data to our app and we want to give user option to pause syncing data any time.
Replies
0
Boosts
0
Views
857
Activity
Mar ’22
How to delete built in version
wwdc20-10640  Discuss WWDC20 Session 10640 - Design for the iPadOS pointer
Replies
0
Boosts
0
Views
713
Activity
Mar ’22
HealthKit authorization sheet in Landscape iOS15.4
So in iOS15.4 the HealthKit authorization sheet which gives you permissions to select HealthKit options comes up in Portrait Only, and my App is in Landscape. Wondering if there is a way to tell the authorization sheet to display in Landscape? Additionally in iOS15.4 this authorization sheet displays a high NavBar in Portrait by default instead of the compact NavBar, thus after the user accepts the HealthKit permissions and the authorization sheet is dismissed, the App switches back to Landscape, but is now stuck with the high NavBar instead of the compact NavBar, and there appears to be no way to switch it back to the compact NavBar after this. Calling the NavBar itself and programmatically setting compact doesn't work. So the only way to get the compact NavBar back is to restart the App. So my second question is there a way to get the HealthKit authorization sheet to come up with a compact NavBar instead of the high NavBar?
Replies
0
Boosts
0
Views
539
Activity
Mar ’22
Health Kit: How to set 'totalEnergyBurned' for workout?
Hello! Today I worked for the first time with Apple Health Kit and successfully saved a workout in Health with the basic informations (activityType, start and end). My app is in basic function an interval timer where you can create your own workout. Now in the next step I want to add the calories burned in the workout. This information is stored in the attribute 'totalEnergyBurned'. Do I need to calculate this value myself or can I query this value directly if the user is wearing an Apple Watch? Or maybe the value is even automatically added to the workout if there is the corresponding record? (So far I have only tested the app in the simulator, which is why I can't answer this possibility). My current code: func saveToHealthKit(entryID: String){             if HKHealthStore.isHealthDataAvailable() {                 let healthStore = HKHealthStore()                 if(healthStore.authorizationStatus(for: HKObjectType.workoutType()) == .sharingAuthorized && healthStore.authorizationStatus(for: HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.activeEnergyBurned)!) == .sharingAuthorized){                     let newWorkout = HKWorkout(activityType: HKWorkoutActivityType.highIntensityIntervalTraining, start: entry.date!, end: Date())                     healthStore.save(newWorkout) { success, error in                         guard success else {                             // Perform proper error handling here.                             return                         }                                                  // Add detail samples here.                     }                 }             }         }     } Thanks :)
Replies
0
Boosts
0
Views
760
Activity
Mar ’22
query appleStandHour over last week
I've successfully queried lots of HealthKit data, but I'm having trouble querying "appleStandHour" over some time range such as the last week. I'm sure the issue is that this data is a "category" instead of a "statistic". Can someone show me or give me a link that shows how to do this query?
Replies
0
Boosts
0
Views
641
Activity
Mar ’22
Is there a way to enable Auto-Bedtime Turning off
Hi! Ever since I set bedtime mode on my iPhone, it automatically turns on at night, which is great! However, is there a way that I can set my phone to automatically turn bedtime mode off at a specific time in the morning? Right now I have to manually switch it off every single morning. Thank you!
Replies
0
Boosts
0
Views
460
Activity
Mar ’22
HealthKit
I want to do an app for an apple watch using Heart rate and Electrodermal Activity from Healthkit, but i don't find the frecuency of the data, i mean how many times per second the library send me data?
Replies
0
Boosts
0
Views
387
Activity
Apr ’22
Token expired for Fit! App
I use the Fit! App on my iPhone for my workouts and all of a sudden it’s saying the token has expired. What can I do to fix it?
Replies
1
Boosts
0
Views
1.8k
Activity
Nov ’22