-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to find outcome of HealthKitTask #640
Comments
That behavior is correct. The outcomes you add into HealthKit are stored within your device’s HealthKit store, not inside of your app. CareKit reads those values from HealthKit and shows them along side the data it owns, but it doesn’t synchronize them. This is a shortcoming that we’d like to address someday. @cbaker6 might be able to compensate for it within his plugin somehow, but ideally CareKit would do the book keeping. |
@erik-apple, thank you for the reply. If you don't mind, I would like to double check my interpretation to make sure I get this correct. I understand that the step count outcomes I added are stored within the device's HealthKit store and the app is simply reading from it. In fact, based on #569, I only ask for read permission of step count from the HealthKit with no intention to write back to it. I set up breakpoints in all methods of the OCKHealthKitStore+Outcomes file and observe the breakpoint is only triggered in the
In the debugger, I noticed that
As a result, even if I want to save something (which I don't), there is nothing to save at this line.
It seems to me the outcome of the HealthKitTask is properly displayed to the UI when needed, but not saved to the OCKStore. Is this interpretation correct? For my case, if I want to know the outcome of the OCKHealthKitTask and sync it to a remote server, it seems that I need to execute a query past the end of the underlying schedule (e.g., execute the query after 16:05). Is this the correct way to handle this? Lastly, I notice that both
|
I am working on a CareKit app where I use ParseCareKit developed by @cbaker6 for remote synchronization and his parse-hipaa for the server. Within the app, I defined three tasks: an onboarding task similar to the demo shown in WWDC, a daily stretch task, and a walking task. The onboarding and stretch tasks are created using
OCKTask
and the walking task is created as anOCKHealthKitTask
. Here are the code snippets related to the creation and display of the HealthKit task.Above is a screenshot of the app in the simulator. In the simulator, I manually add step data to the Health app and can observe the cumulative values being updated at the same time.
Back to the server side. On the Parse dashboard, I am able to observe (1) all three tasks are successfully added to the data store and sync'ed to the server. (2) The outcomes of the
OCKTask
s are also saved to the data store after completion and sync'ed to the server.However, I am unable to observe any outcome related to the
HealthKitTask
ever sync'ed to the remote, even past the schedule time (16:05 in the screenshot). Assuming ParseCareKit correctly synchronizes data from the device to the server, I am not sure if the outcome of this HealthKitTask is saved anywhere to the data store on the device. Am I missing something here?The text was updated successfully, but these errors were encountered: