Comments (6)
https://github.com/carekit-apple/CareKit/blob/master/CareKit/CareCard/OCKCareCardViewController.h#L57
You can use that method in the delegate to manually control the event completion.
from carekit.
Umer,
I'm returning NO for that delegate method already and implemented my own custom logic upon completion of the task presented. This works as expected.
The issue I found is when the activity has been completed already (circle filled). The moment you tap the completed circle, the fill is cleared right before the activity task gets presented. Because they've completed the task before, they don't need to complete it anymore. The problem is for the circle to be back to filled status, they'll have to complete the whole task again.
Since I've implemented shouldHandleEventCompletionForActivity to return NO I expected to have complete control of the activity completion states but that clearly is still not the case.
from carekit.
Also noticed the corresponding OCKCarePlanEvent's state for the circle stays .Completed (if it was completed before) while the circle on the CareCard is not filled in this subsequent tap scenario.
from carekit.
To workaround this issue, I added a conditional check in my ORKTaskViewController's didFinishWithReason delegate, that regardless of the reason (.Completed or .Discarded), if the OCKCarePlanEvent's state was already .Completed then I just update the store again with the .Completed state and this keeps the completed circles filled. A little redundant but it works for now.
Thinking ahead though, this might skew the data for the Insights.
from carekit.
@ninoguba Your approach is correct. You should override the delegate that disables automatic updating of events, and then use your logic to update the state of the event.
from carekit.
The problem is the subsequent updates to the state of the event that gets stored in the CarePlanStore. The user really only completed the activity once but on the store it may appear to be completed several times. Depending on the use case, this approach may or may not work.
from carekit.
Related Issues (20)
- Extra event for OCKTask with all day duration
- Auto Scheduling Events HOT 3
- Warning when uploading App HOT 7
- Occurrence circles HOT 29
- Error when building on latest Xcode and macOS Ventura HOT 1
- Carekit_CareKitStore emitted errors HOT 1
- Compile Errors HOT 1
- How do you save an CareKit OCKOutcomeValue for an array of ResearchKit ORKChoiceQuestionResults HOT 12
- ORKTextChoice + ORKPredicateStepNavigationRule + CareKit + ResearchKit HOT 10
- Bar chart changes every time i close and reopen the application HOT 9
- Problems integrating HealthKit data into an OCKCartesianChartViewController HOT 1
- CareKitStore-CoreData-NSReadOnlyPersistentStoreOption-ErrorMessage HOT 1
- Create monthly charts HOT 3
- Trying to schedule a notification based on the caloriesBurned only if they are less than a certain amount (with query to the health store) HOT 6
- Creating PDF with charts and data from more than one View HOT 1
- Sample app for v3? HOT 1
- CareKit live streaming crashes with multithreaded violations HOT 4
- Updated Content HOT 16
- Watch remote synchronization fails with duplicate Outcome.
- CareKit cannot compile with Xcode 15(beta 2) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carekit.