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

    Interface CapacitorCalendarPlugin

    interface CapacitorCalendarPlugin {
        checkAllPermissions(): Promise<{ result: CheckAllPermissionsResult }>;
        checkPermission(
            options: CheckPermissionOptions,
        ): Promise<{ result: PermissionState }>;
        commit(): Promise<void>;
        createCalendar(
            options: CreateCalendarOptions,
        ): Promise<CreateCalendarResult>;
        createEvent(options: CreateEventOptions): Promise<CreateEventResult>;
        createEventWithPrompt(
            options?: CreateEventWithPromptOptions,
        ): Promise<CreateEventWithPromptResult>;
        createReminder(options: CreateReminderOptions): Promise<{ id: string }>;
        createRemindersList(
            options: CreateRemindersListOptions,
        ): Promise<CreateRemindersListResult>;
        deleteCalendar(options: DeleteCalendarOptions): Promise<void>;
        deleteEvent(options: DeleteEventOptions): Promise<void>;
        deleteEventsById(
            options: DeleteEventsByIdOptions,
        ): Promise<{ result: DeleteEventsByIdResult }>;
        deleteEventWithPrompt(
            options: DeleteEventWithPromptOptions,
        ): Promise<{ deleted: boolean }>;
        deleteReminder(options: DeleteReminderOptions): Promise<void>;
        deleteRemindersById(
            options: DeleteRemindersByIdOptions,
        ): Promise<{ result: DeleteRemindersByIdResult }>;
        deleteRemindersList(options: DeleteRemindersListOptions): Promise<void>;
        deleteReminderWithPrompt(
            options: DeleteReminderWithPromptOptions,
        ): Promise<{ deleted: boolean }>;
        fetchAllCalendarSources(): Promise<FetchAllCalendarSourcesResult>;
        fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }>;
        getDefaultCalendar(
            options?: GetDefaultCalendarOptions,
        ): Promise<{ result: Calendar | null }>;
        getDefaultRemindersList(): Promise<{ result: Calendar | null }>;
        getReminderById(
            options: GetReminderByIdOptions,
        ): Promise<{ result: Reminder | null }>;
        getRemindersFromLists(
            options: GetRemindersFromListsOptions,
        ): Promise<{ result: Reminder[] }>;
        getRemindersLists(): Promise<{ result: Calendar[] }>;
        listCalendars(): Promise<ListCalendarsResult>;
        listEventsInRange(
            options: ListEventsInRangeOptions,
        ): Promise<{ result: CalendarEvent[] }>;
        modifyCalendar(options: ModifyCalendarOptions): Promise<void>;
        modifyEvent(options: ModifyEventOptions): Promise<void>;
        modifyEventWithPrompt(
            options: ModifyEventWithPromptOptions,
        ): Promise<{ result: EventEditAction | null }>;
        modifyReminder(options: ModifyReminderOptions): Promise<void>;
        openCalendar(options?: OpenCalendarOptions): Promise<void>;
        openReminders(): Promise<void>;
        requestAllPermissions(): Promise<{ result: RequestAllPermissionsResult }>;
        requestFullCalendarAccess(): Promise<{ result: PermissionState }>;
        requestFullRemindersAccess(): Promise<{ result: PermissionState }>;
        requestPermission(
            options: RequestPermissionOptions,
        ): Promise<{ result: PermissionState }>;
        requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }>;
        requestWriteOnlyCalendarAccess(): Promise<{ result: PermissionState }>;
        selectCalendarsWithPrompt(
            options?: SelectCalendarsWithPromptOptions,
        ): Promise<SelectCalendarsWithPromptResult>;
        updateRemindersList(
            options: UpdateRemindersListOptions,
        ): Promise<UpdateRemindersListResult>;
    }

    Hierarchy

    • CalendarAccess
    • RemindersAccess
    • EventOperations
    • CalendarOperations
    • RemindersOperations
      • CapacitorCalendarPlugin
    Index

    Methods

    • Retrieves the current permission state for a given scope. On Android, readReminders and writeReminders resolve to "prompt".

      Parameters

      Returns Promise<{ result: PermissionState }>

      CapacitorCalendar.checkPermission({ scope: CalendarPermissionScope.READ_CALENDAR });
      

      Scope must be provided. — when scope is missing.

      Invalid scope. — when scope is invalid.

      Unhandled permission state. — when the native status cannot be mapped.

      Android, iOS

      0.1.0

    • Creates a calendar.

      title is required. color is optional and defaults to #007AFF. On Android, accountName and ownerAccount are required at runtime.

      Parameters

      Returns Promise<CreateCalendarResult>

      CapacitorCalendar.createCalendar({
      title: 'Work',
      accountName: 'plugin@example.com',
      ownerAccount: 'plugin@example.com',
      });

      Title must be provided. — when title is missing.

      Invalid color format. — when color is present but invalid.

      Account name must be provided. — when accountName is missing on Android.

      Owner account must be provided. — when ownerAccount is missing on Android.

      Calendar source not found. — when sourceId is set and no EventKit source matches (iOS).

      Failed to retrieve calendar ID. — when the calendar is created but no id is returned.

      Android, iOS

      5.2.0

    • Creates an event in the calendar. On Android and iOS, inserts into the system calendar and returns its id. On Web, there is no system calendar store: builds an .ics File as ics. The app must download or open that file (for example with downloadIcsFile(...)); this method does not trigger a download.

      Parameters

      Returns Promise<CreateEventResult>

      const { id, ics } = await CapacitorCalendar.createEvent({
      title: 'Team standup',
      startDate: Date.now(),
      icsFileName: 'team-standup.ics',
      });
      if (ics) {
      await downloadIcsFile(ics);
      }

      Android, iOS, Web

      0.4.0

    • Deletes a calendar by id.

      Parameters

      Returns Promise<void>

      Calendar ID must be provided. — when id is missing.

      Invalid calendar ID. — when id is not a numeric Android calendar id.

      Calendar not found. — when no calendar exists for id.

      Android, iOS

      5.2.0

    • Retrieves the default calendar.

      Requires calendar read access. On Android, missing permission typically rejects. On iOS, missing authorization typically yields result: null.

      The system default is the primary calendar on Android and defaultCalendarForNewEvents on iOS. When neither exists and useFallbackCalendar is true, the first available calendar is returned. Otherwise the method returns null when there is no system default.

      Parameters

      Returns Promise<{ result: Calendar | null }>

      Android, iOS

      0.3.0

    • Retrieves a list of all available calendars.

      Requires calendar read access. On Android, missing permission typically rejects. On iOS, missing authorization typically returns an empty result.

      Returns Promise<ListCalendarsResult>

      Android, iOS

      7.1.0

    • Retrieves events that overlap a date range.

      An event is included when its time interval intersects [from, to], including multi-day events that span the range without starting or ending inside it.

      Parameters

      Returns Promise<{ result: CalendarEvent[] }>

      const startOfDay = new Date();
      startOfDay.setHours(0, 0, 0, 0);
      const startOfNextDay = new Date(startOfDay);
      startOfNextDay.setDate(startOfNextDay.getDate() + 1);

      const { result } = await CapacitorCalendar.listEventsInRange({
      from: startOfDay.getTime(),
      to: startOfNextDay.getTime(),
      });

      Android, iOS

      0.10.0

    • Modifies a calendar with options.

      Parameters

      Returns Promise<void>

      Calendar ID must be provided. — when id is missing.

      Invalid calendar ID. — when id is not a numeric Android calendar id.

      At least one of title or color must be provided. — when both are omitted.

      Invalid color format. — when color is present but invalid.

      Calendar not found. — when no calendar exists for id.

      Calendar is not modifiable. — when the calendar cannot be modified (iOS).

      Android, iOS

      7.2.0

    • Requests read and write access to the calendar.

      Returns Promise<{ result: PermissionState }>

      Platform Required
      iOS 17+ NSCalendarsFullAccessUsageDescription
      iOS 13-16 NSCalendarsUsageDescription
      Android android.permission.READ_CALENDAR & android.permission.WRITE_CALENDAR

      Android, iOS

      5.4.0

    • Requests read and write access to the reminders. Resolves with "granted" or "denied" (never "prompt"). A grant covers both readReminders and writeReminders.

      Returns Promise<{ result: PermissionState }>

      Platform Required
      iOS 17+ NSRemindersFullAccessUsageDescription
      iOS 10-16 NSRemindersUsageDescription

      when EventKit fails or required Info.plist keys are missing.

      iOS

      5.4.0

    • Requests read access to the calendar.

      Returns Promise<{ result: PermissionState }>

      Platform Required
      Android android.permission.READ_CALENDAR

      Android

      5.4.0

    • Requests write access to the calendar.

      Returns Promise<{ result: PermissionState }>

      Platform Required
      iOS 17+ NSCalendarsWriteOnlyAccessUsageDescription
      iOS 13-16 NSCalendarsUsageDescription
      Android android.permission.WRITE_CALENDAR

      Android, iOS

      5.4.0