This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo Calendar
A library that provides an API for interacting with the device's system calendars, events, reminders, and associated records.
expo-calendar provides an API for interacting with the device's system calendars, events, reminders, and associated records.
Additionally, it provides methods to launch the system-provided calendar UI to allow user view or edit events. On Android, these methods start the system calendar app using an Intent. On iOS, they present either EKEventViewController or EKEventEditViewController as a modal.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Configuration in app config
You can configure expo-calendar using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.
Example app.json with config plugin
Configurable properties
Are you using this library in an existing React Native app?
If you're not using Continuous Native Generation (CNG) (you're using native android and ios projects manually), then you need to configure following permissions in your native projects:
-
For Android, add
android.permission.READ_CALENDARandandroid.permission.WRITE_CALENDARpermissions to your project's android/app/src/main/AndroidManifest.xml:<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" /> -
For iOS, add
NSCalendarsUsageDescriptionandNSRemindersUsageDescriptionto your project's ios/[app]/Info.plist:<key>NSCalendarsUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your calendar</string> <key>NSRemindersUsageDescription</key> <string>Allow $(PRODUCT_NAME) to access your reminders</string>
Usage
API
import * as Calendar from 'expo-calendar';
Launching system-provided calendar dialogs
Launches the calendar UI provided by the OS to create a new event.
Promise<DialogEventResult>A promise which resolves with information about the dialog result.
Launches the calendar UI provided by the OS to edit or delete an event. On Android, this is the same as openEventInCalendarAsync.
Promise<DialogEventResult>A promise which resolves with information about the dialog result.
Deprecated: Use
openEventInCalendarAsyncinstead.
Sends an intent to open the specified event in the OS Calendar app.
voidLaunches the calendar UI provided by the OS to preview an event.
Promise<OpenEventDialogResult>A promise which resolves with information about the dialog result.
Hooks
Check or request permissions to access the calendar.
This uses both getCalendarPermissionsAsync and requestCalendarPermissionsAsync to interact
with the permissions.
[PermissionResponse | null, RequestPermissionMethod<PermissionResponse>, GetPermissionMethod<PermissionResponse>]Example
const [status, requestPermission] = Calendar.useCalendarPermissions();
Check or request permissions to access reminders.
This uses both getRemindersPermissionsAsync and requestRemindersPermissionsAsync to interact
with the permissions.
[PermissionResponse | null, RequestPermissionMethod<PermissionResponse>, GetPermissionMethod<PermissionResponse>]Example
const [status, requestPermission] = Calendar.useRemindersPermissions();
Methods
Creates a new attendee record and adds it to the specified event. Note that if eventId specifies
a recurring event, this will add the attendee to every instance of the event.
Promise<string>A string representing the ID of the newly created attendee record.
Creates a new calendar on the device, allowing events to be added later and displayed in the OS Calendar app.
Promise<string>A string representing the ID of the newly created calendar.
Creates a new event on the specified calendar.
Promise<string>A promise which fulfils with a string representing the ID of the newly created event.
Creates a new reminder on the specified calendar.
Promise<string>A promise which fulfils with a string representing the ID of the newly created reminder.
Deletes an existing calendar and all associated events/reminders/attendees from the device. Use with caution.
Promise<void>Gets all attendees for a given event (or instance of a recurring event).
Promise<Attendee[]>A promise which fulfils with an array of Attendee associated with the
specified event.
Checks user's permissions for accessing user's calendars.
Promise<PermissionResponse>A promise that resolves to an object of type PermissionResponse.
Gets an array of calendar objects with details about the different calendars stored on the device.
Promise<Calendar[]>An array of calendar objects matching the provided entity type (if provided).
Returns a specific event selected by ID. If a specific instance of a recurring event is desired, the start date of this instance must also be provided, as instances of recurring events do not have their own unique and stable IDs on either iOS or Android.
A promise which fulfils with an Event object matching the provided criteria, if one exists.
Returns all events in a given set of calendars over a specified time period. The filtering has
slightly different behavior per-platform - on iOS, all events that overlap at all with the
[startDate, endDate] interval are returned, whereas on Android, only events that begin on or
after the startDate and end on or before the endDate will be returned.
A promise which fulfils with an array of Event objects matching the search criteria.
Returns a list of reminders matching the provided criteria. If startDate and endDate are defined,
returns all reminders that overlap at all with the [startDate, endDate] interval - i.e. all reminders
that end after the startDate or begin before the endDate.
Promise<Reminder[]>A promise which fulfils with an array of Reminder objects matching the search criteria.
Checks user's permissions for accessing user's reminders.
Promise<PermissionResponse>A promise that resolves to an object of type PermissionResponse.
Returns whether the Calendar API is enabled on the current device. This does not check the app permissions.
Promise<boolean>Async boolean, indicating whether the Calendar API is available on the current device.
Currently, this resolves true on iOS and Android only.
Asks the user to grant permissions for accessing user's calendars.
Promise<PermissionResponse>A promise that resolves to an object of type PermissionResponse.
Deprecated: Use
requestCalendarPermissionsAsync()instead.
Promise<PermissionResponse>Asks the user to grant permissions for accessing user's reminders.
Promise<PermissionResponse>A promise that resolves to an object of type PermissionResponse.
Updates an existing attendee record. To remove a property, explicitly set it to null in details.
Promise<string>Updates the provided details of an existing calendar stored on the device. To remove a property,
explicitly set it to null in details.
Promise<string>Updates the provided details of an existing calendar stored on the device. To remove a property,
explicitly set it to null in details.
Promise<string>Updates the provided details of an existing reminder stored on the device. To remove a property,
explicitly set it to null in details.
Promise<string>Types
A person or entity that is associated with an event by being invited or fulfilling some other role.
A calendar record upon which events (or, on iOS, reminders) can be stored. Settings here apply to the calendar as a whole and how its events are displayed in the OS calendar app.
The result of presenting a calendar dialog for creating or editing an event.
An event record, or a single instance of a recurring event. On iOS, used in the Calendar app.
The result of presenting the calendar dialog for opening (viewing) an event.
Literal type: union
Permission expiration time. Currently, all permissions are granted permanently.
Acceptable values are: 'never' | number
Literal type: union
Acceptable values are: PermissionHookBehavior | Options
A recurrence rule for events or reminders, allowing the same calendar item to recur multiple times. This type is based on the iOS interface which is in turn based on the iCal RFC so you can refer to those to learn more about this potentially complex interface.
Not all the combinations make sense. For example, when frequency is DAILY, setting daysOfTheMonth makes no sense.
Options for specifying a particular instance of a recurring event. This type is used in various methods that operate on recurring events, such as updating or deleting a single occurrence or a set of future occurrences.
A source account that owns a particular calendar. Expo apps will typically not need to interact with Source objects.
Enums
Enum containing all possible user responses to the calendar UI dialogs. Depending on what dialog is presented, a subset of the values applies.
CalendarDialogResultActions.canceled = "canceled"The user canceled or dismissed the dialog.
CalendarDialogResultActions.done = "done"On Android, this is the only possible result because the OS doesn't provide enough information to determine the user's action - the user may have canceled the dialog, modified the event, or deleted it.
On iOS, this means the user simply closed the dialog.
CalendarDialogResultActions.responded = "responded"The user responded to and saved a pending event invitation.
Permissions
Android
If you only intend to use the system-provided calendar UI, you don't need to request any permissions.
Otherwise, you must add the following permissions to your app.json inside the expo.android.permissions array.
iOS
If you only intend to create events using system-provided calendar UI with createEventInCalendarAsync, you don't need to request permissions.
The following usage description keys are used by this library: