如何使用第三方应用程序在 Apple Watch 的 activity 移动环中添加贡献

How to add a contribution in activity move ring in apple watch using third party app

我们有一个应用程序,其功能类似于通过蓝牙获取实时锻炼数据——包括步幅、距离、燃烧的卡路里、活动时间等等。

我们还集成了健康应用程序,因此我们能够在健康应用程序中轻松 write/read 数据(即活跃能量、步数和步行 + 运行 距离)。

现在我们的问题是 Apple Health 正在记录我们应用程序的步数,但这些步数并没有让它观看 activity 响铃。

有什么方法可以把我们的运动数据反映在apple watchactivity环(动环)上吗?

目前,我们的应用是为 iPhone 开发的,我们是否需要为此创建手表应用?

如果有任何解决方案,请提出。

来自Using Workout Samples | Apple Developer Documentation

Filling the Rings

Workout samples can contribute to the Move and Exercise rings in the Activity app. To contribute, you must associate one or more active energy burned samples with the workout. Additionally:

  • In watchOS. Use a workout session to track the user’s activity. When the session has ended, create a workout object and the associated active energy burned samples. For more information, see HKWorkoutSession. The system updates the Move ring based on the active energy burned samples. It updates the Exercise ring based on the amount of time the user spent actually exerting themselves during the workout session, as calculated by the watch’s sensors.

  • In iOS 10 or later. No additional work is necessary. Workout objects automatically contribute to both the Move and Exercise rings. The Exercise ring is increased by the workout’s total duration, and the Move ring is increased by the number of calories in the associated active energy burned samples. HealthKit also increases the Stand ring by one hour for each wall-clock hour that the workout overlaps.

  • In iOS 9. Workout objects saved on iPhone do not contribute to the activity rings.

Create and save workouts on the device that makes the most sense for your application. This will typically be the device that is running the logic for the user's workout.