I have an app I am testing on iOS 10 Beta 3 currently, and for some odd reason whenever I execute this one method, it seems to be crashing on the startPedometerUpdatesFromDate
line below:
if (!_pedometer) {
_pedometer = [[CMPedometer alloc] init];
}
[_pedometer startPedometerUpdatesFromDate:[NSDate date] withHandler:^(CMPedometerData * _Nullable pedometerData, NSError * _Nullable error) {
I have confirmed that _pedometer
is not nil
and it is even more odd as it worked in iOS 9 before I upgraded.
There is nothing in the console that suggests anything wrong with the code, and when it crashes it just leads to this (even with exception breakpoints):
libsystem_kernel.dylib`__abort_with_payload:
0x183a58d94 <+0>: movz x16, #0x209
0x183a58d98 <+4>: svc #0x80
-> 0x183a58d9c <+8>: b.lo 0x183a58db4 ; <+32>
0x183a58da0 <+12>: stp x29, x30, [sp, #-16]!
0x183a58da4 <+16>: mov x29, sp
0x183a58da8 <+20>: bl 0x183a3d7dc ; cerror_nocancel
0x183a58dac <+24>: mov sp, x29
0x183a58db0 <+28>: ldp x29, x30, [sp], #16
0x183a58db4 <+32>: ret
I also made sure to include Privacy - Health Update Usage Description and Privacy - Health Share Usage Description in my Info.plist. It is also being tested on an iPhone 6 Plus so I am not quite sure what the issue could be. Is there anything I am missing?
iOS 10 has updated privacy policy and implemented new privacy rules. You have to update your Info.plist app with this following fields by authorisation asked.
Description text will be displayed when authorization will be prompted.
<!-- 🖼 Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string><Your description goes here></string>
<!-- 📷 Camera -->
<key>NSCameraUsageDescription</key>
<string><Your description goes here></string>
<!-- 🎤 Microphone -->
<key>NSMicrophoneUsageDescription</key>
<string><Your description goes here></string>
<!-- 📍 Location -->
<key>NSLocationUsageDescription</key>
<string><Your description goes here></string>
<!-- 📍 Location When In Use -->
<key>NSLocationWhenInUseUsageDescription</key>
<string><Your description goes here></string>
<!-- 📍 Location Always -->
<key>NSLocationAlwaysUsageDescription</key>
<string><Your description goes here></string>
<!-- 📆 Calendars -->
<key>NSCalendarsUsageDescription</key>
<string><Your description goes here></string>
<!-- ⏰ Reminders -->
<key>NSRemindersUsageDescription</key>
<string><Your description goes here></string>
<!-- 🏊 Motion -->
<key>NSMotionUsageDescription</key>
<string><Your description goes here></string>
<!-- 💊 Health Update -->
<key>NSHealthUpdateUsageDescription</key>
<string><Your description goes here></string>
<!-- 💊 Health Share -->
<key>NSHealthShareUsageDescription</key>
<string><Your description goes here></string>
<!-- ᛒ🔵 Bluetooth Peripheral -->
<key>NSBluetoothPeripheralUsageDescription</key>
<string><Your description goes here></string>
<!-- 🎵 Media Library -->
<key>NSAppleMusicUsageDescription</key>
<string><Your description goes here></string>
Apple Engineering has gave me the following feedback after filing a bug report:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMotionUsageDescription key with a string value explaining to the user how the app uses this data.
Came here to say that got the same error, but it was missing NSContactsUsageDescription
in my case. I wish they'd have a better error message.
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