health-kit

iOS app reject because of healthkit

限于喜欢 提交于 2019-12-01 03:24:45
问题 I am using HealthKit in my app to read users daily steps data and for that I enable HealthKit in my app. I uploaded app without NSHealthShareUsageDescription and NSHealthUpdateUsageDescription key in info.plist . Apple rejected the app as follow and says this both key must be in info.plist . NSHealthUpdateUsageDescription - Read your daily steps data for calorie count data NSHealthShareUsageDescription - Share workout data with apps. I added that key and upload again. now app rejected with

HealthKit data inaccessible in background

。_饼干妹妹 提交于 2019-12-01 01:07:03
问题 I want to pull HealthStore data in the background using background fetch but I keep getting an error: Error Domain=com.apple.healthkit Code=6 "Protected health data is inaccessible" UserInfo=0x17026fdc0 {NSLocalizedDescription=Protected health data is inaccessible} . Apple states: Because the HealthKit store is encrypted, your app cannot read data from the store when the phone is locked. This means your app may not be able to access the store when it is launched in the background. Any

iOS universal app with healthkit won't run on iPad

对着背影说爱祢 提交于 2019-11-30 11:52:26
问题 I have an universal app and I´ve implemented it to use the healthkit API. It runs great on iPhone but when I try to install it on an actual iPad device (works perfectly in iPad simulator) it wont install. I am getting the error message: "The Info.plist for application at ... specifies device capability requirements, which are not met by "my ipad"". I there any way I can distribute an universal app where the healthkit API (framework) only runs on the iPhone? Heres two screenshots of my project

HealthStore enableBackgroundDelivery when screen is locked

不想你离开。 提交于 2019-11-30 05:44:37
Hello I'm trying to setup the health store observer with background delivery enabled. My problem is that it won't deliver anything when the screen is locked. I have simplified my code for this question to get to the point :) I have HealthKit in my plist and I have accepted healthStore type step count. Everything is fine when the app is open and when the screen is not locked. But when the screen is locked I don't get any observations. For test purpose the frequency is set to immediate. My code is as follows - (void)setupHealthStore{ if ([HKHealthStore isHealthDataAvailable]) { NSSet

iOS universal app with healthkit won't run on iPad

人走茶凉 提交于 2019-11-30 01:33:37
I have an universal app and I´ve implemented it to use the healthkit API. It runs great on iPhone but when I try to install it on an actual iPad device (works perfectly in iPad simulator) it wont install. I am getting the error message: "The Info.plist for application at ... specifies device capability requirements, which are not met by "my ipad"". I there any way I can distribute an universal app where the healthkit API (framework) only runs on the iPhone? Heres two screenshots of my project: Do I really need to make a standalone iPad app? user2423351 you can remove healthkit from Required

HealthKit: HKObserverQuery not Firing

荒凉一梦 提交于 2019-11-30 00:33:22
问题 I'm trying to do a pretty basic thing: set up an HKObserverQuery so I can know when various data points are changed (I've made sure that the user has authorized the app to use the data point in question.) For whatever reason, I can get the query to fire every time the app is launched, but it does not fire when I close the app, go into the Health app, and manually update the data point. I've done a fair amount of searching and haven't been able to successfully use the code that others have

HealthKit Swift getting today's steps

心已入冬 提交于 2019-11-29 21:47:25
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 step data since the day began, like the Health app displays in the steps section? I am trying to do

Call external function using WatchKit force touch MenuItem

▼魔方 西西 提交于 2019-11-29 14:18:21
I need to implement a WatchKit force-touch MenuItem to call a saveWorkout() method that is located in a separate class that does not subclass WKInterfaceController . I realize that every class needs at least one designated initializer. I am guessing this is the key? Btw, my " saveSession() reached " print statement logs to the console when using the sim but not when I use a device. All other print statements log to the console even when using the device. A bit odd. My attempts at initialization throw various errors such as: 1.fatal error: use of unimplemented initializer 'init()' for class

Ignore manual entries from Apple Health app as Data Source

做~自己de王妃 提交于 2019-11-29 13:33:01
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. Samples in HealthKit that were manually entered by the user will have have a YES value for the HKMetadataKeyWasUserEntered metadata key. To create a predicate that matches only samples that were not user-entered, you could do use the

HKWorkoutSession: Not getting Heart Rate when screen is turned off in watchOS 2

随声附和 提交于 2019-11-29 04:46:35
I am using iOS 9 beta 4 and watchOS 2 beta 4. I can't seem to get any heart rate data when the watch screen turns black (locks). I will get a call to applicationWillResignActive and then the heart rate data just stops. It seems that the sensor is deactivating after some time as well (not green anymore), when the screen locks. Anyone else seeing this behavior? I can post my code for initing the WorkoutSession if anyone else getting heart rate data when the screen on the watch is locked. Starting in watchOS 3.0 you can add the WKBackgroundModes entry with the workout-processing value to the