HealthKit:保存在 iPhone 上的锻炼在活动应用程序中不可见 [英] HealthKit: Workout saved on iPhone not visible in Activity App

查看:17
本文介绍了HealthKit:保存在 iPhone 上的锻炼在活动应用程序中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 HealthKit,我节省了

Using HealthKit, I am saving

  1. 锻炼
  2. 对应的有功能量样本
  3. 相应的步行/跑步距离示例

我在 Apple Watch 和 iPhone 上运行相同的代码.

I'm running the same code on the apple watch and on the iPhone.

当我在 iPhone 上保存时

  • 我可以在我的 iPhone 应用程序中选择锻炼和样本
  • 我可以在 iPhone 健康应用中查看锻炼和示例
  • 锻炼和示例不在在 iPhone 活动应用程序中(不好)
  • I can select the workout and samples in my iPhone App
  • I can see the workout and samples in the iPhone Health App
  • The workout and samples are not in the iPhone activity app (bad)

当我在 Apple Watch 上存钱时

  • 我可以在我的 iPhone 应用程序中选择锻炼和样本
  • 我可以在 iPhone 健康应用中查看锻炼和示例
  • 我可以在 iPhone 活动应用中查看锻炼和示例

当我在 Apple Watch 上保存并在我的 iPhone 应用程序中删除它时

  • 我无法在我的 iPhone 应用程序中选择锻炼和样本(好)
  • 我在 iPhone 健康应用程序中看不到锻炼和样本(好)
  • 直到 watchOS 2.1 + iOS 9.2.1:我仍然可以在 iPhone 活动应用程序中看到锻炼和示例(非常糟糕)
  • 使用 watchOS 2.2 beta 5 + iOS 9.3 beta 5 进行测试:从 iPhone 上的活动应用程序中删除了锻炼和样本(好)

当我在 Apple Watch 上保存并在我的 Apple Watch 应用中删除它时

  • 使用 watchOS 2.2 beta 5 + iOS 9.3 beta 5 测试:一切都如预期:在手表和 iPhone 上不可见/不可选,使用任何提到的应用程序(自 iOS 9.3 起良好)
  • 直到 watchOS 2.1 + iOS 9.2.1:iPhone 上没有删除锻炼和样本.(糟糕到 iOS 9.2.1)

问题

我做错了什么,还是 HealthKit 和 iPhone 活动应用程序的工作方式?

Am I doing something wrong or is this the way HealthKit and the iPhone Activity App works?

更具体的问题:

  • 如何在 iPhone 上保存锻炼和样本,让锻炼和样本不仅在同一部 iPhone 的健康"应用中可见,而且在同一部 iPhone 的活动"应用中可见?
  • 如何在 iPhone 上删除我使用 Watch App 保存的锻炼和样本,这样锻炼和样本不仅会在同一部 iPhone 的健康"应用中删除,还会在 iPhone 上的活动"应用中删除同一部 iPhone?

如果这不是我的错误,没有 iOS 应用程序可以可靠地保存活动应用程序中显示的锻炼.iOS 应用程序可以将数据发送到手表应用程序,这是最简单的部分.但我不知道如何在后台处理手表上的这些数据.用户必须启动手表应用来处理数据.

If this is not my mistake, no iOS app could reliably save workouts that are shown in the activity app. The iOS app could send the data to the watch app, that is the easy part. But I know no way to process this data on the watch in background. The user has to start the watch app to process the data.

测试是在硬件上进行的,而不是在模拟器上进行的.iOS 9.2.1,watchOS 2.1

The tests were made on hardware, not on a simulator. iOS 9.2.1, watchOS 2.1

我使用 watchOS 2.2 beta 5 + iOS 9.3 beta 5 添加了测试.我编辑了上面的结果.总结:删除是固定的,保存在iPhone上还是不行.

I added tests using watchOS 2.2 beta 5 + iOS 9.3 beta 5. I edited the results above. Summary: deleting is fixed, Saving on the iPhone still doesn't work.

在 iOS 9.3/watchOS 2.2 中,Apple 添加了 HKActivitySummaryHKActivitySummaryQueryHKActivityRingView.简而言之:关于 iPhone 上活动应用程序的所有内容也适用于 HKActivitySummaryQuery.他们共享上述功能和错误.

With iOS 9.3 / watchOS 2.2, Apple added HKActivitySummary, HKActivitySummaryQuery and HKActivityRingView. In short: everything said about the activity app on the iPhone also applies to HKActivitySummaryQuery. They share features and bugs described above.

推荐答案

这绝对是目前难以驾驭的事情!三个不同的问题有不同的解释.

This is definitely something that is tricky to navigate at the moment! There are three distinct issues with separate explanations.

  1. 在 iPhone 上保存锻炼时:

  • 保存在手机上的锻炼并不用于提供活动积分.它们必须来自 Apple Watch.
  • 编辑:从 iOS 10 开始,如果用户有 Apple Watch,保存在手机上的锻炼会计入活动.
  • Workouts saved on the phone are not intended to provide Activity credit. They must originate on Apple Watch.
  • as of iOS 10, workouts saved on the phone count towards Activity if the user has an Apple Watch.

当您在 Apple Watch 上保存锻炼并在 iPhone 应用中删除它时:

  • 在 iOS 9.2 及更早版本中,在手机上删除样本不会在 Apple Watch 上删除相同的样本,实际上是在 Apple Watch 上计算 Activity.这在 iOS 9.3 中修复.
  • 删除 HKWorkout 样本不足以删除与该锻炼关联的样本.例如,如果您不希望它们再存在,则需要明确删除关联的活动能量样本.也就是说,删除锻炼应该会从活动环中删除它的贡献.如果不是,那么这听起来像是一个值得单独提交的错误,因为您的原始错误可能被解释为请求在 Activity 中对 iPhone 的锻炼计数.
  • In iOS 9.2 and earlier, deleting a sample on the phone does not delete the same sample on Apple Watch, where Activity is actually calculated. This is fixed in iOS 9.3.
  • Deleting an HKWorkout sample is not sufficient to delete the samples that you associated with that workout. For example, you need to delete the associated active energy samples explicitly if you don't want them to exist anymore. That said, deleting the workout should remove its contribution from the Activity rings. If it doesn't, then that sounds like a bug that would be worth filing separately since your original bug was probably interpreted as a request to have workouts from iPhone count in Activity.

这篇关于HealthKit:保存在 iPhone 上的锻炼在活动应用程序中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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