Using HealthKit, I save
- Training
- Corresponding active energy samples
- Matching Mileage / Mileage Spaces
I run the same code on an Apple watch and on an iPhone.
When I save to iPhone
- I can choose a workout and samples in the iPhone app.
- I see the workout and samples in the iPhone iPhone app.
- Training and samples are not in the application for working with iPhone (bad)
When I save an apple on a watch
- I can choose a workout and samples in the iPhone app.
- I see the workout and samples in the iPhone iPhone app.
- I see the training and samples in the application for working with the iPhone.
When I save an apple on the watch and delete it in my iPhone App
- I canโt choose the workout and samples in the iPhone app (good)
- I do not see workouts and samples in the application for iPhone iPhone (good)
- before watchOS 2.1 + iOS 9.2.1: I still see the workout and samples in the iPhone app (very bad)
- verified using watchOS 2.2 beta 5 + iOS 9.3 beta 5: training and samples are deleted from the activity application on the iPhone (good)
When I save an apple on a watch and delete it in my Apple Watch app
- tested on watchOS 2.2 beta 5 + iOS 9.3 beta 5: everything is as expected: not visible / selected on the watch and on the iPhone with any application mentioned (good with iOS 9.3)
- before watchOS 2.1 + iOS 9.2.1: training and samples were not deleted on the iPhone. (bad until iOS 9.2.1)
Question
Am I doing something wrong or is HealthKit and the iPhone app working this way?
More specific question:
- How to save workouts and samples on iPhone so that workouts and samples are not only visible in the Health app on one iPhone, but also in the Activity app on one iPhone?
- How do I delete the exercises and samples on the iPhone that I saved using my Watch app, so that the workouts and samples are not only deleted in the Health app on the same iPhone, but also deleted in the Activity app on the same iPhone?
If this is not my mistake, no iOS application can reliably save the workouts shown in the activity application. The iOS app can send data to the watch app, which is the easy part. But I do not know how to process this data on the clock in the background. The user must run the clock application to process the data.
The tests were conducted on hardware, not on the simulator. iOS 9.2.1, watchOS 2.1
I added tests using watchOS 2.2 beta 5 + iOS 9.3 beta 5. I edited the results above. Summary: the deletion is fixed, saving on the iPhone still does not work.
With iOS 9.3 / watchOS 2.2, Apple added HKActivitySummary , HKActivitySummaryQuery and HKActivityRingView . In short, everything said about the activity application on the iPhone also applies to HKActivitySummaryQuery. They exchange features and errors described above.
source share