MBS Calendar List Plist Issue

In the MBS MacFrameworks example Calendar List there is a plist file called Info.plist. Here is the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>NSCalendarsUsageDescription</key>
   <string>Calendar access please</string>
   <key>NSRemindersUsageDescription</key>
   <string>Reminder access please</string>
</dict>
</plist>

When run, it requests your permission twice, once each to access the Calendars then Reminders. If both items are in the plist file it works fine. But, if you remove the seemingly superfluous Reminders access permission the example doesn’t access any calendar data.

Why is the Reminder privilege necessary to access the Calendars? Is there a workaround so the user is not bothered with two requests?

Are the 2 requests in debug or for a built app? I’m getting the same for contacts for debug since the stone age.

I just built the MBS Calendar List and ran it, and it also showed two requests, one for Calendar and one for Reminders, so it is the same for both debug and build versions.

I have also noticed that if you reverse the order of the permissions in the plist file (ie Reminder before Calendar) that the Calendar request also fails!

It’s one system database for both.

If you ask the plugin for all calendars, it will query both sides of the database.
But you can e.g. only query for calendars with events.

1 Like

How do you query for just calendars with events?

Surely your Calendar List code does this:

Dim cs As New CalCalendarStoreMBS
Dim calendars(-1) As CalCalendarMBS = cs.calendars

You use the newer EventKit classes.

the old calendar framework may do both automatically.

I have tried running the Mac64bit>EventKit>EventKit example both in debug and as a built app and clicking the Request Access button never changes the buttons from grey, nor does is display the requesting privilege dialog windows. Also the plist items inside the info.plist file don’t show up inside the built app.

The example’s note suggests I need the following MBS Plugins:
MBS Xojo Cocoa Plugin.xojo_plugin
MBS Xojo CocoaBase Plugin.xojo_plugin
MBS Xojo Lion Plugin.xojo_plugin
MBS Xojo Mac64bit Plugin.xojo_plugin
MBS Xojo Main Plugin.xojo_plugin
MBS Xojo SnowLeopard Plugin.xojo_plugin

which I do except these no longer exist:
CocoaBase, Lion and SnowLeopard

Has someone else gotten it to work?

It seems EventKit needs the info.plist to be the same as that in the Calendar List example ie it needs both Calendars and Reminders privilege.

But the good thing is that you can extract the calendar data with only the Calendar privilege window request appearing, not both Calendars and Reminders.

FYI EventKit is now working as a full replacement for analysing the macOS Calendar with only the one request dialog.

1 Like