Search code examples
iosxcodeios8ios-app-extension

HealthKit & Today Extensions/Widgets


Has anyone combined these two new features in iOS8 yet? I'm attempting to access HealthKit from a widget. But since the application and extension use two separate App IDs - the widget automatically rejects access to HealthKit. The Notification Center/Today view doesn't display any prompt to allow access. I notice it attempts to because I see an "unbalanced view controller transition" warning in the console, but nothing is displayed.

For a manual fix - the Health app will display the bundle ID with permissions that can be manually changed. However, there's no app icon and the extension is listed as its bundle ID and not listed as its product name. This makes me think this is still something they are working on in the beta.


Solution

  • I haven't tried doing this type of combination between those features in my app yet, but while integrating the HealthKit capabilities, I happened to see the following in HealthKit documentations:

    Both HealthKit and the Health app are unavailable on iPad. The HealthKit framework cannot be used in an app extension

    So I assume a direct way is not available... You can read more here: HealthKit_Framework Documentation