health-kit

Access workout data even when apple watch screen turn off

霸气de小男生 提交于 2019-11-29 00:42:56
I success to get heart rate data in live without workout session on apple watch os 2. But when apple watch screen turn off, my completion block is not anymore called. I would like to continue to manage these data in live and to make my phone ring when heart rate is too low. Maybe i can let the app on the iphone perma open and maybe it can access to the healthkit data during this workout ? Do you think this can work ? or do you have another idea ? Regards Arsene Huot Hey i found a solution : i keep iphone app in foreground with : [UIApplication sharedApplication].idleTimerDisabled = YES And

HealthKit (iOS) won't deliver data in background (objC)

只谈情不闲聊 提交于 2019-11-28 23:38:57
问题 We're currently trying to get HealthKit to work in the background, in order to deliver steps data to our server when the App is closed. For experimental purposes we've created a brand new iOS project in XCode, enabled HealhtKit and all background modes in Compabilities. After that, we pretty much run the code (see further down). So what happens first is that the app ofcourse asks for the permissions, which we grant. What we're expecting is that the app should keep deliver the steps data every

HealthKit Swift getting today's steps

ぐ巨炮叔叔 提交于 2019-11-28 17:12:30
问题 I am making a swift iOS app that integrates with a user's step count as reported by the Health app. I can easily find the user's step count in the last hour, using this as my predicate: let anHourBeforeNow: NSDate = NSDate().dateByAddingTimeInterval(-60 * 60) let predicate = HKQuery.predicateForSamplesWithStartDate(anHourBeforeNow, endDate: NSDate(), options: .None) And I have the rest down, so I can successfully access the user's step count for the last hour. But how can I access the user's

Ignore manual entries from Apple Health app as Data Source

放肆的年华 提交于 2019-11-28 07:27:25
问题 Hi I'm writing a Fitness App which gets its Data from Apples Health app. So far so good. Problem: in Health app it is possible to make manually data entries which makes it possible to cheat. Question: how can i exclude or ignore this specific Data Entries. Just the Data with "Source: Health" so i've still the possibility to read data from a random Fitness tracker. 回答1: Samples in HealthKit that were manually entered by the user will have have a YES value for the HKMetadataKeyWasUserEntered

HealthKit Authorisation Status is always 1

99封情书 提交于 2019-11-27 23:49:40
I am using HealthKit in my app. I am getting the Permission from the user for accessing the HealthKit Data. After the Authorisation, if I check for authorised status for a particular HealthKit Object type, it always returns that the access is denied. (1 is the enum integer Value). Here is my code // Steps if ([self.healthStore authorizationStatusForType:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]] == HKAuthorizationStatusSharingAuthorized) { [self accessStepsFrom:fromDate to:toDate]; } //Sleep if ([self.healthStore authorizationStatusForType:[HKObjectType

Why am I getting the error plugin_not_installed with the Ionic Framework plugin healthkit?

我是研究僧i 提交于 2019-11-27 09:08:25
I have been using Ionic Framework for a while but I have recently come across this error plugin_not_installed for the Health Kit plugin which I know I have based on my ionic cordova plugin list output. $ ionic cordova plugin list > cordova plugin ls com.telerik.plugins.healthkit 0.5.5 "HealthKit" cordova-plugin-apprate 1.3.0 "AppRate" cordova-plugin-badge 0.8.5 "Badge" cordova-plugin-device 1.1.4 "Device" cordova-plugin-dialogs 1.3.4 "Notification" cordova-plugin-globalization 1.0.8 "Globalization" cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin" cordova-plugin

Get total step count for every date in HealthKit

你。 提交于 2019-11-27 08:08:45
What's the best way to get a total step count for every day recorded in HealthKit . With HKSampleQuery's method initWithSampleType (see below) I can set a start and end date for the query using NSPredicate , but the method returns an array with many HKQuantitySamples per day. - (instancetype)initWithSampleType:(HKSampleType *)sampleType predicate:(NSPredicate *)predicate limit:(NSUInteger)limit sortDescriptors:(NSArray *)sortDescriptors resultsHandler:(void (^)(HKSampleQuery *query, NSArray *results, NSError *error))resultsHandler I guess I can query all recorded step counts and go through the

HealthKit Authorisation Status is always 1

ぐ巨炮叔叔 提交于 2019-11-26 21:19:52
问题 I am using HealthKit in my app. I am getting the Permission from the user for accessing the HealthKit Data. After the Authorisation, if I check for authorised status for a particular HealthKit Object type, it always returns that the access is denied. (1 is the enum integer Value). Here is my code // Steps if ([self.healthStore authorizationStatusForType:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]] == HKAuthorizationStatusSharingAuthorized) { [self

Why am I getting the error plugin_not_installed with the Ionic Framework plugin healthkit?

流过昼夜 提交于 2019-11-26 14:34:37
问题 I have been using Ionic Framework for a while but I have recently come across this error plugin_not_installed for the Health Kit plugin which I know I have based on my ionic cordova plugin list output. $ ionic cordova plugin list > cordova plugin ls com.telerik.plugins.healthkit 0.5.5 "HealthKit" cordova-plugin-apprate 1.3.0 "AppRate" cordova-plugin-badge 0.8.5 "Badge" cordova-plugin-device 1.1.4 "Device" cordova-plugin-dialogs 1.3.4 "Notification" cordova-plugin-globalization 1.0.8

Healthkit background delivery when app is not running

巧了我就是萌 提交于 2019-11-26 14:25:24
Can HealthKit background delivery launch the application if is not running? Particularly in a terminated state? After a full day of testing (iOS 9.2) I can confirm that HealthKit background delivery DOES WORK in all of the following application states: background (in background and executing code), suspended (in background but not executing code), terminated (force-killed by the user or purged by the system). Keep in mind : part 1 Some HealthKit data types have a minimum update frequency of HKUpdateFrequencyHourly . That said, even if you set up a background delivery with frequency