我在iPad 2017(iOS 11)上获取步骤时遇到问题。
我有这个代码来检查
if CMMotionActivityManager.isActivityAvailable() {
startTrackingActivityType() // Works good and I get activity.
}
if CMPedometer.isStepCountingAvailable() {
// does not work
} else {
print("Step Counting Unavailable") // log says that counting is not available here when I debug on iPad
}
iPad支持步数吗?
我在plist中设置了这个键:
<key>NSMotionUsageDescription</key>
<string>$(PRODUCT_NAME) motion use.</string>