我正在使用離子與healthkit插件。如何獲取每分鐘的步驟數據分鐘數?
我想獲得一定時間的步驟。
我做了一個按鈕START,當用戶點擊它時,計數器開始,用戶的步數在60秒內計數。
問題是計數是通過數據包存儲的嗎?或者類似的東西。如果我在60秒後繼續走路,計數會繼續,直到我停止走路。然後,我可以訪問完整的數據,而不僅僅是數據,直到計數器完成。
如何通過ios存儲數據包?我可以停止櫃檯嗎?
編輯:
我試着用healthkit插件及持續時間:
this.healthKit.querySampleType({
'startDate': new Date(), // three days ago
'duration': 10,
'sampleType': 'HKQuantityTypeIdentifierStepCount',
'unit': 'count'
}).then((success) => {
console.log('success');
console.log(success);
});
但是,這給我一個錯誤:
-[__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
您必須在運行狀況套件查詢中設置該持續時間。它會提供這些數據。 –