简体   繁体   中英

ios, healthkit observer query

I am writing an ios app with health kit integration. I want my application to be notified by health app whenever new heart rate data get saved in health app and that new data fall behind lower limit or exceeds upper limit.

For example lower limit - > 50, upper limit -> 100, so

if(newHeartRateData<50 OR newHeartRateData>100)

then application needs to be notified.

I am using observer query for this but not getting clue how to insert predicate for lower and upper limit.

Any help would be appreciated. Thanks

您可以使用HKQuerypredicateForQuantitySamplesWithOperatorType:quantity:方法返回的谓词,按数量值过滤样本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM