@ebarooni/capacitor-calendar
    Preparing search index...

    Breaking Changes

    Breaking changes by release, with migration steps. See CHANGELOG.md for the full release history.

    Version 9.x.x

    The plugin now needs Capacitor 9. The peer dependency is @capacitor/core >= 9.0.0.

    • iOS: the minimum deployment target is iOS 16.0.
    • Android: minSdkVersion is 26 and compileSdkVersion is 37. The plugin uses AGP 9.4.1 and Gradle 9.8.2.
    • Swift Package Manager: the plugin depends on 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.
    1. Update your app to Capacitor 9. Follow the Capacitor 9 update guide.
    2. Run npm install @ebarooni/capacitor-calendar@latest and npx cap sync.
    3. To stay on Capacitor 8, install @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);

    On 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 calendar
    • calendar fields without a value from listCalendars() and getDefaultCalendar(...), for example colorName, isImmutable, type, isSubscribed and source
    • result from modifyEventWithPrompt(...)
    • ics from createEvent(...), and ics and id from createEventWithPrompt(...)
    • event fields without a value from 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 type

    Code that checks === undefined or 'key' in result for these values must check for null instead. == null and ?? work for both.

    Version 8.x.x

    On 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' });
    1. Pass only a SystemColorName or a valid hex string (#RRGGBB / #RRGGBBAA) for color.
    2. Catch 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.

    CreateCalendarOptions.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.

    1. Pass a SystemColorName or hex template literal (#RRGGBB / #RRGGBBAA), or narrow/cast unbound string values.
    2. On Android, keep using hex only for calendar color write.

    See CHANGELOG.md.

    On iOS, reminder recurrence frequency used EventKit integer raw values (0–3) in these places:

    • modifyReminder(...) input
    • getReminderById(...) / getRemindersFromLists(...) read-back

    The 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'
    1. Replace numeric frequencies and ReminderRecurrenceFrequency.* with string literals ('daily', 'weekly', 'monthly', 'yearly').
    2. Update any read-back checks that compared frequency to 0–3 or to ReminderRecurrenceFrequency enum members.
    3. Prefer RecurrenceRule / RecurrenceFrequency. ReminderRecurrenceFrequency and ReminderRecurrenceRule remain deprecated.

    Passing a non-string frequency (for example 0) now rejects with Invalid frequency.