Which iOS devices support CMStepCounter?

女生的网名这么多〃 提交于 2019-12-11 01:08:29

问题


Apple added step count support with the M7 in the new iPhone 5s. This is the documentation on isStepCountingAvailable

isStepCountingAvailable Returns a Boolean indicating whether step-counting support is available on the current device.

  • (BOOL)isStepCountingAvailable Return Value YES if step-counting support is available or NO if it is not.

Discussion Step-counting support is not available on all iOS devices. Use this method to determine if support is available on the current device.

Availability Available in iOS 7.0 and later. Declared In CMStepCounter#

When I run:

BOOL isUsersHardwareCompatibleWithPedometerApp = [CMStepCounter isStepCountingAvailable];

on my 5s isUsersHardwareCompatibleWithPedometerApp's value is YES.

Which devices will return YES for Core Motion's CMStepCounter class method + isStepCountingAvailable? Also can I restrict devices which return NO from downloading my app in the AppStore? Or is there a good proxy for restricting users from downloading my app such as the front facing camera being a good proxy for determining if the user has at least 512mb of ram?


回答1:


I don't have a device to test with but @_DavidSmith, creator of the popular Pedometer++ app has determined that the new iPad Air/rMini don't give step data.

After some investigation the iPad Air/rMini look to support activity categorization but not step counting w/ its M7. Which makes sense to me

https://twitter.com/_DavidSmith/status/404252937821900801

Thus so far the iPhone 5s is the only device that supports step data.




回答2:


Currently (Nov 2013), only the iPhone 5S, the iPad Air and iPad mini with retina display have the M7 coprocessor, which is required for step counting. As per this answer, there is no way currently to restrict devices based on M7 availability.



来源:https://stackoverflow.com/questions/20166556/which-ios-devices-support-cmstepcounter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!