I'm using ionic with healthkit plugin.
I want to obtain the steps for a certain time.
I do a button START, when the user click on it, the counter begin and the steps of the user are counted during 60 seconds.
Problem is that the counts are stored by packets? or anything like this. If I continue to walk after the 60 seconds, the count continue until I stop walking. Then I can access the complete data and not only the data until the counter has finished.
How are the packets stored by ios? Can I stop the counter?
EDIT:
I tried with healthkit plugin and duration:
this.healthKit.querySampleType({
'startDate': new Date(), // three days ago
'duration': 10,
'sampleType': 'HKQuantityTypeIdentifierStepCount',
'unit': 'count'
}).then((success) => {
console.log('success');
console.log(success);
});
But that give me an error:
-[__NSCFString longValue]: unrecognized selector sent to instance 0x170055ff0
*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[__NSCFString longValue]: unrecognized selector sent to instance 0x170055ff0
答案 0 :(得分:0)