Breaking changes by release, with migration steps. See CHANGELOG.md for the full release history.
The plugin now needs Capacitor 9. The peer dependency is @capacitor/core >= 9.0.0.
minSdkVersion is 26 and compileSdkVersion is 37. The plugin uses AGP 9.4.1 and Gradle 9.8.2.https://github.com/ionic-team/capacitor.git (product Capacitor of package capacitor), not on capacitor-swift-pm. The Cordova product is no longer a dependency.npm install @ebarooni/capacitor-calendar@latest and npx cap sync.@ebarooni/capacitor-calendar@latest-8.Each method that resolves a value now resolves a named *Result interface. The interface is the resolved value. It is not wrapped in another { result: ... }.
These methods only change their TypeScript return type. The resolved JSON does not change.
| Method | New return type |
|---|---|
checkPermission(...) |
CheckPermissionResult |
requestPermission(...) |
RequestPermissionResult |
requestWriteOnlyCalendarAccess() |
RequestWriteOnlyCalendarAccessResult |
requestReadOnlyCalendarAccess() |
RequestReadOnlyCalendarAccessResult |
requestFullCalendarAccess() |
RequestFullCalendarAccessResult |
requestFullRemindersAccess() |
RequestFullRemindersAccessResult |
modifyEventWithPrompt(...) |
ModifyEventWithPromptResult |
deleteEventWithPrompt(...) |
DeleteEventWithPromptResult |
Eight methods resolve a different JSON shape on Android and iOS. There are no deprecated fields: read the new keys.
| Method | Before (8.x) | After (9.0.0) |
|---|---|---|
listCalendars() |
{ result: Calendar[] } |
{ calendars: Calendar[] } |
getDefaultCalendar(...) |
{ result: Calendar | null } |
{ calendar: Calendar | null } |
checkAllPermissions() |
{ result: { readCalendar, writeCalendar, readReminders, writeReminders } } |
{ readCalendar, writeCalendar, readReminders, writeReminders } |
requestAllPermissions() |
{ result: { readCalendar, writeCalendar, readReminders, writeReminders } } |
{ readCalendar, writeCalendar, readReminders, writeReminders } |
deleteEventsById(...) |
{ result: { deleted, failed } } |
{ deleted, failed } |
deleteRemindersById(...) |
{ result: { deleted, failed } } |
{ deleted, failed } |
getRemindersLists() |
{ result: RemindersList[] } |
{ remindersLists: RemindersList[] } |
getDefaultRemindersList() |
{ result: RemindersList | null } |
{ remindersList: RemindersList | null } |
The reminders methods getRemindersLists() and getDefaultRemindersList() are iOS only, so only iOS code needs to change for them.
The return types are ListCalendarsResult, GetDefaultCalendarResult (new), CheckAllPermissionsResult, RequestAllPermissionsResult, DeleteEventsByIdResult, DeleteRemindersByIdResult, GetRemindersListsResult and GetDefaultRemindersListResult. Each type is the resolved value. CheckAllPermissionsResult and RequestAllPermissionsResult are interfaces with one property per scope, not Record type aliases. If you typed a variable with one of these names to hold the inner value, the name now fits the whole result.
// Before
const { result: calendars } = await CapacitorCalendar.listCalendars();
const { result: defaultCalendar } = await CapacitorCalendar.getDefaultCalendar();
const { result: states } = await CapacitorCalendar.checkAllPermissions();
const { result: requested } = await CapacitorCalendar.requestAllPermissions();
const { result: events } = await CapacitorCalendar.deleteEventsById({ ids });
const { result: reminders } = await CapacitorCalendar.deleteRemindersById({ ids });
const { result: remindersLists } = await CapacitorCalendar.getRemindersLists();
const { result: defaultRemindersList } = await CapacitorCalendar.getDefaultRemindersList();
console.log(events.deleted, events.failed);
// After
const { calendars } = await CapacitorCalendar.listCalendars();
const { calendar: defaultCalendar } = await CapacitorCalendar.getDefaultCalendar();
const states = await CapacitorCalendar.checkAllPermissions();
const requested = await CapacitorCalendar.requestAllPermissions();
const { deleted, failed } = await CapacitorCalendar.deleteEventsById({ ids });
const reminders = await CapacitorCalendar.deleteRemindersById({ ids });
const { remindersLists } = await CapacitorCalendar.getRemindersLists();
const { remindersList: defaultRemindersList } = await CapacitorCalendar.getDefaultRemindersList();
console.log(deleted, failed);
null instead of leaving out keysOn Android, these values now resolve null, like on iOS. Before, the key was missing, so the value was undefined:
calendar from getDefaultCalendar(...) when there is no default calendarlistCalendars() and getDefaultCalendar(...), for example colorName, isImmutable, type, isSubscribed and sourceresult from modifyEventWithPrompt(...)ics from createEvent(...), and ics and id from createEventWithPrompt(...)listEventsInRange(...), getEventById(...) and the created and updated events of the calendarChanged listener, for example location, url, description, organizer, color, duration, creationDate and timezone, and the attendee fields email, name, role, status and typeCode that checks === undefined or 'key' in result for these values must check for null instead. == null and ?? work for both.
color rejectsOn iOS, createRemindersList(...) and updateRemindersList(...) used to ignore unrecognized color strings (create left EventKit’s color unset; update left the list color unchanged).
Invalid values now reject with Invalid color format., same as calendar color parsing. Valid input is a known system name (blue, …) or hex #RRGGBB / #RRGGBBAA.
// Unknown name was ignored (create: no color set; update: color unchanged)
await CapacitorCalendar.createRemindersList({ title: 'Groceries', color: 'navy' });
// Rejects with Invalid color format.
await CapacitorCalendar.createRemindersList({ title: 'Groceries', color: 'navy' });
// Valid: system name or hex
await CapacitorCalendar.createRemindersList({ title: 'Groceries', color: 'indigo' });
await CapacitorCalendar.createRemindersList({ title: 'Groceries', color: '#007AFF' });
SystemColorName or a valid hex string (#RRGGBB / #RRGGBBAA) for color.Invalid color format. if you previously relied on silent ignore.Omitting color on create still leaves the list color unset so the platform chooses it.
See CHANGELOG.md.
color TypeScript typeCreateCalendarOptions.color and ModifyCalendarOptions.color are now a SystemColorName or hex #RRGGBB / #RRGGBBAA instead of unbound string. Reminders-list create/update use the same inline union (no RemindersListColor / SystemOrHexColor aliases). Runtime hex write and omit-on-create (#007AFF) are unchanged. On iOS, named colors are newly accepted for calendars; on Android, named colors still reject with Invalid color format.
SystemColorName or hex template literal (#RRGGBB / #RRGGBBAA), or narrow/cast unbound string values.See CHANGELOG.md.
frequency is a stringOn iOS, reminder recurrence frequency used EventKit integer raw values (0–3) in these places:
modifyReminder(...) inputgetReminderById(...) / getRemindersFromLists(...) read-backThe public TypeScript contract already used string RecurrenceFrequency ('daily' | 'weekly' | 'monthly' | 'yearly'). Create had been migrated earlier; modify and read-back now match.
await CapacitorCalendar.modifyReminder({
id,
recurrence: {
frequency: 1, // or ReminderRecurrenceFrequency.WEEKLY
interval: 1,
},
});
const { result } = await CapacitorCalendar.getReminderById({ id });
result?.recurrence[0]?.frequency; // 0 | 1 | 2 | 3
await CapacitorCalendar.modifyReminder({
id,
recurrence: {
frequency: 'weekly',
interval: 1,
},
});
const { result } = await CapacitorCalendar.getReminderById({ id });
result?.recurrence[0]?.frequency; // 'daily' | 'weekly' | 'monthly' | 'yearly'
ReminderRecurrenceFrequency.* with string literals ('daily', 'weekly', 'monthly', 'yearly').0–3 or to ReminderRecurrenceFrequency enum members.RecurrenceRule / RecurrenceFrequency. ReminderRecurrenceFrequency and ReminderRecurrenceRule remain deprecated.Passing a non-string frequency (for example 0) now rejects with Invalid frequency.