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:
Step counting is not available on this device!
How can i make it available for step counting ?
Your code is correct and it yields the expected result. The iPhone 5 does not have the hardware (the Apple M7 chip) to track steps, so step counting is not available.
You need at least an iPhone 5s
The iPhone 4s, 5 and 5c do not have the M7 Motion Sensor co-processor so they will not record steps. The iPhone 5s, 6 and 6 Plus all have a motion co-processor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With