简体   繁体   English

HealthKit和Apple Watch-如何检查锻炼是否在进行?

[英]HealthKit and Apple Watch - How to check if workout is running?

I working on an app which uses workout sessions to request heart rate data with a high frequency. 我正在使用一个应用程序,该应用程序使用健身课程来高频地请求心率数据。 Everything works perfectly if I create a new workout session from the app. 如果我从该应用程序创建了新的锻炼会话,那么一切都将正常运行。 Unfortunately, there is a usability issue. 不幸的是,存在可用性问题。 If user activates a workout from another Watch OS app (let's say for jogging or something), then my app has to stop his workout first, before starting a new one. 如果用户从另一个Watch OS应用程序激活了一项锻炼(例如慢跑之类的东西),那么我的应用程序必须先停止他的锻炼,然后再开始新的锻炼。 How do we check if there is another Workout session already going? 我们如何检查是否还有另一个健身会议正在进行? What I want to achieve is basically to utilise a session which is already running. 我要实现的基本上是利用已经在运行的会话。

无法检查锻炼会话是否已在另一个应用程序中运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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