I have an existing app since 2010, and with iOS 10 it is now required that the app is having strings in the Info.plist
describing the usage, as explained here:
http://useyourloaf.com/blog/privacy-settings-in-ios-10/
However, I already added the corresponding key in my Info.plist. Still, users report app crashes when the app tries to access calendars. One of the users now managed to send me a crash report, which looks like this:
Termination Reason: TCC, This app has crashed because it attempted to access
privacy-sensitive data without a usage description.
The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
Triggered by Thread: 2
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x00000001812501a8 0x18124f000 + 4520
1 libdispatch.dylib 0x000000018113b7ec 0x181128000 + 79852
2 Contacts 0x000000018aa2c63c 0x18a9c8000 + 411196
3 Contacts 0x000000018a9f7c40 0x18a9c8000 + 195648
4 Contacts 0x000000018aa08578 0x18a9c8000 + 263544
5 EventKitUI 0x000000018f18b5a4 0x18f169000 + 140708
6 EventKitUI 0x000000018f2a9628 0x18f169000 + 1312296
7 EventKitUI 0x000000018f2aa3a8 0x18f169000 + 1315752
8 UIKit 0x000000018843b1b4 0x1880e8000 + 3486132
Now the question is, why is my app needing access to contacts, but my app only wants to read/write calendars?
In the crashing code I am opening a EKCalendarChooser
, and previously I asked the user for permission using eventStore requestAccessToEntityType:EKEntityTypeEvent completion:(...)
In my Info.plist I have:
<key>NSCalendarsUsageDescription</key>
<string>Storing of leave data</string>
So how do I fix this? Must I add NSContactsUsageDescription
as indicated by the crash report? Why? And will it lead to a popup prompt for contacts access, which would most users probably consider as a bad thing?
Note: the weirdest thing is, that on none of my devices this crash can be reproduced, I only have a couple of users reporting this kind of crash.