如何继续收集苹果手表上的运动传感器数据? [英] How to continue collect motion sensor data on apple watch?

查看:45
本文介绍了如何继续收集苹果手表上的运动传感器数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Apple Watch 上开发一个应用,该应用需要持续访问陀螺仪和加速度计数据.但是一旦手表旋转,屏幕就会关闭,并且显然它会在屏幕关闭时停止访问运动数据.我试图让屏幕保持打开状态,但 Apple Watch 没有该功能,对此有何想法?谢谢

I'm developing an app on apple watch which needs continuous access to gyroscope and accelerometer data. But once the watch rotates, the screen turns off and apparently it stops accessing motion data while the screen is off. I tried to keep the screen on but apple watch doesn't have that feature, any thoughts around this? Thanks

推荐答案

您需要启动一个HKWorkoutSession.

该应用程序可以在后台继续访问来自 Apple Watch 传感器的数据,让您始终保持该应用程序的最新状态.例如,正在运行的应用程序可以持续跟踪用户的心率,确保在用户抬起手腕时显示最新的心率数据.

The app can continue to access data from Apple Watch’s sensors in the background, letting you keep the app up to date at all times. For example, a running app can continue to track the user’s heart rate, ensuring that the most recent heart rate data is displayed whenever the user raises their wrist.

这篇关于如何继续收集苹果手表上的运动传感器数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆