1

Has anyone else had issues with enableBackgroundDeliveryForType with HealthKit? It works perfectly on my iPhone 4s - I can see NSLog statements running in the background, and I get the UILocalNotification that I set up in the associated observer query - but it is only working sporadically on my iPhone 5s.

On the 5s, I've gotten only a handful of notifications when I try entering data through the Health app (even though performing the same steps on the 4s works just fine). Most of the time, I don't get any notifications when my app is in the background, but when I bring it to the foreground I get all the notifications right away.

I know the code isn't the issue, since it's working fine on one device and it has worked on the 5s as well, just rarely. I've also tried rebooting my phone and uninstalling/reinstalling the app.

bmueller
  • 2,681
  • 1
  • 27
  • 45

1 Answers1

1

In the iOS 8.1 release notes you'll find this under the HealthKit section:

Fixed in iOS 8.1 Beta
Background delivery of HealthKit data does not work as expected.

So I think the solution to your problem is to upgrade/wait for iOS 8.1 to be released. You should be able to get the new betas from the developer center to test.

Jaymon
  • 5,363
  • 3
  • 34
  • 34