CMAltimeter and [CMAltimeter isRelativeAltitudeAvailable] not work on Ipad iOS 10

456 Views Asked by At

I have and app access barometer on iPhone and Ipad, when Apple release iOS 10 some iPad user report that app stop working. I tested on my iPhone 6s iOS 10 and it still work fine. Search Apple Dev, no API change. In the app i use below code to get barometer sensor information:

    if([CMAltimeter isRelativeAltitudeAvailable]){ // This return false on iPad
    [self.altimeterManager startRelativeAltitudeUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMAltitudeData *altitudeData, NSError *error) {
        if (self.delegate){
            [self.delegate updatePressure: altitudeData.pressure.doubleValue*10.0];
        }
    }];
}
1

There are 1 best solutions below

0
Steve Moser On

This should be fixed with iOS 10.1

According to the developer release notes, iOS 10.1 includes a fix for motion handling. Developers will be able to access barometric pressure data for iPad Air 2, iPad mini 4 and iPad Pro.

https://9to5mac.com/2016/09/21/apple-releases-ios-10-1-and-watchos-3-1-beta-seeds-for-developers/