CMPedometer StepCounting not available

My code is:

if ([CMPedometer isStepCountingAvailable]) { self.pedometer = [[CMPedometer alloc] init]; } else { NSLog(@"Step counting is not available on this device!"); [SVProgressHUD showErrorWithStatus:@"Step counting is not available on this device!"]; } 

When I run it on iOS8 and later devices, it says:

Counting steps on this device is not available!

How can I make it available for step counting?

+5
source share
2 answers

Your code is correct and it gives the expected result. The iPhone 5 does not have hardware (Apple M7 chip) for tracking steps, so step counting is not available.

You need at least iPhone 5s

+7
source

The iPhone 4s, 5, and 5c do not have a M7 Motion Sensor coprocessor, so they won’t record steps. The iPhone 5s, 6, and 6 Plus have a motion coprocessor.

+1
source

Source: https://habr.com/ru/post/1209059/


All Articles