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

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

问题描述

使用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 Health App中查看锻炼和示例
  • 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 Health App中查看锻炼和示例
  • 我可以在iPhone活动应用程序中查看锻炼和示例

当我保存在Apple Watch上并在iPhone应用程序中将其删除

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

当我保存在Apple Watch上并在Apple Watch App中将其删除

  • 在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 Activity App起作用的方式?

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

更具体的问题:

  • 如何在iPhone上保存锻炼和样本,以使锻炼和样本不仅可以在同一iPhone上的健康"应用程序中看到,而且可以在同一iPhone上的活动"应用程序中看到?
  • 如何删除使用Watch App保存的iPhone上的锻炼和样本,这样不仅可以在同一iPhone上的Health App中删除锻炼和样本,还可以在iPhone上的Activity App中删除锻炼和样本.同一部iPhone?

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

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 App中删除:

  • 在iOS 9.2和更早版本中,删除手机上的样本不会删除Apple Watch上的相同样本,因为Apple Watch实际会计算出活动".在iOS 9.3中已已修复.
  • 删除HKWorkout样本不足以删除与该锻炼关联的样本.例如,如果您不想再存在相关的有功电能样本,则需要明确删除它们.也就是说,删除锻炼应从活动"环中删除其贡献.如果不是,那么听起来这是一个值得单独提交的错误,因为您的原始错误可能被解释为要求将来自iPhone的锻炼计入Activity中.
  • 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上保存的锻炼在Activity App中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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