Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

Step counting is not available on this device!

How can i make it available for step counting ?

like image 706
Mani murugan Avatar asked Dec 15 '14 07:12

Mani murugan


2 Answers

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

like image 105
Matthias Bauch Avatar answered Sep 28 '22 06:09

Matthias Bauch


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.

like image 21
byJeevan Avatar answered Sep 28 '22 08:09

byJeevan