Open vgupta16 opened 8 years ago
Sounds interesting! Do you have an opportunity to try and add it yourself perhaps?
I currently do not have any experience with objective C, but with some of your assistance I may be able to implement this if it is something you think will only take a couple hours to complete.
Here are the docs for the deleteobjects method: https://developer.apple.com/reference/healthkit/hkhealthstore/1614163-deleteobjects?language=objc
Other info that might be helpful: http://stackoverflow.com/questions/35922734/deleting-a-water-sample-from-healthkit
I implement deleteObjects in my fork: https://github.com/mnill/HealthKit
window.plugins.healthkit.deleteObjects({
'type': type,
'startDate': new Date(new Date().getTime() - 1000*60*60*24*365),
'endDate': new Date(),
},
callback,
callback
);
Sample or quantity type in ’type’ field :-). If you want to delete workOut - type must be ‘workoutType’ Please test it and give me feedback, I no have project to test it in the wild.
@mnill Oh boy, I just pushed a similar change earlier today: #84
The
HKHealthStore
object has a methoddeleteObject:withCompletion
which can delete previously saved objects. Are there plans to integrate this functionality in the plugin?Thanks! Varun