I have previously used (probably a few years ago) eventStoreMBS to get access to macOS Reminders, but now the eventStore.requestAccessToEntityType always returns false for the “granted” parameter. Presumably something has changed in Mojave or Big Sur security.
I note in Apple documentation that I’m supposed to add an entitlement to com.apple.security.personal-information.calendars. I use AppWrapper4 but don’t see this as an option (there being no checkbox next to Reminders.
Yes, did that, but still not working.
I tried on a new Virtual Machine - the requestAccessToEntityType does trigger macOS to ask permission to access reminders. I can see the the app is selected inside Security & Privacy. But it is seems to be providing either granted = false or nothing when ask for eventStore.sources - I need to re-programme a bit to see which it is.
An iOS app linked on or after iOS 10.0 will crash if it doesn’t include in its Info.plist file the usage description keys for the types of data it needs to access. To access Reminders and Calendar data specifically, it must include NSRemindersUsageDescription and NSCalendarsUsageDescription, respectively.
To access the user’s Calendar data, all sandboxed macOS apps must include the com.apple.security.personal-information.calendars entitlement. To learn more about entitlements related to App Sandbox, see Enabling App Sandbox.
Seems to apply also for macOS and non sandboxed apps.
I’ve spent the morning on this - but still no closer to getting a sandboxed app to access the content of Reminders.
I did find that I need to run both the following access requests to get the app to appear in System Preferences/Privacy pane for Reminders.
type = EKEventStoreMBS.kEntityTypeEvent
eventStore.requestAccessToEntityType(type)
type = EKEventStoreMBS.kEntityTypeReminder
eventStore.requestAccessToEntityType(type)
The app runs in both Sandboxed and non-Sandboxed versions (using AppWrapper’s script function) - both giving the same result for:
Dim r As Integer = eventStore.authorizationStatusForEntityType(Type)
Both sandbox and non-sandbox return r = 3 for both Types, ie app is authorised for access to both Events and Reminders.
However, non-Sandboxed apps return an array of ekSourceMBS’s for eventStore.sources, whereas Sandboxed apps return array(-1).
As reported earlier, the plist has the correct entitlements and descriptions for Calendars and Reminders, all generated by AppWrapper.
I have searched Apple Developer and StackExchange but not finding any useful pointers.