Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@ebarooni/capacitor-calendar
Advanced tools
The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.
The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.
https://capacitor-calendar.pages.dev
npm install @ebarooni/capacitor-calendar
npx cap sync
Platform | range |
---|---|
iOS | ≥ 13 |
Android | ≥ 7 (SDK 24 or Nougat) |
iOS 17 | Android 14 |
---|---|
On iOS, readCalendar
permission is not needed when you a
re creating an event using the native prompt.
The video is just for showing the functionality, otherwise the createEventWithPrompt
method works without the readCalendar
authorization.
To be able to use the plugin, you will need to add the required permissions to your app. The required platform-specific permissions can be found below:
checkPermission(...)
checkAllPermissions()
requestPermission(...)
requestAllPermissions()
createEventWithPrompt()
selectCalendarsWithPrompt(...)
listCalendars()
getDefaultCalendar()
createEvent(...)
getDefaultRemindersList()
getRemindersLists()
createReminder(...)
openCalendar(...)
openReminders()
checkPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
Checks the current authorization status of a specific permission.
Param | Type | Description |
---|---|---|
options | { alias: PluginPermission; } | An object with the name of the permission |
Returns: Promise<{ result: PermissionState; }>
checkAllPermissions() => Promise<PluginPermissionsMap>
Checks the current authorization status of all the required permissions for the plugin.
Returns: Promise<PluginPermissionsMap>
requestPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
Requests authorization to a specific permission, if not already granted. If the permission is already granted, it will directly return the status.
Param | Type | Description |
---|---|---|
options | { alias: PluginPermission; } | An object with the name of the permission |
Returns: Promise<{ result: PermissionState; }>
requestAllPermissions() => Promise<PluginPermissionsMap>
Requests authorization to all the required permissions for the plugin, if they have not already been granted.
Returns: Promise<PluginPermissionsMap>
createEventWithPrompt() => Promise<{ eventCreated: boolean; }>
Creates an event in the calendar by using the native calendar. On iOS opens a native sheet and on Android opens an intent. This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed. On Android, the user has to authorize for read access.
Returns: Promise<{ eventCreated: boolean; }>
selectCalendarsWithPrompt(options: { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; }) => Promise<{ result: Calendar[]; }>
Presents a prompt to the user to select calendars. This method is available only on iOS.
Param | Type | Description |
---|---|---|
options | { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; } | - Options for customizing the display and selection styles of the calendar chooser. |
Returns: Promise<{ result: Calendar[]; }>
listCalendars() => Promise<{ result: Calendar[]; }>
Retrieves a list of calendars available on the device.
Returns: Promise<{ result: Calendar[]; }>
getDefaultCalendar() => Promise<{ result: Calendar; }>
Retrieves the default calendar set on the device.
Returns: Promise<{ result: Calendar; }>
createEvent(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; }) => Promise<{ eventCreated: boolean; }>
Creates an event with the provided options.
Param | Type | Description |
---|---|---|
options | { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; } | - Options for creating the event. |
Returns: Promise<{ eventCreated: boolean; }>
getDefaultRemindersList() => Promise<{ result: RemindersList; }>
Retrieves the default reminders list set on the device.
Returns: Promise<{ result: RemindersList; }>
getRemindersLists() => Promise<{ result: RemindersList[]; }>
Retrieves all available reminders lists on the device.
Returns: Promise<{ result: RemindersList[]; }>
createReminder(options: { title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: ReminderRecurrenceRule; }) => Promise<{ reminderCreated: boolean; }>
Creates a reminder with the provided options.
Param | Type | Description |
---|---|---|
options | { title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: ReminderRecurrenceRule; } | - Options for creating the reminder. |
Returns: Promise<{ reminderCreated: boolean; }>
openCalendar(options: { date?: number; }) => Promise<void>
Opens the calendar app. Since the user leaves your app, use this method with caution. It will open the calendar on today's date if no date is provided.
Param | Type | Description |
---|---|---|
options | { date?: number; } | - Options for opening the calendar. |
openReminders() => Promise<void>
Opens the reminders app. Since the user leaves your app, use this method with caution.
Represents a calendar object.
Prop | Type |
---|---|
id | string |
title | string |
Prop | Type | Description |
---|---|---|
frequency | ReminderRecurrenceFrequency | How frequent should the reminder repeat. |
interval | number | The interval should be a number greater than 0. For values lower than 1 the method will throw an error. |
end | number | When provided, the reminder will stop repeating at the given time. |
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
Members | Value | Description |
---|---|---|
READ_CALENDAR | 'readCalendar' | Represents the permission state for reading calendar. |
WRITE_CALENDAR | 'writeCalendar' | Represents the permission state for writing calendar. |
READ_REMINDERS | 'readReminders' | Represents the permission state for reading reminders. |
WRITE_REMINDERS | 'writeReminders' | Represents the permission state for writing reminders. |
Members | Description |
---|---|
ALL_CALENDARS | Display all calendars available for selection. |
WRITABLE_CALENDARS_ONLY | Display only writable calendars available for selection. |
Members | Description |
---|---|
SINGLE | Allows only a single selection in the calendar chooser. |
MULTIPLE | Allows multiple selections in the calendar chooser. |
Members | Description |
---|---|
DAILY | The reminder repeats on a daily basis |
WEEKLY | The reminder repeats on a weekly basis |
MONTHLY | The reminder repeats on a monthly basis |
YEARLY | The reminder repeats on a yearly basis |
FAQs
The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.
The npm package @ebarooni/capacitor-calendar receives a total of 1,246 weekly downloads. As such, @ebarooni/capacitor-calendar popularity was classified as popular.
We found that @ebarooni/capacitor-calendar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.