Skip to content

Migrate from CalendarStore to EventKit framework#6

Open
mgunville wants to merge 4 commits intodkaluta:masterfrom
mgunville:eventkit-migration
Open

Migrate from CalendarStore to EventKit framework#6
mgunville wants to merge 4 commits intodkaluta:masterfrom
mgunville:eventkit-migration

Conversation

@mgunville
Copy link

Summary

This PR migrates icalBuddy from the deprecated CalendarStore framework to EventKit, fixing the "No calendars" issue on modern macOS (10.14+).

The Problem

CalendarStore was deprecated in macOS 10.8 (2012) and doesn't integrate with macOS's privacy system (TCC - Transparency, Consent, and Control). On modern macOS, this causes icalBuddy to report "No calendars" even when calendars exist and permissions are granted in System Settings.

The Solution

EventKit is Apple's supported framework for calendar/reminders access. It:

  • Properly integrates with TCC privacy controls
  • Triggers permission prompts on first access
  • Supports both Calendar and Reminders
  • Is actively maintained by Apple

Changes

  • New file: EventKitStore.m - EKEventStore singleton with permission handling
  • Updated: calendarStoreImport.h - EventKit imports and compatibility typedefs
  • Updated: Makefile - Link EventKit framework, fix deprecated compiler flags
  • Updated: icalBuddyFunctions.m - Calendar/event/task queries using EventKit APIs
  • Updated: icalBuddyPrettyPrint.m - Handle EKEvent/EKReminder property differences
  • Updated: icalBuddyFormatting.m - CGColor to NSColor conversion

Compatibility

  • Maintains #ifdef USE_MOCKED_CALENDARSTORE guards for test compatibility
  • All original functionality preserved
  • macOS 10.13+ required (calendar colors require 10.15+)

Testing

Tested on macOS with:

  • icalBuddy calendars
  • icalBuddy eventsToday
  • Calendar filters (-ic, -ec) ✓
  • Formatting options (-tf, -df, -b, -ps, etc.) ✓

Note

If this PR isn't suitable for merging, it's available as a working fork at:
https://github.com/mgunville/icalBuddy64 (branch: eventkit-migration, set as default)

Anyone experiencing the "No calendars" issue on modern macOS can use that fork.

mgunville and others added 4 commits February 5, 2026 12:15
CalendarStore was deprecated in macOS 10.8 and doesn't integrate with
modern macOS privacy controls (TCC), causing "No calendars" errors.
This migration to EventKit enables proper permission prompts and
calendar/reminders access on modern macOS.

Key changes:
- Add EventKitStore.m for EKEventStore singleton and permission handling
- Update calendarStoreImport.h with EventKit imports and compatibility typedefs
- Update Makefile to link EventKit framework
- Update icalBuddyFunctions.m for EventKit calendar/event/task queries
- Update icalBuddyPrettyPrint.m for EKEvent/EKReminder property access
- Update icalBuddyFormatting.m for CGColor to NSColor conversion
- Handle EventKit API differences (URL vs url, calendarIdentifier vs uid, etc.)
- Add @available checks for macOS 10.15+ CGColor API

Tested: calendars, eventsToday, calendar filters, formatted output

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Document the EventKit migration and why it's needed
- Add installation and usage instructions
- Include troubleshooting section for common issues
- Credit all authors in fork lineage table
- Add separate LICENSE file with full attribution

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant