feat: add custom calendar support via plist#1292
Open
rantoniuk wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clicking a calendar event in the Notch always opened Apple Calendar, ignoring the macOS Default Calendar App system setting (#1286).
This is alternative implementation to (#1288)
Root cause:
EventModel.calendarAppURL()hardcoded theical://ekevent/…URL scheme. This scheme is Apple Calendar's proprietary internal protocol — macOS never routes it to any third-party app, regardless of the system preference. The Default Calendar App setting only affects.icsfile opens andwebcal://subscription URLs, notical://.Solution
Detection
The default calendar app is resolved at runtime by querying which application handles
webcal://links — the same signal macOS uses for the systempreference:
Data-driven URL routing
A new bundled resource —
CalendarAppURLSchemes.plist— maps each calendar app's bundle ID to a URL template. Two placeholders are supported:{id}EKEvent.calendarItemIdentifier{date}/yyyy-MM-dd'T'HH:mm:ssZ), empty string for non-recurring eventsInitial entries:
com.apple.iCalical://ekevent{date}/{id}?method=show&options=morecom.flexibits.fantastical2.macx-fantastical2://show?eventIdentifier={id}com.busymac.busycal3busycal://open?calendarItemIdentifier={id}If the plist has no entry for the current default app, the code falls back to the original
ical://URL (Apple Calendar behaviour).Adding support for a new calendar app
No Swift changes needed — just a one-line addition to the plist:
Known limitation
Microsoft Outlook for Mac is not supported: it does not register as a
webcal://handler (so it cannot be detected) and has no documented URLscheme for opening an existing calendar event by identifier.