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

NSInvalidArgumentException Reason: Authorization to share the following types is disallowed: HKClinicalTypeIdentifierImmunizationRecord
We are trying to read and write HealthKit clinical record from our app(Xamarin Forms app) and we are only able to read the clinical record from Health app into our app but not able to write any new data for any clinical record on behalf of the user into Health app. Getting exception Authorization error message while request the Writing permission for Health app. Exception Message: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Authorization to share the following types is disallowed: HKClinicalTypeIdentifierImmunizationRecord Please look into that and provide the solution, how we can write any new data for any clinical record into Health app. We are waiting for your response as soon as possible. Note: We have added all configuration related to access and write clinical record in our project and Apple Source Code: NSSet DataTypesToWrite { get { return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[] { HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord) }); } } NSSet DataTypesToRead { get { return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[] { HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord) }); } } public void GetHealthPermission(Action<bool,string> completion) { try { if (HKHealthStore.IsHealthDataAvailable) { HealthStore = new HKHealthStore(); HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) => { if (authorized) { } completion(authorized,Convert.ToString(error)); }); } else { completion(false, "Health data is not available."); } } catch (Exception ex) { completion(false,ex.Message); } } Getting Error on below line HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) =>
1
0
947
Nov ’21
[WatchOS] Error while trying to insertRouteData into HKWorkoutRouteBuilder
I've ran into an error with the insertRouteData function of the HKWorkoutRouteBuilder that I can't seem to find any information on. The error is "Unable to find location series 1A193D3B-AFF5-41D8-A967-B1BE08D9F543 during data insert.". It seems to only happen when trying to insert very long routes, in the most recent case it was a 5 hour bike ride with 5900 samples. I save all the route data in a sqlite table as backup and after checking out the data there isn't any red flags as to why it would not insert correctly. Has anyone seen this before and could offer some insight or point me in the right direction to find the source of the error?
2
0
1.4k
Jan ’26
The Clinical Health Records - App Crash & Sample JSON Date type details
Hello, With reference to HealthKit - Clinical Health Records, we implemented the following method to fetch the User's clinical records but seems the query is failing and the app is getting crashed every time. We tried the same method with Apple provided sample account and it works fine in the simulator, but it crashes with actual users Can you please help us to identify the issue? func getRecordsForCHRType(type: HKClinicalTypeIdentifier, completion:@escaping ([HKClinicalRecord]?) -> Void) { guard let healthRecordType = HKObjectType.clinicalType(forIdentifier: type) else { return } let startDate = Calendar.current.date(byAdding: DateComponents(day: -365), to: Date())! let endDate = Calendar.current.date(byAdding: DateComponents(day: 0), to: Date())! let predicate = HKQuery.predicateForSamples(withStart: startDate, end: endDate, options: [.strictStartDate]) let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: false) let healthRecordQuery = HKSampleQuery(sampleType: healthRecordType, predicate: predicate, limit: 0, sortDescriptors: [sortDescriptor]) { (query, samples, error) in guard let actualSamples = samples else { completion(nil) return } let healthRecordSamples = actualSamples as? [HKClinicalRecord] completion(healthRecordSamples) } HKHealthStore().execute(healthRecordQuery) } Additionally, please help us to understand the following different types of dates(in detail) available in sample Clinical Health Records JSON, and is it possible to apply a filter using any HealthKitQuery on these dates to narrow down the clinical records response? issued dateRecorded recordDate onset effective Any help would be appreciated!
1
0
831
Nov ’21
error: Provisioning profile "XXXXXX" doesn't include the com.apple.developer.healthkit.background-delivery entitlement.
I am having trouble with the following error that occurs during archiving. error: Provisioning profile "XXXXXX" doesn't include the com.apple.developer.healthkit.background-delivery entitlement. I have HealthKit checked in App ID Configuration. On the other hand, there is no item for healthkit.background-delivery here. The description of entitlements is as follows. And, The description of Signing & Capabilities is as follows. Please, can you give me even the most trivial advice? Thank you very much.
1
1
731
Nov ’21
When do the HKWorkoutBuilder.finishWorkout() returns nil ?
I use the following code : do { ...       Logger.health.info(c: .saveWorkout, "Ending collection.")       try await builder.endCollection(at: workout.end)       Logger.health.info(c: .saveWorkout, "Finishing workout.")       let hkFinishedWorkout = try await builder.finishWorkout()       guard let hkworkout = hkFinishedWorkout else {         Logger.health.error(c: .saveWorkout, "Error finishing workout. Returned workout is nil!")         return false       } ... } catch {       Logger.health.error(c: .saveWorkout, "Failed to save workout: \(String(describing: error))")       return false } This code sometimes behave correctly, but it also happen to log "Error finishing workout. Returned workout is nil!" which indicates that the builder.finishWorkout() returned nil without throwing an error. Notes: There is a workout session running in parallel on the AppleWatch. The workout is correctly saved, but all the location information is missing as the route builder needs the workout to be saved. My question is when do finishWorkout()returns nil without throwing an error ?
1
0
1.5k
Dec ’21
How to save a workout with a route on a locked iPhone ?
This question is a follow-up of https://developer.apple.com/forums/thread/695853 I need to save a workout with a route from a locked iPhone. I've tried many different ways of saving it since more than one year but I still struggle to find a code which works when the phone is locked. My current code is :       let healthStore = HKHealthStore()       let workoutConfiguration = HKWorkoutConfiguration() workoutConfiguration.activityType = .running       let builder = HKWorkoutBuilder(healthStore: healthStore,                                       configuration: workoutConfiguration,                                       device: .local())       try await builder.beginCollection(at: workout.start)       guard let quantityType = HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned) else { ... }       let totalEnergyBurnedSample = HKCumulativeQuantitySample(type: quantityType, quantity: HKQuantity(unit: HKUnit.kilocalorie(), doubleValue: totalEnergyBurned), start: workout.start, end: workout.end)       try await builder.addSamples([totalEnergyBurnedSample])       if let route = builder.seriesBuilder(for: .workoutRoute()) as? HKWorkoutRouteBuilder {         try await route.insertRouteData(locations)       } else {         Logger.health.error("Error creating the route builder! Skipping location addition to HealthKit workout.")       }       try await builder.endCollection(at: workout.end)       let hkFinishedWorkout = try await builder.finishWorkout()       Logger.health.info("Workout saved successfully.")     } catch {       Logger.health.error("Failed to save workout: \(String(describing: error))")     } I naively though that by getting the HKWorkoutRouteBuilder from the HKWorkoutBuilder, the finishWorkout() method would link both of them, but this code never reports an error and the route is associated with the workout only when the iPhone is unlocked when saving. If this code is executed on a locked iPhone, the workout is created, the route is created (both can be seen in the Health application) but the route is not associated with the workout. I can't call finishRoute(with: hkworkout, metadata: nil) on the HKWorkoutRouteBuilder as it requires the HKWorkout which the HKWorkoutBuilder does not return when the phone is locked ;-( Is there a way to create a workout with an associated route on a locked iPhone ?
3
1
1.7k
Oct ’22
What is the standard time frame heartRateVariabilitySDNN is calculated and can we modify it?
So the documentation here only says: A quantity sample type that measures the standard deviation of heartbeat intervals. And below: Discussion These samples use time units (described in HKUnit) and measure discrete values (described in HKStatisticsQuery). HealthKit calculates the Heart rate variability (HRV) by measuring the variation between individual heartbeats. While there are multiple ways of computing HRV, HealthKit uses SDNN heart rate variability, which uses the standard deviation of the inter-beat (RR) intervals between normal heartbeats (typically measured in milliseconds). There is no details on how many heartbeat intervals are used to calculate the SDNN and how to modify it. What if I want to calculate the SDNN on the last 30 intervals? Or the last 10? or the last 100? Or maybe I just want to calculate it on a timeframe, like 60 seconds, regardless of there were 50 or 120 heartbeats.
1
0
892
Feb ’22
When using healthkit.background-delivery of entitlements in my app, Healthcare app show nothing of my app at dataAccess&devices page
Hello! I coded observing ECG of healthKit app. I attached healthkit.background-delivery of entitlements on my app. It works! Background observe is great! but when I open healthcare app like below. healhcare -> DataAccess&devices -> myApp there is nothing. none..... I think I could check types of healthKit that myApp is using Can I resolve this problem?
0
0
378
Dec ’21
Swifui, IOS15, Xcode 13 Sharing core data with Watch
I am trying to share the standard “Item” database supplied when you check the Core Data box when building an app. I have gotten to the point where I am using a shared Persistence file and data model between the IOS device and the Watch. I can add data from both sides but it appears that the data is not “syncing”. I am using a shared app group id in the Persistence file. why isn’t it syncing? any ideas would be appreciated.
1
0
563
Dec ’21
May app was rejected because of lack of citations: Guideline 1.4.1 - Safety - Physical Harm
May app is a health and wellness app giving tips on how to eat move and sleep better, fo weight loss and good health. Apple say that for the app to be accepted that it needs to include citations. However this is a little vague. For example a health app may include 100 different tips about working out; why strength training is better in some cases than cardio, why cardio can be good for mental health, how to sleep better, blue light blocking glasses, calorie deficit to lose weight etc. etc. etc. If you need say two citations for each bit of advice, that would be 200 citations. Looking at the other health apps out there, they don't include thorough citation or referencing. Does anybody know what level of citation apple is looking for? Or how I could see an example. I've looked at other apps, but none of them seem to include any 'easy to find' citations. Thanks in advance!
1
0
1.2k
Dec ’21
I need HR and Movement data to do some testing before the actual app. How can I access them, given 27.4 of Guidelines?
Point 27.4 of the App Store Review Guidelines reads: "Apps may not use or disclose to third parties user data gathered from the HealthKit or CareKit APIs or from health-related human subject research for advertising or other use-based data mining purposes other than improving health, or for the purpose of health research" Now, when the app will be ready for release I only intend to read the data and process it directly on the phone. However, for the purpose of testing I need to extract the data, get it on some excel / csv file and analize it. I initially thought to send the data to Firebase, but was told this might breach 27.4. I only intend to have this feature in the beta I'll release on Test Flight for myself, but still Apple might refuse it. What alternatives do I have? Can I save the data locally on my watch? Might be quite heavy (monitoring up to 8 hours) How do I get it to a computer then? Can I send the data to iCloud? I won't be developing the app first hand, I'm hiring someone so I need to understand what is feasable. Thank you for your help.
0
0
626
Dec ’21
Is it possible that the step count data got from HealthKit is inaccurate in some cases?
I'm developing an app that uses HKStatisticsCollectionQuery to get daily step count data from HealthKit. I am using initialResultsHandler. The following cases have occurred. When the app got the steps on November 30th, the number of steps on November 29th was 7699 steps. Then, when the app got the steps again on December 1st, the number of steps on November 29th was 16011 steps. Is it possible that an inaccurate number of steps is returned temporarily, and then the correct number of steps is returned when reacquired? Is there a way to ensure that I get accurate step count data from the beginning?
1
0
477
Dec ’21
Can I access HealthKit data for devices without an Apple ID?
I'm working on an app to be deployed on shared devices in a hospital. The devices are managed by the Apple School Manager MDM solution and don't have an Apple ID associated with them. My product aims to reduce the amount of overhead / trips down the hall for nurses. I want to measure steps taken before / after deploying our solution. Will I be able to access HealthKit data without the devices having an associated Apple ID? I'd build a sample app to test this out, but I don't currently have access to the devices.
1
0
872
Jan ’22
Health kit - Get shared health data along with my health data
I can able to get my health data list from health kit. I used below code to get my today's step count : `func getTodaysSteps(completion: @escaping (Double) -> Void) { let stepsQuantityType = HKQuantityType.quantityType(forIdentifier: .stepCount)! let now = Date() let startOfDay = Calendar.current.startOfDay(for: now) let predicate = HKQuery.predicateForSamples( withStart: startOfDay, end: now, options: .strictStartDate ) let query = HKStatisticsQuery( quantityType: stepsQuantityType, quantitySamplePredicate: predicate, options: .cumulativeSum ) { _, result, _ in guard let result = result, let sum = result.sumQuantity() else { completion(0.0) return } completion(sum.doubleValue(for: HKUnit.count())) } healthStore.execute(query) }` But i have one more health data of my brother, where he invited me to see his health data in my real device. Now i was not able to read / get his health data. Is there any way to get that. Any solution would be great ...!
4
0
1k
Apr ’22
Why switch to Arabic. The chart in the health app is not adapted for RTL
Why switch to Arabic. The chart in the health app is not adapted for RTL?
Replies
0
Boosts
0
Views
605
Activity
Nov ’21
HKObserverQuery Background Delivery
Will an observer query with background delivery enabled wake an app if the app has been force quit?
Replies
1
Boosts
0
Views
1k
Activity
Nov ’21
Can we start an HKObserverQuery and read data when notified when the phone is locked?
I need to start an HKObserverQuery on heart rate data when the phone is locked, and then read this data when notified still with the phone is locked. The trigger to start the HKObserverQuery would be an apple watch message which will wake-up the iPhone counterpart app on the lock phone. Is it possible?
Replies
1
Boosts
0
Views
829
Activity
Nov ’21
NSInvalidArgumentException Reason: Authorization to share the following types is disallowed: HKClinicalTypeIdentifierImmunizationRecord
We are trying to read and write HealthKit clinical record from our app(Xamarin Forms app) and we are only able to read the clinical record from Health app into our app but not able to write any new data for any clinical record on behalf of the user into Health app. Getting exception Authorization error message while request the Writing permission for Health app. Exception Message: Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Authorization to share the following types is disallowed: HKClinicalTypeIdentifierImmunizationRecord Please look into that and provide the solution, how we can write any new data for any clinical record into Health app. We are waiting for your response as soon as possible. Note: We have added all configuration related to access and write clinical record in our project and Apple Source Code: NSSet DataTypesToWrite { get { return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[] { HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord) }); } } NSSet DataTypesToRead { get { return NSSet.MakeNSObjectSet<HKSampleType>(new HKSampleType[] { HKObjectType.GetClinicalType(HKClinicalTypeIdentifier.ImmunizationRecord) }); } } public void GetHealthPermission(Action<bool,string> completion) { try { if (HKHealthStore.IsHealthDataAvailable) { HealthStore = new HKHealthStore(); HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) => { if (authorized) { } completion(authorized,Convert.ToString(error)); }); } else { completion(false, "Health data is not available."); } } catch (Exception ex) { completion(false,ex.Message); } } Getting Error on below line HealthStore.RequestAuthorizationToShare(DataTypesToWrite, DataTypesToRead, (bool authorized, NSError error) =>
Replies
1
Boosts
0
Views
947
Activity
Nov ’21
apple health wearable devices data
What is the best way to capture apple health wearable device data? My usecase would be need to collect users health data (up on concent) like steps, Heart rate, etc.
Replies
2
Boosts
0
Views
967
Activity
Nov ’21
[WatchOS] Error while trying to insertRouteData into HKWorkoutRouteBuilder
I've ran into an error with the insertRouteData function of the HKWorkoutRouteBuilder that I can't seem to find any information on. The error is "Unable to find location series 1A193D3B-AFF5-41D8-A967-B1BE08D9F543 during data insert.". It seems to only happen when trying to insert very long routes, in the most recent case it was a 5 hour bike ride with 5900 samples. I save all the route data in a sqlite table as backup and after checking out the data there isn't any red flags as to why it would not insert correctly. Has anyone seen this before and could offer some insight or point me in the right direction to find the source of the error?
Replies
2
Boosts
0
Views
1.4k
Activity
Jan ’26
The Clinical Health Records - App Crash & Sample JSON Date type details
Hello, With reference to HealthKit - Clinical Health Records, we implemented the following method to fetch the User's clinical records but seems the query is failing and the app is getting crashed every time. We tried the same method with Apple provided sample account and it works fine in the simulator, but it crashes with actual users Can you please help us to identify the issue? func getRecordsForCHRType(type: HKClinicalTypeIdentifier, completion:@escaping ([HKClinicalRecord]?) -> Void) { guard let healthRecordType = HKObjectType.clinicalType(forIdentifier: type) else { return } let startDate = Calendar.current.date(byAdding: DateComponents(day: -365), to: Date())! let endDate = Calendar.current.date(byAdding: DateComponents(day: 0), to: Date())! let predicate = HKQuery.predicateForSamples(withStart: startDate, end: endDate, options: [.strictStartDate]) let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierStartDate, ascending: false) let healthRecordQuery = HKSampleQuery(sampleType: healthRecordType, predicate: predicate, limit: 0, sortDescriptors: [sortDescriptor]) { (query, samples, error) in guard let actualSamples = samples else { completion(nil) return } let healthRecordSamples = actualSamples as? [HKClinicalRecord] completion(healthRecordSamples) } HKHealthStore().execute(healthRecordQuery) } Additionally, please help us to understand the following different types of dates(in detail) available in sample Clinical Health Records JSON, and is it possible to apply a filter using any HealthKitQuery on these dates to narrow down the clinical records response? issued dateRecorded recordDate onset effective Any help would be appreciated!
Replies
1
Boosts
0
Views
831
Activity
Nov ’21
error: Provisioning profile "XXXXXX" doesn't include the com.apple.developer.healthkit.background-delivery entitlement.
I am having trouble with the following error that occurs during archiving. error: Provisioning profile "XXXXXX" doesn't include the com.apple.developer.healthkit.background-delivery entitlement. I have HealthKit checked in App ID Configuration. On the other hand, there is no item for healthkit.background-delivery here. The description of entitlements is as follows. And, The description of Signing & Capabilities is as follows. Please, can you give me even the most trivial advice? Thank you very much.
Replies
1
Boosts
1
Views
731
Activity
Nov ’21
new health app doesn't have sample data
Hello We have tried to get sample data to the simulator but with no luck. Is it possible to access sample data to the health app? We used this guide but its seems to be outdated https://developer.apple.com/documentation/healthkit/samples/accessing_sample_data_in_the_simulator
Replies
1
Boosts
0
Views
761
Activity
Dec ’21
Do I need any Apple permissions to include Heart rate data
Hi, I am a first time iOS developer, are there any regulations around what I need to develop on Apples HealthKit and use heart rate data in my app other than a privacy certificate and asking user permission? Kind regards, n00b
Replies
0
Boosts
0
Views
379
Activity
Nov ’21
When do the HKWorkoutBuilder.finishWorkout() returns nil ?
I use the following code : do { ...       Logger.health.info(c: .saveWorkout, "Ending collection.")       try await builder.endCollection(at: workout.end)       Logger.health.info(c: .saveWorkout, "Finishing workout.")       let hkFinishedWorkout = try await builder.finishWorkout()       guard let hkworkout = hkFinishedWorkout else {         Logger.health.error(c: .saveWorkout, "Error finishing workout. Returned workout is nil!")         return false       } ... } catch {       Logger.health.error(c: .saveWorkout, "Failed to save workout: \(String(describing: error))")       return false } This code sometimes behave correctly, but it also happen to log "Error finishing workout. Returned workout is nil!" which indicates that the builder.finishWorkout() returned nil without throwing an error. Notes: There is a workout session running in parallel on the AppleWatch. The workout is correctly saved, but all the location information is missing as the route builder needs the workout to be saved. My question is when do finishWorkout()returns nil without throwing an error ?
Replies
1
Boosts
0
Views
1.5k
Activity
Dec ’21
How to save a workout with a route on a locked iPhone ?
This question is a follow-up of https://developer.apple.com/forums/thread/695853 I need to save a workout with a route from a locked iPhone. I've tried many different ways of saving it since more than one year but I still struggle to find a code which works when the phone is locked. My current code is :       let healthStore = HKHealthStore()       let workoutConfiguration = HKWorkoutConfiguration() workoutConfiguration.activityType = .running       let builder = HKWorkoutBuilder(healthStore: healthStore,                                       configuration: workoutConfiguration,                                       device: .local())       try await builder.beginCollection(at: workout.start)       guard let quantityType = HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned) else { ... }       let totalEnergyBurnedSample = HKCumulativeQuantitySample(type: quantityType, quantity: HKQuantity(unit: HKUnit.kilocalorie(), doubleValue: totalEnergyBurned), start: workout.start, end: workout.end)       try await builder.addSamples([totalEnergyBurnedSample])       if let route = builder.seriesBuilder(for: .workoutRoute()) as? HKWorkoutRouteBuilder {         try await route.insertRouteData(locations)       } else {         Logger.health.error("Error creating the route builder! Skipping location addition to HealthKit workout.")       }       try await builder.endCollection(at: workout.end)       let hkFinishedWorkout = try await builder.finishWorkout()       Logger.health.info("Workout saved successfully.")     } catch {       Logger.health.error("Failed to save workout: \(String(describing: error))")     } I naively though that by getting the HKWorkoutRouteBuilder from the HKWorkoutBuilder, the finishWorkout() method would link both of them, but this code never reports an error and the route is associated with the workout only when the iPhone is unlocked when saving. If this code is executed on a locked iPhone, the workout is created, the route is created (both can be seen in the Health application) but the route is not associated with the workout. I can't call finishRoute(with: hkworkout, metadata: nil) on the HKWorkoutRouteBuilder as it requires the HKWorkout which the HKWorkoutBuilder does not return when the phone is locked ;-( Is there a way to create a workout with an associated route on a locked iPhone ?
Replies
3
Boosts
1
Views
1.7k
Activity
Oct ’22
What is the standard time frame heartRateVariabilitySDNN is calculated and can we modify it?
So the documentation here only says: A quantity sample type that measures the standard deviation of heartbeat intervals. And below: Discussion These samples use time units (described in HKUnit) and measure discrete values (described in HKStatisticsQuery). HealthKit calculates the Heart rate variability (HRV) by measuring the variation between individual heartbeats. While there are multiple ways of computing HRV, HealthKit uses SDNN heart rate variability, which uses the standard deviation of the inter-beat (RR) intervals between normal heartbeats (typically measured in milliseconds). There is no details on how many heartbeat intervals are used to calculate the SDNN and how to modify it. What if I want to calculate the SDNN on the last 30 intervals? Or the last 10? or the last 100? Or maybe I just want to calculate it on a timeframe, like 60 seconds, regardless of there were 50 or 120 heartbeats.
Replies
1
Boosts
0
Views
892
Activity
Feb ’22
When using healthkit.background-delivery of entitlements in my app, Healthcare app show nothing of my app at dataAccess&devices page
Hello! I coded observing ECG of healthKit app. I attached healthkit.background-delivery of entitlements on my app. It works! Background observe is great! but when I open healthcare app like below. healhcare -> DataAccess&devices -> myApp there is nothing. none..... I think I could check types of healthKit that myApp is using Can I resolve this problem?
Replies
0
Boosts
0
Views
378
Activity
Dec ’21
Swifui, IOS15, Xcode 13 Sharing core data with Watch
I am trying to share the standard “Item” database supplied when you check the Core Data box when building an app. I have gotten to the point where I am using a shared Persistence file and data model between the IOS device and the Watch. I can add data from both sides but it appears that the data is not “syncing”. I am using a shared app group id in the Persistence file. why isn’t it syncing? any ideas would be appreciated.
Replies
1
Boosts
0
Views
563
Activity
Dec ’21
May app was rejected because of lack of citations: Guideline 1.4.1 - Safety - Physical Harm
May app is a health and wellness app giving tips on how to eat move and sleep better, fo weight loss and good health. Apple say that for the app to be accepted that it needs to include citations. However this is a little vague. For example a health app may include 100 different tips about working out; why strength training is better in some cases than cardio, why cardio can be good for mental health, how to sleep better, blue light blocking glasses, calorie deficit to lose weight etc. etc. etc. If you need say two citations for each bit of advice, that would be 200 citations. Looking at the other health apps out there, they don't include thorough citation or referencing. Does anybody know what level of citation apple is looking for? Or how I could see an example. I've looked at other apps, but none of them seem to include any 'easy to find' citations. Thanks in advance!
Replies
1
Boosts
0
Views
1.2k
Activity
Dec ’21
I need HR and Movement data to do some testing before the actual app. How can I access them, given 27.4 of Guidelines?
Point 27.4 of the App Store Review Guidelines reads: "Apps may not use or disclose to third parties user data gathered from the HealthKit or CareKit APIs or from health-related human subject research for advertising or other use-based data mining purposes other than improving health, or for the purpose of health research" Now, when the app will be ready for release I only intend to read the data and process it directly on the phone. However, for the purpose of testing I need to extract the data, get it on some excel / csv file and analize it. I initially thought to send the data to Firebase, but was told this might breach 27.4. I only intend to have this feature in the beta I'll release on Test Flight for myself, but still Apple might refuse it. What alternatives do I have? Can I save the data locally on my watch? Might be quite heavy (monitoring up to 8 hours) How do I get it to a computer then? Can I send the data to iCloud? I won't be developing the app first hand, I'm hiring someone so I need to understand what is feasable. Thank you for your help.
Replies
0
Boosts
0
Views
626
Activity
Dec ’21
Is it possible that the step count data got from HealthKit is inaccurate in some cases?
I'm developing an app that uses HKStatisticsCollectionQuery to get daily step count data from HealthKit. I am using initialResultsHandler. The following cases have occurred. When the app got the steps on November 30th, the number of steps on November 29th was 7699 steps. Then, when the app got the steps again on December 1st, the number of steps on November 29th was 16011 steps. Is it possible that an inaccurate number of steps is returned temporarily, and then the correct number of steps is returned when reacquired? Is there a way to ensure that I get accurate step count data from the beginning?
Replies
1
Boosts
0
Views
477
Activity
Dec ’21
Can I access HealthKit data for devices without an Apple ID?
I'm working on an app to be deployed on shared devices in a hospital. The devices are managed by the Apple School Manager MDM solution and don't have an Apple ID associated with them. My product aims to reduce the amount of overhead / trips down the hall for nurses. I want to measure steps taken before / after deploying our solution. Will I be able to access HealthKit data without the devices having an associated Apple ID? I'd build a sample app to test this out, but I don't currently have access to the devices.
Replies
1
Boosts
0
Views
872
Activity
Jan ’22
Health kit - Get shared health data along with my health data
I can able to get my health data list from health kit. I used below code to get my today's step count : `func getTodaysSteps(completion: @escaping (Double) -> Void) { let stepsQuantityType = HKQuantityType.quantityType(forIdentifier: .stepCount)! let now = Date() let startOfDay = Calendar.current.startOfDay(for: now) let predicate = HKQuery.predicateForSamples( withStart: startOfDay, end: now, options: .strictStartDate ) let query = HKStatisticsQuery( quantityType: stepsQuantityType, quantitySamplePredicate: predicate, options: .cumulativeSum ) { _, result, _ in guard let result = result, let sum = result.sumQuantity() else { completion(0.0) return } completion(sum.doubleValue(for: HKUnit.count())) } healthStore.execute(query) }` But i have one more health data of my brother, where he invited me to see his health data in my real device. Now i was not able to read / get his health data. Is there any way to get that. Any solution would be great ...!
Replies
4
Boosts
0
Views
1k
Activity
Apr ’22