expo-calendar 57.0.2 → 57.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/calendar/domain/event/records/input/EventInputBase.kt +2 -1
- package/build/Calendar.d.ts +14 -6
- package/build/Calendar.d.ts.map +1 -1
- package/build/Calendar.js +14 -6
- package/build/Calendar.js.map +1 -1
- package/build/ExpoCalendar.types.d.ts +4 -0
- package/build/ExpoCalendar.types.d.ts.map +1 -1
- package/build/ExpoCalendar.types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Next/CalendarAccessGuard.swift +7 -7
- package/ios/Next/CalendarNextModule.swift +36 -26
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{57.0.2/expo.modules.calendar-57.0.2-sources.jar → 57.0.4/expo.modules.calendar-57.0.4-sources.jar} +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{57.0.2/expo.modules.calendar-57.0.2.module → 57.0.4/expo.modules.calendar-57.0.4.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{57.0.2/expo.modules.calendar-57.0.2.pom → 57.0.4/expo.modules.calendar-57.0.4.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.4/expo.modules.calendar-57.0.4.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/spm.config.json +1 -1
- package/src/Calendar.ts +14 -6
- package/src/ExpoCalendar.types.ts +4 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.calendar/57.0.2/expo.modules.calendar-57.0.2.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 57.0.4 — 2026-09-16
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- [iOS] Allow `getDefaultCalendarSync`, `getCalendars` and `ExpoCalendar.get` to work with write-only calendar access. ([#48186](https://github.com/expo/expo/pull/48186) by [@Wenszel](https://github.com/Wenszel))
|
|
18
|
+
|
|
19
|
+
## 57.0.3 — 2026-09-08
|
|
20
|
+
|
|
21
|
+
### 🐛 Bug fixes
|
|
22
|
+
|
|
23
|
+
- [android] Fix `createEventAsync` and `updateEventAsync` failing with "Event could not be saved" in minified release builds. `EventInputBase` now implements `Record`, so the `expo-modules-core` ProGuard rule keeps its `@Field` property names and `startDate`/`endDate` reach the calendar provider. ([#49837](https://github.com/expo/expo/pull/49837) by [@expo-bot](https://github.com/expo-bot))
|
|
24
|
+
|
|
13
25
|
## 57.0.2 — 2026-08-14
|
|
14
26
|
|
|
15
27
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
package/android/src/main/java/expo/modules/calendar/domain/event/records/input/EventInputBase.kt
CHANGED
|
@@ -8,9 +8,10 @@ import expo.modules.calendar.domain.event.records.Alarm
|
|
|
8
8
|
import expo.modules.calendar.extensions.DateTimeInput
|
|
9
9
|
import expo.modules.calendar.extensions.getTimeInMillis
|
|
10
10
|
import expo.modules.kotlin.records.Field
|
|
11
|
+
import expo.modules.kotlin.records.Record
|
|
11
12
|
import java.util.TimeZone
|
|
12
13
|
|
|
13
|
-
abstract class EventInputBase {
|
|
14
|
+
abstract class EventInputBase : Record {
|
|
14
15
|
@Field val alarms: List<Alarm>? = null
|
|
15
16
|
|
|
16
17
|
@Field val availability: Availability? = null
|
package/build/Calendar.d.ts
CHANGED
|
@@ -46,6 +46,10 @@ export declare class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {
|
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Gets an instance of the default calendar object.
|
|
49
|
+
*
|
|
50
|
+
* > **iOS 17+:** With write-only calendar access, this returns EventKit's virtual calendar,
|
|
51
|
+
* > which can be used to create events but does not expose existing calendar data.
|
|
52
|
+
*
|
|
49
53
|
* > **Android:** This function is not available on Android. Android does not expose a single
|
|
50
54
|
* > system-managed default calendar. Use `getCalendars()` and choose an appropriate writable
|
|
51
55
|
* > calendar for your app; `isPrimary` can help identify per-account primary calendars.
|
|
@@ -54,12 +58,16 @@ export declare class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {
|
|
|
54
58
|
*/
|
|
55
59
|
export declare function getDefaultCalendarSync(): ExpoCalendar;
|
|
56
60
|
/**
|
|
57
|
-
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* >
|
|
62
|
-
*
|
|
61
|
+
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
62
|
+
* calendars available to the app.
|
|
63
|
+
*
|
|
64
|
+
* > **iOS 17+:** With write-only calendar access, requesting `EntityTypes.EVENT` returns a
|
|
65
|
+
* > single virtual calendar, which can be used to create events but does not expose the user's
|
|
66
|
+
* > real calendars.
|
|
67
|
+
*
|
|
68
|
+
* @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to a specific [entity type](#entitytypes).
|
|
69
|
+
* > **Note:** If not defined, both calendar (write-only is enough) and reminders permissions are required.
|
|
70
|
+
* @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type, if provided.
|
|
63
71
|
*/
|
|
64
72
|
export declare function getCalendars(entityType?: EntityTypes): Promise<ExpoCalendar[]>;
|
|
65
73
|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A,MAAM,6BAA6B,4JAGjC,CAAC;AAEH,cAAc,kBAAkB,CAAC"}
|
package/build/Calendar.js
CHANGED
|
@@ -147,6 +147,10 @@ export class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {
|
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Gets an instance of the default calendar object.
|
|
150
|
+
*
|
|
151
|
+
* > **iOS 17+:** With write-only calendar access, this returns EventKit's virtual calendar,
|
|
152
|
+
* > which can be used to create events but does not expose existing calendar data.
|
|
153
|
+
*
|
|
150
154
|
* > **Android:** This function is not available on Android. Android does not expose a single
|
|
151
155
|
* > system-managed default calendar. Use `getCalendars()` and choose an appropriate writable
|
|
152
156
|
* > calendar for your app; `isPrimary` can help identify per-account primary calendars.
|
|
@@ -162,12 +166,16 @@ export function getDefaultCalendarSync() {
|
|
|
162
166
|
return defaultCalendar;
|
|
163
167
|
}
|
|
164
168
|
/**
|
|
165
|
-
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* >
|
|
170
|
-
*
|
|
169
|
+
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
170
|
+
* calendars available to the app.
|
|
171
|
+
*
|
|
172
|
+
* > **iOS 17+:** With write-only calendar access, requesting `EntityTypes.EVENT` returns a
|
|
173
|
+
* > single virtual calendar, which can be used to create events but does not expose the user's
|
|
174
|
+
* > real calendars.
|
|
175
|
+
*
|
|
176
|
+
* @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to a specific [entity type](#entitytypes).
|
|
177
|
+
* > **Note:** If not defined, both calendar (write-only is enough) and reminders permissions are required.
|
|
178
|
+
* @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type, if provided.
|
|
171
179
|
*/
|
|
172
180
|
export async function getCalendars(entityType) {
|
|
173
181
|
if (!InternalExpoCalendar.getCalendars) {
|
package/build/Calendar.js.map
CHANGED
|
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0BAA0B,CAAC,OAAO,EAAE,SAAS,CAAC;CAC3E,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,mGAAmG;QACnG,sHAAsH;QACtH,MAAM,QAAQ,GAAuB;YACnC,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,gBAAgB,CAAC,MAAM;SAChC,CAAC;QACF,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;IACzD,SAAS,EAAE,uBAAuB;IAClC,aAAa,EAAE,2BAA2B;CAC3C,CAAC,CAAC;AAEH,cAAc,kBAAkB,CAAC","sourcesContent":["import { createPermissionHook, PermissionStatus, type PermissionHookOptions } from 'expo';\nimport { UnavailabilityError } from 'expo-modules-core';\nimport { Platform, processColor } from 'react-native';\n\nimport InternalExpoCalendar from './ExpoCalendar';\nimport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n ModifiableAttendeeProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\nimport type {\n Calendar,\n Attendee,\n DialogEventResult,\n EntityTypes,\n Event,\n RecurringEventOptions,\n Reminder,\n ReminderStatus,\n PermissionResponse,\n Source,\n} from './legacy/Calendar';\nimport { stringifyDateValues, stringifyIfDate, getNullableDetailsFields } from './utils';\n\n/**\n * Represents a calendar attendee object.\n */\nexport class ExpoCalendarAttendee extends InternalExpoCalendar.ExpoCalendarAttendee {\n override async update(details: Partial<ModifiableAttendeeProperties>): Promise<void> {\n if (!super.update) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n return super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (!super.delete) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'delete');\n }\n await super.delete();\n }\n}\n\n/**\n * Represents a calendar event object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarEvent extends InternalExpoCalendar.ExpoCalendarEvent {\n override getOccurrenceSync(recurringEventOptions: RecurringEventOptions = {}): ExpoCalendarEvent {\n const result = super.getOccurrenceSync(stringifyDateValues(recurringEventOptions));\n Object.setPrototypeOf(result, ExpoCalendarEvent.prototype);\n return result;\n }\n\n override async getAttendees(): Promise<ExpoCalendarAttendee[]> {\n const attendees = await super.getAttendees();\n return attendees.map((attendee) => {\n Object.setPrototypeOf(attendee, ExpoCalendarAttendee.prototype);\n return attendee;\n });\n }\n\n override async createAttendee(attendee: Attendee): Promise<ExpoCalendarAttendee> {\n if (!super.createAttendee) {\n throw new UnavailabilityError('ExpoCalendarEvent', 'createAttendee');\n }\n const newAttendee = await super.createAttendee(attendee);\n Object.setPrototypeOf(newAttendee, ExpoCalendarAttendee.prototype);\n return newAttendee;\n }\n\n override async update(details: Partial<ModifiableEventProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n return await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n await super.delete();\n }\n\n static override async get(eventId: string): Promise<ExpoCalendarEvent> {\n const event = await InternalExpoCalendar.getEventById(eventId);\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n }\n}\n\n/**\n * Represents a calendar reminder object that can be accessed and modified using the Expo Calendar Next API.\n * @platform ios\n */\nexport class ExpoCalendarReminder extends InternalExpoCalendar.ExpoCalendarReminder {\n override async update(details: Partial<ModifiableReminderProperties>): Promise<void> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'delete');\n }\n await super.delete();\n }\n\n static override async get(reminderId: string): Promise<ExpoCalendarReminder> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'get');\n }\n const reminder = await InternalExpoCalendar.getReminderById(reminderId);\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n }\n}\n\n/**\n * Represents a calendar object that can be accessed and modified using the Expo Calendar Next API.\n *\n * This class provides properties and methods for interacting with a specific calendar on the device,\n * such as retrieving its events, updating its details, and accessing its metadata.\n */\nexport class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {\n override async createEvent(\n details: Partial<\n Omit<\n Event,\n | 'creationDate'\n | 'lastModifiedDate'\n | 'originalStartDate'\n | 'isDetached'\n | 'status'\n | 'organizer'\n >\n >\n ): Promise<ExpoCalendarEvent> {\n const newEvent = await super.createEvent(stringifyDateValues(details));\n Object.setPrototypeOf(newEvent, ExpoCalendarEvent.prototype);\n return newEvent;\n }\n\n override async createReminder(details: Partial<Reminder>): Promise<ExpoCalendarReminder> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendar', 'createReminder');\n }\n const newReminder = await super.createReminder(stringifyDateValues(details));\n Object.setPrototypeOf(newReminder, ExpoCalendarReminder.prototype);\n return newReminder;\n }\n\n override async listEvents(startDate: Date, endDate: Date): Promise<ExpoCalendarEvent[]> {\n if (!startDate) {\n throw new Error('listEvents must be called with a startDate (date) to search for events');\n }\n if (!endDate) {\n throw new Error('listEvents must be called with an endDate (date) to search for events');\n }\n const events = await super.listEvents(stringifyIfDate(startDate), stringifyIfDate(endDate));\n return events.map((event) => {\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n });\n }\n\n override async listReminders(\n startDate: Date | null = null,\n endDate: Date | null = null,\n status: ReminderStatus | null = null\n ): Promise<ExpoCalendarReminder[]> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendar', 'listReminders');\n }\n const reminders = await super.listReminders(\n startDate ? stringifyIfDate(startDate) : null,\n endDate ? stringifyIfDate(endDate) : null,\n status\n );\n return reminders.map((reminder) => {\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n });\n }\n\n override async update(details: Partial<ModifiableCalendarProperties>): Promise<void> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, color: color || undefined };\n return await super.update(newDetails as Partial<ModifiableCalendarProperties>);\n }\n\n override async addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult> {\n if (!super.addEventWithForm) {\n throw new UnavailabilityError('ExpoCalendar', 'addEventWithForm');\n }\n return super.addEventWithForm(options && stringifyDateValues(options));\n }\n\n static override async get(calendarId: string): Promise<ExpoCalendar> {\n const calendar = await InternalExpoCalendar.getCalendarById(calendarId);\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n }\n}\n\n/**\n * Gets an instance of the default calendar object.\n * > **Android:** This function is not available on Android. Android does not expose a single\n * > system-managed default calendar. Use `getCalendars()` and choose an appropriate writable\n * > calendar for your app; `isPrimary` can help identify per-account primary calendars.\n * @return An [`ExpoCalendar`](#expocalendar) object that is the user's default calendar.\n * @platform ios\n */\nexport function getDefaultCalendarSync(): ExpoCalendar {\n if (Platform.OS === 'android' || !InternalExpoCalendar.getDefaultCalendarSync) {\n throw new UnavailabilityError('Calendar', 'getDefaultCalendar');\n }\n const defaultCalendar = InternalExpoCalendar.getDefaultCalendarSync();\n Object.setPrototypeOf(defaultCalendar, ExpoCalendar.prototype);\n return defaultCalendar as ExpoCalendar;\n}\n\n/**\n * Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the different calendars stored on the device.\n * @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to\n * a specific [entity type](#entitytypes). Possible values are `Calendar.EntityTypes.EVENT` (for calendars shown in\n * the Calendar app) and `Calendar.EntityTypes.REMINDER` (for the Reminders app).\n * > **Note:** If not defined, you will need both permissions: **CALENDAR** and **REMINDERS**.\n * @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type (if provided).\n */\nexport async function getCalendars(entityType?: EntityTypes): Promise<ExpoCalendar[]> {\n if (!InternalExpoCalendar.getCalendars) {\n throw new UnavailabilityError('Calendar', 'getCalendars');\n }\n const calendars = await InternalExpoCalendar.getCalendars(entityType);\n return calendars.map((calendar) => {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n });\n}\n\n/**\n * Creates a new calendar on the device, allowing events to be added later and displayed in the OS Calendar app.\n * @param details A map of details for the calendar to be created.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the newly created calendar.\n */\nexport async function createCalendar(details: Partial<Calendar> = {}): Promise<ExpoCalendar> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, id: undefined, color: color || undefined };\n const createdCalendar = await InternalExpoCalendar.createCalendar(newDetails);\n Object.setPrototypeOf(createdCalendar, ExpoCalendar.prototype);\n return createdCalendar;\n}\n\n/**\n * Presents the OS calendar picker and returns the selected calendar.\n * @return An [`ExpoCalendar`](#expocalendar) object or `null` when the picker is cancelled.\n * @platform ios\n */\nexport async function presentPicker(): Promise<ExpoCalendar | null> {\n if (!InternalExpoCalendar.presentPicker) {\n throw new UnavailabilityError('Calendar', 'presentPicker');\n }\n const calendar = await InternalExpoCalendar.presentPicker();\n if (calendar) {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n }\n return calendar;\n}\n\n/**\n * Lists events from the device's calendar. It can be used to search events in multiple calendars.\n * > **Note:** If you want to search events in a single calendar, you can use [`ExpoCalendar.listEvents`](#listeventsstartdate-enddate) instead.\n * @param calendars An array of calendar IDs (`string[]`) or [`ExpoCalendar`](#expocalendar) objects to search for events.\n * @param startDate The start date of the time range to search for events.\n * @param endDate The end date of the time range to search for events.\n * @returns An array of [`ExpoCalendarEvent`](#expocalendarevent) objects representing the events found.\n */\nexport async function listEvents(\n calendars: (string | ExpoCalendar)[],\n startDate: Date,\n endDate: Date\n): Promise<ExpoCalendarEvent[]> {\n if (!InternalExpoCalendar.listEvents) {\n throw new UnavailabilityError('Calendar', 'listEvents');\n }\n const calendarIds = Array.isArray(calendars)\n ? calendars.map((c) => (typeof c === 'string' ? c : c.id))\n : [];\n return InternalExpoCalendar.listEvents(\n calendarIds,\n stringifyIfDate(startDate),\n stringifyIfDate(endDate)\n );\n}\n\n/**\n * Asks the user to grant permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to request write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestCalendarPermissions = InternalExpoCalendar.requestCalendarPermissions;\n\n/**\n * Checks user's permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to check write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getCalendarPermissions = InternalExpoCalendar.getCalendarPermissions;\n\n/**\n * Asks the user to grant permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n * @platform ios\n */\nexport async function requestRemindersPermissions(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'requestRemindersPermissions');\n }\n return InternalExpoCalendar.requestRemindersPermissions!();\n}\n\n/**\n * Checks user's permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n * @platform ios\n */\nexport async function getRemindersPermissions(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'getRemindersPermissions');\n }\n return InternalExpoCalendar.getRemindersPermissions!();\n}\n\n/**\n * Gets an array of Source objects with details about the different sources stored on the device.\n * > **Android:** This function is not available on Android. Android does not expose a\n * > first-class calendar sources API. If you need account-like source information, call\n * > `getCalendars()` and inspect each calendar's `source` field.\n * @returns An array of Source objects representing the sources found.\n * @platform ios\n */\nexport function getSourcesSync(): Source[] {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'getSourcesSync');\n }\n return InternalExpoCalendar.getSourcesSync();\n}\n\nexport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\nexport type {\n PermissionResponse,\n Alarm,\n AlarmLocation,\n CalendarDialogParams,\n DaysOfTheWeek,\n DialogEventResult,\n OpenEventDialogResult,\n OpenEventPresentationOptions,\n PermissionExpiration,\n PermissionHookOptions,\n PresentationOptions,\n RecurrenceRule,\n RecurringEventOptions,\n Source,\n} from './legacy/Calendar';\nexport {\n AlarmMethod,\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Availability,\n CalendarAccessLevel,\n CalendarDialogResultActions,\n CalendarType,\n DayOfTheWeek,\n EntityTypes,\n EventAccessLevel,\n EventStatus,\n Frequency,\n MonthOfTheYear,\n ReminderStatus,\n SourceType,\n} from './legacy/Calendar';\n\n/**\n * Check or request permissions to access the user's calendars.\n * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact\n * with the permissions.\n * On iOS, `writeOnly` requests permission to create calendar events without reading\n * existing calendars or events. It does not grant permission to create, update, or delete calendars.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useCalendarPermissions();\n * ```\n */\nexport const useCalendarPermissions = createPermissionHook<\n PermissionResponse,\n { writeOnly?: boolean }\n>({\n getMethod: (options) => getCalendarPermissions(options?.writeOnly),\n requestMethod: (options) => requestCalendarPermissions(options?.writeOnly),\n});\n\n/**\n * Check or request permissions to access the user's reminders.\n * This uses both `getRemindersPermissions` and `requestRemindersPermissions` to interact\n * with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useRemindersPermissions();\n * ```\n * @platform ios\n */\nexport function useRemindersPermissions(\n options?: PermissionHookOptions<object>\n): ReturnType<typeof createRemindersPermissionHook> {\n if (Platform.OS !== 'ios') {\n // While for getRemindersPermissions and other iOS-specific functions we throw UnavailabilityError,\n // returning a denied permission response is a deliberate choice to make it work without need to wrap it in try/catch.\n const response: PermissionResponse = {\n canAskAgain: false,\n expires: 'never',\n granted: false,\n status: PermissionStatus.DENIED,\n };\n return [response, async () => response, async () => response];\n }\n return createRemindersPermissionHook(options);\n}\n\nconst createRemindersPermissionHook = createPermissionHook({\n getMethod: getRemindersPermissions,\n requestMethod: requestRemindersPermissions,\n});\n\nexport * from './legacyWarnings';\n"]}
|
|
1
|
+
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../src/Calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAA8B,MAAM,MAAM,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,oBAAoB,MAAM,gBAAgB,CAAC;AAoBlD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEzF;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,oBAAoB,CAAC,oBAAoB;IACxE,KAAK,CAAC,MAAM,CAAC,OAA8C;QAClE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,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BAAoB,CAAC,cAAc,EAAE,CAAC;AAC/C,CAAC;AAyBD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,GACX,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAGxD;IACA,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC;IAClE,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,0BAA0B,CAAC,OAAO,EAAE,SAAS,CAAC;CAC3E,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAuC;IAEvC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,mGAAmG;QACnG,sHAAsH;QACtH,MAAM,QAAQ,GAAuB;YACnC,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,gBAAgB,CAAC,MAAM;SAChC,CAAC;QACF,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;IACzD,SAAS,EAAE,uBAAuB;IAClC,aAAa,EAAE,2BAA2B;CAC3C,CAAC,CAAC;AAEH,cAAc,kBAAkB,CAAC","sourcesContent":["import { createPermissionHook, PermissionStatus, type PermissionHookOptions } from 'expo';\nimport { UnavailabilityError } from 'expo-modules-core';\nimport { Platform, processColor } from 'react-native';\n\nimport InternalExpoCalendar from './ExpoCalendar';\nimport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n ModifiableAttendeeProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\nimport type {\n Calendar,\n Attendee,\n DialogEventResult,\n EntityTypes,\n Event,\n RecurringEventOptions,\n Reminder,\n ReminderStatus,\n PermissionResponse,\n Source,\n} from './legacy/Calendar';\nimport { stringifyDateValues, stringifyIfDate, getNullableDetailsFields } from './utils';\n\n/**\n * Represents a calendar attendee object.\n */\nexport class ExpoCalendarAttendee extends InternalExpoCalendar.ExpoCalendarAttendee {\n override async update(details: Partial<ModifiableAttendeeProperties>): Promise<void> {\n if (!super.update) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n return super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (!super.delete) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'delete');\n }\n await super.delete();\n }\n}\n\n/**\n * Represents a calendar event object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarEvent extends InternalExpoCalendar.ExpoCalendarEvent {\n override getOccurrenceSync(recurringEventOptions: RecurringEventOptions = {}): ExpoCalendarEvent {\n const result = super.getOccurrenceSync(stringifyDateValues(recurringEventOptions));\n Object.setPrototypeOf(result, ExpoCalendarEvent.prototype);\n return result;\n }\n\n override async getAttendees(): Promise<ExpoCalendarAttendee[]> {\n const attendees = await super.getAttendees();\n return attendees.map((attendee) => {\n Object.setPrototypeOf(attendee, ExpoCalendarAttendee.prototype);\n return attendee;\n });\n }\n\n override async createAttendee(attendee: Attendee): Promise<ExpoCalendarAttendee> {\n if (!super.createAttendee) {\n throw new UnavailabilityError('ExpoCalendarEvent', 'createAttendee');\n }\n const newAttendee = await super.createAttendee(attendee);\n Object.setPrototypeOf(newAttendee, ExpoCalendarAttendee.prototype);\n return newAttendee;\n }\n\n override async update(details: Partial<ModifiableEventProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n return await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n await super.delete();\n }\n\n static override async get(eventId: string): Promise<ExpoCalendarEvent> {\n const event = await InternalExpoCalendar.getEventById(eventId);\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n }\n}\n\n/**\n * Represents a calendar reminder object that can be accessed and modified using the Expo Calendar Next API.\n * @platform ios\n */\nexport class ExpoCalendarReminder extends InternalExpoCalendar.ExpoCalendarReminder {\n override async update(details: Partial<ModifiableReminderProperties>): Promise<void> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'delete');\n }\n await super.delete();\n }\n\n static override async get(reminderId: string): Promise<ExpoCalendarReminder> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendarReminder', 'get');\n }\n const reminder = await InternalExpoCalendar.getReminderById(reminderId);\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n }\n}\n\n/**\n * Represents a calendar object that can be accessed and modified using the Expo Calendar Next API.\n *\n * This class provides properties and methods for interacting with a specific calendar on the device,\n * such as retrieving its events, updating its details, and accessing its metadata.\n */\nexport class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {\n override async createEvent(\n details: Partial<\n Omit<\n Event,\n | 'creationDate'\n | 'lastModifiedDate'\n | 'originalStartDate'\n | 'isDetached'\n | 'status'\n | 'organizer'\n >\n >\n ): Promise<ExpoCalendarEvent> {\n const newEvent = await super.createEvent(stringifyDateValues(details));\n Object.setPrototypeOf(newEvent, ExpoCalendarEvent.prototype);\n return newEvent;\n }\n\n override async createReminder(details: Partial<Reminder>): Promise<ExpoCalendarReminder> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendar', 'createReminder');\n }\n const newReminder = await super.createReminder(stringifyDateValues(details));\n Object.setPrototypeOf(newReminder, ExpoCalendarReminder.prototype);\n return newReminder;\n }\n\n override async listEvents(startDate: Date, endDate: Date): Promise<ExpoCalendarEvent[]> {\n if (!startDate) {\n throw new Error('listEvents must be called with a startDate (date) to search for events');\n }\n if (!endDate) {\n throw new Error('listEvents must be called with an endDate (date) to search for events');\n }\n const events = await super.listEvents(stringifyIfDate(startDate), stringifyIfDate(endDate));\n return events.map((event) => {\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n });\n }\n\n override async listReminders(\n startDate: Date | null = null,\n endDate: Date | null = null,\n status: ReminderStatus | null = null\n ): Promise<ExpoCalendarReminder[]> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('ExpoCalendar', 'listReminders');\n }\n const reminders = await super.listReminders(\n startDate ? stringifyIfDate(startDate) : null,\n endDate ? stringifyIfDate(endDate) : null,\n status\n );\n return reminders.map((reminder) => {\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n });\n }\n\n override async update(details: Partial<ModifiableCalendarProperties>): Promise<void> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, color: color || undefined };\n return await super.update(newDetails as Partial<ModifiableCalendarProperties>);\n }\n\n override async addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult> {\n if (!super.addEventWithForm) {\n throw new UnavailabilityError('ExpoCalendar', 'addEventWithForm');\n }\n return super.addEventWithForm(options && stringifyDateValues(options));\n }\n\n static override async get(calendarId: string): Promise<ExpoCalendar> {\n const calendar = await InternalExpoCalendar.getCalendarById(calendarId);\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n }\n}\n\n/**\n * Gets an instance of the default calendar object.\n *\n * > **iOS 17+:** With write-only calendar access, this returns EventKit's virtual calendar,\n * > which can be used to create events but does not expose existing calendar data.\n *\n * > **Android:** This function is not available on Android. Android does not expose a single\n * > system-managed default calendar. Use `getCalendars()` and choose an appropriate writable\n * > calendar for your app; `isPrimary` can help identify per-account primary calendars.\n * @return An [`ExpoCalendar`](#expocalendar) object that is the user's default calendar.\n * @platform ios\n */\nexport function getDefaultCalendarSync(): ExpoCalendar {\n if (Platform.OS === 'android' || !InternalExpoCalendar.getDefaultCalendarSync) {\n throw new UnavailabilityError('Calendar', 'getDefaultCalendar');\n }\n const defaultCalendar = InternalExpoCalendar.getDefaultCalendarSync();\n Object.setPrototypeOf(defaultCalendar, ExpoCalendar.prototype);\n return defaultCalendar as ExpoCalendar;\n}\n\n/**\n * Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the\n * calendars available to the app.\n *\n * > **iOS 17+:** With write-only calendar access, requesting `EntityTypes.EVENT` returns a\n * > single virtual calendar, which can be used to create events but does not expose the user's\n * > real calendars.\n *\n * @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to a specific [entity type](#entitytypes).\n * > **Note:** If not defined, both calendar (write-only is enough) and reminders permissions are required.\n * @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type, if provided.\n */\nexport async function getCalendars(entityType?: EntityTypes): Promise<ExpoCalendar[]> {\n if (!InternalExpoCalendar.getCalendars) {\n throw new UnavailabilityError('Calendar', 'getCalendars');\n }\n const calendars = await InternalExpoCalendar.getCalendars(entityType);\n return calendars.map((calendar) => {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n });\n}\n\n/**\n * Creates a new calendar on the device, allowing events to be added later and displayed in the OS Calendar app.\n * @param details A map of details for the calendar to be created.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the newly created calendar.\n */\nexport async function createCalendar(details: Partial<Calendar> = {}): Promise<ExpoCalendar> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, id: undefined, color: color || undefined };\n const createdCalendar = await InternalExpoCalendar.createCalendar(newDetails);\n Object.setPrototypeOf(createdCalendar, ExpoCalendar.prototype);\n return createdCalendar;\n}\n\n/**\n * Presents the OS calendar picker and returns the selected calendar.\n * @return An [`ExpoCalendar`](#expocalendar) object or `null` when the picker is cancelled.\n * @platform ios\n */\nexport async function presentPicker(): Promise<ExpoCalendar | null> {\n if (!InternalExpoCalendar.presentPicker) {\n throw new UnavailabilityError('Calendar', 'presentPicker');\n }\n const calendar = await InternalExpoCalendar.presentPicker();\n if (calendar) {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n }\n return calendar;\n}\n\n/**\n * Lists events from the device's calendar. It can be used to search events in multiple calendars.\n * > **Note:** If you want to search events in a single calendar, you can use [`ExpoCalendar.listEvents`](#listeventsstartdate-enddate) instead.\n * @param calendars An array of calendar IDs (`string[]`) or [`ExpoCalendar`](#expocalendar) objects to search for events.\n * @param startDate The start date of the time range to search for events.\n * @param endDate The end date of the time range to search for events.\n * @returns An array of [`ExpoCalendarEvent`](#expocalendarevent) objects representing the events found.\n */\nexport async function listEvents(\n calendars: (string | ExpoCalendar)[],\n startDate: Date,\n endDate: Date\n): Promise<ExpoCalendarEvent[]> {\n if (!InternalExpoCalendar.listEvents) {\n throw new UnavailabilityError('Calendar', 'listEvents');\n }\n const calendarIds = Array.isArray(calendars)\n ? calendars.map((c) => (typeof c === 'string' ? c : c.id))\n : [];\n return InternalExpoCalendar.listEvents(\n calendarIds,\n stringifyIfDate(startDate),\n stringifyIfDate(endDate)\n );\n}\n\n/**\n * Asks the user to grant permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to request write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestCalendarPermissions = InternalExpoCalendar.requestCalendarPermissions;\n\n/**\n * Checks user's permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to check write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getCalendarPermissions = InternalExpoCalendar.getCalendarPermissions;\n\n/**\n * Asks the user to grant permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n * @platform ios\n */\nexport async function requestRemindersPermissions(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'requestRemindersPermissions');\n }\n return InternalExpoCalendar.requestRemindersPermissions!();\n}\n\n/**\n * Checks user's permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n * @platform ios\n */\nexport async function getRemindersPermissions(): Promise<PermissionResponse> {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'getRemindersPermissions');\n }\n return InternalExpoCalendar.getRemindersPermissions!();\n}\n\n/**\n * Gets an array of Source objects with details about the different sources stored on the device.\n * > **Android:** This function is not available on Android. Android does not expose a\n * > first-class calendar sources API. If you need account-like source information, call\n * > `getCalendars()` and inspect each calendar's `source` field.\n * @returns An array of Source objects representing the sources found.\n * @platform ios\n */\nexport function getSourcesSync(): Source[] {\n if (Platform.OS !== 'ios') {\n throw new UnavailabilityError('Calendar', 'getSourcesSync');\n }\n return InternalExpoCalendar.getSourcesSync();\n}\n\nexport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\nexport type {\n PermissionResponse,\n Alarm,\n AlarmLocation,\n CalendarDialogParams,\n DaysOfTheWeek,\n DialogEventResult,\n OpenEventDialogResult,\n OpenEventPresentationOptions,\n PermissionExpiration,\n PermissionHookOptions,\n PresentationOptions,\n RecurrenceRule,\n RecurringEventOptions,\n Source,\n} from './legacy/Calendar';\nexport {\n AlarmMethod,\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Availability,\n CalendarAccessLevel,\n CalendarDialogResultActions,\n CalendarType,\n DayOfTheWeek,\n EntityTypes,\n EventAccessLevel,\n EventStatus,\n Frequency,\n MonthOfTheYear,\n ReminderStatus,\n SourceType,\n} from './legacy/Calendar';\n\n/**\n * Check or request permissions to access the user's calendars.\n * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact\n * with the permissions.\n * On iOS, `writeOnly` requests permission to create calendar events without reading\n * existing calendars or events. It does not grant permission to create, update, or delete calendars.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useCalendarPermissions();\n * ```\n */\nexport const useCalendarPermissions = createPermissionHook<\n PermissionResponse,\n { writeOnly?: boolean }\n>({\n getMethod: (options) => getCalendarPermissions(options?.writeOnly),\n requestMethod: (options) => requestCalendarPermissions(options?.writeOnly),\n});\n\n/**\n * Check or request permissions to access the user's reminders.\n * This uses both `getRemindersPermissions` and `requestRemindersPermissions` to interact\n * with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useRemindersPermissions();\n * ```\n * @platform ios\n */\nexport function useRemindersPermissions(\n options?: PermissionHookOptions<object>\n): ReturnType<typeof createRemindersPermissionHook> {\n if (Platform.OS !== 'ios') {\n // While for getRemindersPermissions and other iOS-specific functions we throw UnavailabilityError,\n // returning a denied permission response is a deliberate choice to make it work without need to wrap it in try/catch.\n const response: PermissionResponse = {\n canAskAgain: false,\n expires: 'never',\n granted: false,\n status: PermissionStatus.DENIED,\n };\n return [response, async () => response, async () => response];\n }\n return createRemindersPermissionHook(options);\n}\n\nconst createRemindersPermissionHook = createPermissionHook({\n getMethod: getRemindersPermissions,\n requestMethod: requestRemindersPermissions,\n});\n\nexport * from './legacyWarnings';\n"]}
|
|
@@ -156,6 +156,10 @@ export declare class ExpoCalendar {
|
|
|
156
156
|
delete(): Promise<void>;
|
|
157
157
|
/**
|
|
158
158
|
* Gets a calendar by its ID. Throws an error if the calendar with the given ID does not exist.
|
|
159
|
+
*
|
|
160
|
+
* > **iOS 17+:** With write-only calendar access, only the virtual calendar's ID can be
|
|
161
|
+
* > resolved - real calendars require full calendar access.
|
|
162
|
+
*
|
|
159
163
|
* @param calendarId The ID of the calendar to get.
|
|
160
164
|
* @returns An [`ExpoCalendar`](#expocalendar) object representing the calendar.
|
|
161
165
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCalendar.types.d.ts","sourceRoot":"","sources":["../src/ExpoCalendar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,EACN,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,GAAG,mBAAmB,CAAC;AAE9F,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,GAAG,4BAA4B,CAAC;AAEnG,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,cAAc,CA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AAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,EAC9C,cAAc,CAAC,EAAE,CAAC,MAAM,4BAA4B,CAAC,EAAE,GACtD,OAAO,CAAC,IAAI,CAAC;IAEhB;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCalendar.types.js","sourceRoot":"","sources":["../src/ExpoCalendar.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Source,\n RecurringEventOptions,\n CalendarType,\n Availability,\n EntityTypes,\n Alarm,\n EventStatus,\n Organizer,\n ReminderStatus,\n CalendarDialogParams,\n DialogEventResult,\n OpenEventPresentationOptions,\n PresentationOptions,\n EventAccessLevel,\n CalendarAccessLevel,\n AlarmMethod,\n OpenEventDialogResult,\n Attendee,\n} from './legacy/Calendar';\nimport type { RecurrenceRule } from './types/RecurrenceRule';\n\nexport type CalendarDialogParamsNext = Omit<CalendarDialogParams, 'id'> & PresentationOptions;\n\nexport type CalendarDialogOpenParamsNext = CalendarDialogParamsNext & OpenEventPresentationOptions;\n\nexport type AddEventWithFormOptions = PresentationOptions & {\n title?: string;\n startDate?: Date | string;\n endDate?: Date | string;\n allDay?: boolean;\n notes?: string;\n location?: string;\n /**\n * @platform ios\n */\n url?: string;\n /**\n * @platform ios\n */\n alarms?: Alarm[];\n recurrenceRule?: RecurrenceRule;\n};\n\nexport type ModifiableCalendarProperties = Pick<ExpoCalendar, 'color' | 'title'>;\n\nexport type ModifiableEventProperties = Pick<\n ExpoCalendarEvent,\n | 'title'\n | 'location'\n | 'timeZone'\n | 'url'\n | 'notes'\n | 'alarms'\n | 'recurrenceRule'\n | 'availability'\n | 'startDate'\n | 'endDate'\n | 'allDay'\n>;\n\nexport type ModifiableReminderProperties = Pick<\n ExpoCalendarReminder,\n | 'title'\n | 'location'\n | 'timeZone'\n | 'url'\n | 'notes'\n | 'alarms'\n | 'recurrenceRule'\n | 'startDate'\n | 'dueDate'\n | 'completed'\n | 'completionDate'\n>;\n\nexport type ModifiableAttendeeProperties = ExpoCalendarAttendee;\n\nexport declare class ExpoCalendar {\n constructor(id: string);\n\n /**\n * Internal ID that represents this calendar on the device.\n */\n id: string;\n /**\n * Visible name of the calendar.\n */\n title: string;\n /**\n * ID of the source to be used for the calendar. Likely the same as the source for any other\n * locally stored calendars.\n * @platform ios\n */\n sourceId?: string;\n /**\n * Object representing the source to be used for the calendar.\n */\n source: Source;\n /**\n * Type of calendar this object represents.\n * @platform ios\n */\n type?: CalendarType;\n /**\n * Color used to display this calendar's events.\n */\n color?: string;\n /**\n * Whether the calendar is used in the Calendar or Reminders OS app.\n * @platform ios\n */\n entityType?: EntityTypes;\n /**\n * Boolean value that determines whether this calendar can be modified.\n */\n allowsModifications: boolean;\n /**\n * Availability types that this calendar supports.\n */\n allowedAvailabilities: Availability[];\n /**\n * Boolean value indicating whether this is the device's primary calendar.\n * @platform android\n */\n isPrimary?: boolean;\n /**\n * Internal system name of the calendar.\n * @platform android\n */\n name?: string | null;\n /**\n * Name for the account that owns this calendar.\n * @platform android\n */\n ownerAccount?: string;\n /**\n * Time zone for the calendar.\n * @platform android\n */\n timeZone?: string;\n /**\n * Alarm methods that this calendar supports.\n * @platform android\n */\n allowedReminders?: AlarmMethod[];\n /**\n * Attendee types that this calendar supports.\n * @platform android\n */\n allowedAttendeeTypes?: AttendeeType[];\n /**\n * Indicates whether the OS displays events on this calendar.\n * @platform android\n */\n isVisible?: boolean;\n /**\n * Indicates whether this calendar is synced and its events stored on the device.\n * Unexpected behavior may occur if this is not set to `true`.\n * @platform android\n */\n isSynced?: boolean;\n /**\n * Level of access that the user has for the calendar.\n * @platform android\n */\n accessLevel?: CalendarAccessLevel;\n\n /**\n * Returns a calendar event list for the given date range.\n */\n listEvents(startDate: Date | string, endDate: Date | string): Promise<ExpoCalendarEvent[]>;\n\n /**\n * Returns a list of reminders matching the provided criteria. If `startDate` and `endDate` are defined,\n * returns all reminders that overlap at all with the `[startDate, endDate]` interval, that is, all reminders\n * that end after the `startDate` or begin before the `endDate`.\n * @param startDate Beginning of time period to search for reminders in, or `null` for all completed reminders before `endDate`.\n * @param endDate End of time period to search for reminders in, or `null` for all completed reminders after `startDate`.\n * @param status One of `Calendar.ReminderStatus.COMPLETED` or `Calendar.ReminderStatus.INCOMPLETE`. If not defined, both completed and incomplete reminders will be returned.\n * @return An array of [`ExpoCalendarReminder`](#expocalendarreminder) objects matching the search criteria.\n * @platform ios\n */\n listReminders(\n startDate?: Date | string | null,\n endDate?: Date | string | null,\n status?: ReminderStatus | null\n ): Promise<ExpoCalendarReminder[]>;\n\n /**\n * Creates a new event in the calendar.\n * @param eventData A map of details for the event to be created.\n * @return An instance of the created event.\n */\n createEvent(\n eventData: Omit<Partial<ExpoCalendarEvent>, 'id' | 'organizer'>\n ): Promise<ExpoCalendarEvent>;\n\n /**\n * Creates a new reminder in the calendar.\n * @param reminderData A map of details for the reminder to be created.\n * @return An instance of the created reminder.\n * @platform ios\n */\n createReminder(\n reminderData: Omit<Partial<ExpoCalendarReminder>, 'id' | 'calendarId'>\n ): Promise<ExpoCalendarReminder>;\n\n /**\n * Presents the system-provided dialog to create a new event in this calendar, pre-filled with the provided data.\n * Requires at minimum write-only calendar permission.\n */\n addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult>;\n\n /**\n * Updates the provided details of an existing calendar stored on the device. To remove a property,\n * explicitly set it to `null` in `details`.\n * @param details A map of properties to be updated.\n */\n update(details: Partial<ModifiableCalendarProperties>): Promise<void>;\n\n /**\n * Deletes the calendar.\n */\n delete(): Promise<void>;\n\n /**\n * Gets a calendar by its ID. Throws an error if the calendar with the given ID does not exist.\n * @param calendarId The ID of the calendar to get.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the calendar.\n */\n static get(calendarId: string): Promise<ExpoCalendar>;\n}\n\nexport declare class ExpoCalendarEvent {\n constructor(id: string);\n /**\n * Internal ID that represents this event on the device.\n */\n id: string;\n /**\n * ID of the calendar that contains this event.\n */\n calendarId: string;\n /**\n * Visible name of the event.\n */\n title: string;\n /**\n * Location field of the event.\n */\n location: string | null;\n /**\n * Date when the event record was created.\n * @platform ios\n */\n creationDate?: string | Date;\n /**\n * Date when the event record was last modified.\n * @platform ios\n */\n lastModifiedDate?: string | Date;\n /**\n * Time zone the event is scheduled in.\n * When set to `null`, the event is scheduled to the device's time zone.\n */\n timeZone: string;\n /**\n * Time zone for the end date of the event.\n * @platform android\n */\n endTimeZone?: string;\n /**\n * URL for the event.\n * @platform ios\n */\n url?: string;\n /**\n * Description or notes saved with the event.\n */\n notes: string;\n /**\n * Array of Alarm objects which control automated reminders to the user.\n */\n alarms: Alarm[];\n /**\n * Object representing rules for recurring or repeating events. Set to `null` for one-time events.\n * It is either `endDate` or `occurrence` based.\n */\n recurrenceRule: RecurrenceRule | null;\n /**\n * Date object or string representing the time when the event starts.\n */\n startDate: string | Date;\n /**\n * Date object or string representing the time when the event ends.\n */\n endDate: string | Date;\n /**\n * For recurring events, the start date for the first (original) instance of the event.\n * @platform ios\n */\n originalStartDate?: string | Date;\n /**\n * Boolean value indicating whether or not the event is a detached (modified) instance of a recurring event.\n * @platform ios\n */\n isDetached?: boolean;\n /**\n * Whether the event is displayed as an all-day event on the calendar\n */\n allDay: boolean;\n /**\n * The availability setting for the event.\n */\n availability: Availability;\n /**\n * Status of the event.\n */\n status: EventStatus;\n /**\n * Organizer of the event.\n * This property is only available on events associated with calendars that are managed by a service such as Google Calendar or iCloud.\n * The organizer is read-only and cannot be set.\n *\n * @platform ios\n */\n organizer?: Organizer;\n /**\n * Email address of the organizer of the event.\n * @platform android\n */\n organizerEmail?: string;\n /**\n * User's access level for the event.\n * @platform android\n */\n accessLevel?: EventAccessLevel;\n /**\n * Whether invited guests can modify the details of the event.\n * @platform android\n */\n guestsCanModify?: boolean;\n /**\n * Whether invited guests can invite other guests.\n * @platform android\n */\n guestsCanInviteOthers?: boolean;\n /**\n * Whether invited guests can see other guests.\n * @platform android\n */\n guestsCanSeeGuests?: boolean;\n /**\n * For detached (modified) instances of recurring events, the ID of the original recurring event.\n * @platform android\n */\n originalId?: string;\n /**\n * For instances of recurring events, volatile ID representing this instance. Not guaranteed to\n * always refer to the same instance.\n * @platform android\n */\n instanceId?: string;\n\n /**\n * Launches the calendar UI provided by the OS to preview an event.\n * @return A promise which resolves with information about the dialog result.\n * @header systemProvidedUI\n */\n openInCalendar(\n params?: CalendarDialogOpenParamsNext | null // TODO: Support skipping this param instead of passing null, change needed in the core\n ): Promise<OpenEventDialogResult>;\n\n /**\n * Launches the calendar UI provided by the OS to edit or delete an event.\n * @return A promise which resolves with information about the dialog result.\n * @header systemProvidedUI\n */\n editInCalendar(\n params?: CalendarDialogParamsNext | null // TODO: Support skipping this param instead of passing null, change needed in the core\n ): Promise<DialogEventResult>;\n\n /**\n * Returns an event instance for a given event (or instance of a recurring event).\n * @param recurringEventOptions A map of options for recurring events.\n * @return An event instance.\n */\n getOccurrenceSync(recurringEventOptions?: RecurringEventOptions): ExpoCalendarEvent;\n\n /**\n * Gets all attendees for a given event (or instance of a recurring event).\n * @return An array of [`Attendee`](#attendee) associated with the specified event.\n */\n getAttendees(): Promise<ExpoCalendarAttendee[]>;\n\n /**\n * Updates the provided details of an existing calendar stored on the device. To remove a property,\n * explicitly set it to `null` in `details`.\n * @param details A map of properties to be updated.\n * @param nullableFields A list of fields that can be set to `null`.\n */\n update(\n details: Partial<ModifiableEventProperties>,\n nullableFields?: (keyof ModifiableEventProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the event.\n */\n delete(): Promise<void>;\n\n /**\n * Creates a new attendee and adds it to this event.\n */\n createAttendee(\n attendee: Pick<NonNullable<Attendee>, 'email'> & Partial<Attendee>\n ): Promise<ExpoCalendarAttendee>;\n\n /**\n * Gets an event by its ID. Throws an error if the event with the given ID does not exist.\n * @param eventId The ID of the event to get.\n * @returns An [`ExpoCalendarEvent`](#expocalendarevent) object representing the event.\n */\n static get(eventId: string): Promise<ExpoCalendarEvent>;\n}\n\nexport declare class ExpoCalendarReminder {\n /**\n * Internal ID that represents this reminder on the device.\n */\n id?: string;\n /**\n * ID of the calendar that contains this reminder.\n */\n calendarId?: string;\n /**\n * Visible name of the reminder.\n */\n title?: string;\n /**\n * Location field of the reminder\n */\n location?: string;\n /**\n * Date when the reminder record was created.\n */\n creationDate?: string | Date;\n /**\n * Date when the reminder record was last modified.\n */\n lastModifiedDate?: string | Date;\n /**\n * Time zone the reminder is scheduled in.\n */\n timeZone?: string;\n /**\n * URL for the reminder.\n */\n url?: string;\n /**\n * Description or notes saved with the reminder.\n */\n notes?: string;\n /**\n * Array of Alarm objects which control automated alarms to the user about the task.\n */\n alarms?: Alarm[];\n /**\n * Object representing rules for recurring or repeated reminders. `null` for one-time tasks.\n */\n recurrenceRule?: RecurrenceRule | null;\n /**\n * Date object or string representing the start date of the reminder task.\n */\n startDate?: string | Date;\n /**\n * Date object or string representing the time when the reminder task is due.\n */\n dueDate?: string | Date;\n /**\n * Whether the reminder is an all-day reminder.\n */\n allDay?: boolean;\n /**\n * Indicates whether or not the task has been completed.\n */\n completed?: boolean;\n /**\n * Date object or string representing the date of completion, if `completed` is `true`.\n * Setting this property of a nonnull `Date` will automatically set the reminder's `completed` value to `true`.\n */\n completionDate?: string | Date;\n\n /**\n * @platform ios\n */\n update(\n details: Partial<ModifiableReminderProperties>,\n nullableFields?: (keyof ModifiableReminderProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the reminder.\n * @platform ios\n */\n delete(): Promise<void>;\n\n /**\n * Gets a reminder by its ID. Throws an error if the reminder with the given ID does not exist.\n * @param reminderId The ID of the reminder to get.\n * @returns An [`ExpoCalendarReminder`](#expocalendarreminder) object representing the reminder.\n * @platform ios\n */\n static get(reminderId: string): Promise<ExpoCalendarReminder>;\n}\n\n/**\n * Represents a calendar attendee object.\n * @platform android\n */\nexport declare class ExpoCalendarAttendee {\n /**\n * Internal ID that represents this attendee on the device.\n * @platform android\n */\n id?: string;\n /**\n * Indicates whether or not this attendee is the current OS user.\n * @platform ios\n */\n isCurrentUser?: boolean;\n /**\n * Displayed name of the attendee.\n */\n name: string;\n /**\n * Role of the attendee at the event.\n */\n role: AttendeeRole;\n /**\n * Status of the attendee in relation to the event.\n */\n status: AttendeeStatus;\n /**\n * Type of the attendee.\n */\n type: AttendeeType;\n /**\n * URL for the attendee.\n * @platform ios\n */\n url?: string;\n /**\n * Email of the attendee.\n * @platform android\n */\n email: string;\n\n /**\n * Updates the attendee.\n * @platform android\n */\n update(\n details: Partial<ModifiableAttendeeProperties>,\n nullableFields?: (keyof ModifiableAttendeeProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the attendee.\n * @platform android\n */\n delete(): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ExpoCalendar.types.js","sourceRoot":"","sources":["../src/ExpoCalendar.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Source,\n RecurringEventOptions,\n CalendarType,\n Availability,\n EntityTypes,\n Alarm,\n EventStatus,\n Organizer,\n ReminderStatus,\n CalendarDialogParams,\n DialogEventResult,\n OpenEventPresentationOptions,\n PresentationOptions,\n EventAccessLevel,\n CalendarAccessLevel,\n AlarmMethod,\n OpenEventDialogResult,\n Attendee,\n} from './legacy/Calendar';\nimport type { RecurrenceRule } from './types/RecurrenceRule';\n\nexport type CalendarDialogParamsNext = Omit<CalendarDialogParams, 'id'> & PresentationOptions;\n\nexport type CalendarDialogOpenParamsNext = CalendarDialogParamsNext & OpenEventPresentationOptions;\n\nexport type AddEventWithFormOptions = PresentationOptions & {\n title?: string;\n startDate?: Date | string;\n endDate?: Date | string;\n allDay?: boolean;\n notes?: string;\n location?: string;\n /**\n * @platform ios\n */\n url?: string;\n /**\n * @platform ios\n */\n alarms?: Alarm[];\n recurrenceRule?: RecurrenceRule;\n};\n\nexport type ModifiableCalendarProperties = Pick<ExpoCalendar, 'color' | 'title'>;\n\nexport type ModifiableEventProperties = Pick<\n ExpoCalendarEvent,\n | 'title'\n | 'location'\n | 'timeZone'\n | 'url'\n | 'notes'\n | 'alarms'\n | 'recurrenceRule'\n | 'availability'\n | 'startDate'\n | 'endDate'\n | 'allDay'\n>;\n\nexport type ModifiableReminderProperties = Pick<\n ExpoCalendarReminder,\n | 'title'\n | 'location'\n | 'timeZone'\n | 'url'\n | 'notes'\n | 'alarms'\n | 'recurrenceRule'\n | 'startDate'\n | 'dueDate'\n | 'completed'\n | 'completionDate'\n>;\n\nexport type ModifiableAttendeeProperties = ExpoCalendarAttendee;\n\nexport declare class ExpoCalendar {\n constructor(id: string);\n\n /**\n * Internal ID that represents this calendar on the device.\n */\n id: string;\n /**\n * Visible name of the calendar.\n */\n title: string;\n /**\n * ID of the source to be used for the calendar. Likely the same as the source for any other\n * locally stored calendars.\n * @platform ios\n */\n sourceId?: string;\n /**\n * Object representing the source to be used for the calendar.\n */\n source: Source;\n /**\n * Type of calendar this object represents.\n * @platform ios\n */\n type?: CalendarType;\n /**\n * Color used to display this calendar's events.\n */\n color?: string;\n /**\n * Whether the calendar is used in the Calendar or Reminders OS app.\n * @platform ios\n */\n entityType?: EntityTypes;\n /**\n * Boolean value that determines whether this calendar can be modified.\n */\n allowsModifications: boolean;\n /**\n * Availability types that this calendar supports.\n */\n allowedAvailabilities: Availability[];\n /**\n * Boolean value indicating whether this is the device's primary calendar.\n * @platform android\n */\n isPrimary?: boolean;\n /**\n * Internal system name of the calendar.\n * @platform android\n */\n name?: string | null;\n /**\n * Name for the account that owns this calendar.\n * @platform android\n */\n ownerAccount?: string;\n /**\n * Time zone for the calendar.\n * @platform android\n */\n timeZone?: string;\n /**\n * Alarm methods that this calendar supports.\n * @platform android\n */\n allowedReminders?: AlarmMethod[];\n /**\n * Attendee types that this calendar supports.\n * @platform android\n */\n allowedAttendeeTypes?: AttendeeType[];\n /**\n * Indicates whether the OS displays events on this calendar.\n * @platform android\n */\n isVisible?: boolean;\n /**\n * Indicates whether this calendar is synced and its events stored on the device.\n * Unexpected behavior may occur if this is not set to `true`.\n * @platform android\n */\n isSynced?: boolean;\n /**\n * Level of access that the user has for the calendar.\n * @platform android\n */\n accessLevel?: CalendarAccessLevel;\n\n /**\n * Returns a calendar event list for the given date range.\n */\n listEvents(startDate: Date | string, endDate: Date | string): Promise<ExpoCalendarEvent[]>;\n\n /**\n * Returns a list of reminders matching the provided criteria. If `startDate` and `endDate` are defined,\n * returns all reminders that overlap at all with the `[startDate, endDate]` interval, that is, all reminders\n * that end after the `startDate` or begin before the `endDate`.\n * @param startDate Beginning of time period to search for reminders in, or `null` for all completed reminders before `endDate`.\n * @param endDate End of time period to search for reminders in, or `null` for all completed reminders after `startDate`.\n * @param status One of `Calendar.ReminderStatus.COMPLETED` or `Calendar.ReminderStatus.INCOMPLETE`. If not defined, both completed and incomplete reminders will be returned.\n * @return An array of [`ExpoCalendarReminder`](#expocalendarreminder) objects matching the search criteria.\n * @platform ios\n */\n listReminders(\n startDate?: Date | string | null,\n endDate?: Date | string | null,\n status?: ReminderStatus | null\n ): Promise<ExpoCalendarReminder[]>;\n\n /**\n * Creates a new event in the calendar.\n * @param eventData A map of details for the event to be created.\n * @return An instance of the created event.\n */\n createEvent(\n eventData: Omit<Partial<ExpoCalendarEvent>, 'id' | 'organizer'>\n ): Promise<ExpoCalendarEvent>;\n\n /**\n * Creates a new reminder in the calendar.\n * @param reminderData A map of details for the reminder to be created.\n * @return An instance of the created reminder.\n * @platform ios\n */\n createReminder(\n reminderData: Omit<Partial<ExpoCalendarReminder>, 'id' | 'calendarId'>\n ): Promise<ExpoCalendarReminder>;\n\n /**\n * Presents the system-provided dialog to create a new event in this calendar, pre-filled with the provided data.\n * Requires at minimum write-only calendar permission.\n */\n addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult>;\n\n /**\n * Updates the provided details of an existing calendar stored on the device. To remove a property,\n * explicitly set it to `null` in `details`.\n * @param details A map of properties to be updated.\n */\n update(details: Partial<ModifiableCalendarProperties>): Promise<void>;\n\n /**\n * Deletes the calendar.\n */\n delete(): Promise<void>;\n\n /**\n * Gets a calendar by its ID. Throws an error if the calendar with the given ID does not exist.\n *\n * > **iOS 17+:** With write-only calendar access, only the virtual calendar's ID can be\n * > resolved - real calendars require full calendar access.\n *\n * @param calendarId The ID of the calendar to get.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the calendar.\n */\n static get(calendarId: string): Promise<ExpoCalendar>;\n}\n\nexport declare class ExpoCalendarEvent {\n constructor(id: string);\n /**\n * Internal ID that represents this event on the device.\n */\n id: string;\n /**\n * ID of the calendar that contains this event.\n */\n calendarId: string;\n /**\n * Visible name of the event.\n */\n title: string;\n /**\n * Location field of the event.\n */\n location: string | null;\n /**\n * Date when the event record was created.\n * @platform ios\n */\n creationDate?: string | Date;\n /**\n * Date when the event record was last modified.\n * @platform ios\n */\n lastModifiedDate?: string | Date;\n /**\n * Time zone the event is scheduled in.\n * When set to `null`, the event is scheduled to the device's time zone.\n */\n timeZone: string;\n /**\n * Time zone for the end date of the event.\n * @platform android\n */\n endTimeZone?: string;\n /**\n * URL for the event.\n * @platform ios\n */\n url?: string;\n /**\n * Description or notes saved with the event.\n */\n notes: string;\n /**\n * Array of Alarm objects which control automated reminders to the user.\n */\n alarms: Alarm[];\n /**\n * Object representing rules for recurring or repeating events. Set to `null` for one-time events.\n * It is either `endDate` or `occurrence` based.\n */\n recurrenceRule: RecurrenceRule | null;\n /**\n * Date object or string representing the time when the event starts.\n */\n startDate: string | Date;\n /**\n * Date object or string representing the time when the event ends.\n */\n endDate: string | Date;\n /**\n * For recurring events, the start date for the first (original) instance of the event.\n * @platform ios\n */\n originalStartDate?: string | Date;\n /**\n * Boolean value indicating whether or not the event is a detached (modified) instance of a recurring event.\n * @platform ios\n */\n isDetached?: boolean;\n /**\n * Whether the event is displayed as an all-day event on the calendar\n */\n allDay: boolean;\n /**\n * The availability setting for the event.\n */\n availability: Availability;\n /**\n * Status of the event.\n */\n status: EventStatus;\n /**\n * Organizer of the event.\n * This property is only available on events associated with calendars that are managed by a service such as Google Calendar or iCloud.\n * The organizer is read-only and cannot be set.\n *\n * @platform ios\n */\n organizer?: Organizer;\n /**\n * Email address of the organizer of the event.\n * @platform android\n */\n organizerEmail?: string;\n /**\n * User's access level for the event.\n * @platform android\n */\n accessLevel?: EventAccessLevel;\n /**\n * Whether invited guests can modify the details of the event.\n * @platform android\n */\n guestsCanModify?: boolean;\n /**\n * Whether invited guests can invite other guests.\n * @platform android\n */\n guestsCanInviteOthers?: boolean;\n /**\n * Whether invited guests can see other guests.\n * @platform android\n */\n guestsCanSeeGuests?: boolean;\n /**\n * For detached (modified) instances of recurring events, the ID of the original recurring event.\n * @platform android\n */\n originalId?: string;\n /**\n * For instances of recurring events, volatile ID representing this instance. Not guaranteed to\n * always refer to the same instance.\n * @platform android\n */\n instanceId?: string;\n\n /**\n * Launches the calendar UI provided by the OS to preview an event.\n * @return A promise which resolves with information about the dialog result.\n * @header systemProvidedUI\n */\n openInCalendar(\n params?: CalendarDialogOpenParamsNext | null // TODO: Support skipping this param instead of passing null, change needed in the core\n ): Promise<OpenEventDialogResult>;\n\n /**\n * Launches the calendar UI provided by the OS to edit or delete an event.\n * @return A promise which resolves with information about the dialog result.\n * @header systemProvidedUI\n */\n editInCalendar(\n params?: CalendarDialogParamsNext | null // TODO: Support skipping this param instead of passing null, change needed in the core\n ): Promise<DialogEventResult>;\n\n /**\n * Returns an event instance for a given event (or instance of a recurring event).\n * @param recurringEventOptions A map of options for recurring events.\n * @return An event instance.\n */\n getOccurrenceSync(recurringEventOptions?: RecurringEventOptions): ExpoCalendarEvent;\n\n /**\n * Gets all attendees for a given event (or instance of a recurring event).\n * @return An array of [`Attendee`](#attendee) associated with the specified event.\n */\n getAttendees(): Promise<ExpoCalendarAttendee[]>;\n\n /**\n * Updates the provided details of an existing calendar stored on the device. To remove a property,\n * explicitly set it to `null` in `details`.\n * @param details A map of properties to be updated.\n * @param nullableFields A list of fields that can be set to `null`.\n */\n update(\n details: Partial<ModifiableEventProperties>,\n nullableFields?: (keyof ModifiableEventProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the event.\n */\n delete(): Promise<void>;\n\n /**\n * Creates a new attendee and adds it to this event.\n */\n createAttendee(\n attendee: Pick<NonNullable<Attendee>, 'email'> & Partial<Attendee>\n ): Promise<ExpoCalendarAttendee>;\n\n /**\n * Gets an event by its ID. Throws an error if the event with the given ID does not exist.\n * @param eventId The ID of the event to get.\n * @returns An [`ExpoCalendarEvent`](#expocalendarevent) object representing the event.\n */\n static get(eventId: string): Promise<ExpoCalendarEvent>;\n}\n\nexport declare class ExpoCalendarReminder {\n /**\n * Internal ID that represents this reminder on the device.\n */\n id?: string;\n /**\n * ID of the calendar that contains this reminder.\n */\n calendarId?: string;\n /**\n * Visible name of the reminder.\n */\n title?: string;\n /**\n * Location field of the reminder\n */\n location?: string;\n /**\n * Date when the reminder record was created.\n */\n creationDate?: string | Date;\n /**\n * Date when the reminder record was last modified.\n */\n lastModifiedDate?: string | Date;\n /**\n * Time zone the reminder is scheduled in.\n */\n timeZone?: string;\n /**\n * URL for the reminder.\n */\n url?: string;\n /**\n * Description or notes saved with the reminder.\n */\n notes?: string;\n /**\n * Array of Alarm objects which control automated alarms to the user about the task.\n */\n alarms?: Alarm[];\n /**\n * Object representing rules for recurring or repeated reminders. `null` for one-time tasks.\n */\n recurrenceRule?: RecurrenceRule | null;\n /**\n * Date object or string representing the start date of the reminder task.\n */\n startDate?: string | Date;\n /**\n * Date object or string representing the time when the reminder task is due.\n */\n dueDate?: string | Date;\n /**\n * Whether the reminder is an all-day reminder.\n */\n allDay?: boolean;\n /**\n * Indicates whether or not the task has been completed.\n */\n completed?: boolean;\n /**\n * Date object or string representing the date of completion, if `completed` is `true`.\n * Setting this property of a nonnull `Date` will automatically set the reminder's `completed` value to `true`.\n */\n completionDate?: string | Date;\n\n /**\n * @platform ios\n */\n update(\n details: Partial<ModifiableReminderProperties>,\n nullableFields?: (keyof ModifiableReminderProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the reminder.\n * @platform ios\n */\n delete(): Promise<void>;\n\n /**\n * Gets a reminder by its ID. Throws an error if the reminder with the given ID does not exist.\n * @param reminderId The ID of the reminder to get.\n * @returns An [`ExpoCalendarReminder`](#expocalendarreminder) object representing the reminder.\n * @platform ios\n */\n static get(reminderId: string): Promise<ExpoCalendarReminder>;\n}\n\n/**\n * Represents a calendar attendee object.\n * @platform android\n */\nexport declare class ExpoCalendarAttendee {\n /**\n * Internal ID that represents this attendee on the device.\n * @platform android\n */\n id?: string;\n /**\n * Indicates whether or not this attendee is the current OS user.\n * @platform ios\n */\n isCurrentUser?: boolean;\n /**\n * Displayed name of the attendee.\n */\n name: string;\n /**\n * Role of the attendee at the event.\n */\n role: AttendeeRole;\n /**\n * Status of the attendee in relation to the event.\n */\n status: AttendeeStatus;\n /**\n * Type of the attendee.\n */\n type: AttendeeType;\n /**\n * URL for the attendee.\n * @platform ios\n */\n url?: string;\n /**\n * Email of the attendee.\n * @platform android\n */\n email: string;\n\n /**\n * Updates the attendee.\n * @platform android\n */\n update(\n details: Partial<ModifiableAttendeeProperties>,\n nullableFields?: (keyof ModifiableAttendeeProperties)[]\n ): Promise<void>;\n\n /**\n * Deletes the attendee.\n * @platform android\n */\n delete(): Promise<void>;\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -30,31 +30,31 @@ public class CalendarAccessGuard {
|
|
|
30
30
|
self.permittedEntities = permittedEntities
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
public func
|
|
34
|
-
try self.
|
|
33
|
+
public func ensureCalendarFullAccess() throws {
|
|
34
|
+
try self.ensurePermissions(
|
|
35
35
|
entity: .event,
|
|
36
36
|
requester: CalendarNextPermissionsRequester.self,
|
|
37
37
|
permissionName: "CALENDAR"
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
public func
|
|
42
|
-
try self.
|
|
41
|
+
public func ensureCalendarWriteOnlyOrFullAccess() throws {
|
|
42
|
+
try self.ensurePermissions(
|
|
43
43
|
entity: .event,
|
|
44
44
|
requester: CalendarWriteOnlyNextPermissionsRequester.self,
|
|
45
45
|
permissionName: "CALENDARWRITEONLY"
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
public func
|
|
50
|
-
try self.
|
|
49
|
+
public func ensureRemindersAccess() throws {
|
|
50
|
+
try self.ensurePermissions(
|
|
51
51
|
entity: .reminder,
|
|
52
52
|
requester: RemindersNextPermissionRequester.self,
|
|
53
53
|
permissionName: "REMINDERS"
|
|
54
54
|
)
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
private func
|
|
57
|
+
private func ensurePermissions(
|
|
58
58
|
entity: EKEntityType,
|
|
59
59
|
requester: EXPermissionsRequester.Type,
|
|
60
60
|
permissionName: String
|
|
@@ -29,7 +29,9 @@ public final class CalendarNextModule: Module {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
Function("getDefaultCalendarSync") { () -> ExpoCalendar in
|
|
32
|
-
|
|
32
|
+
// With write-only permissions granted, `eventStore.defaultCalendarForNewEvents` is a virtual calendar:
|
|
33
|
+
// https://developer.apple.com/documentation/EventKit/accessing-the-event-store#Use-EventKit-with-write-only-calendar-access
|
|
34
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
33
35
|
guard let defaultCalendar = eventStore.defaultCalendarForNewEvents else {
|
|
34
36
|
throw DefaultCalendarNotFoundException()
|
|
35
37
|
}
|
|
@@ -40,21 +42,24 @@ public final class CalendarNextModule: Module {
|
|
|
40
42
|
let calendars: [EKCalendar]
|
|
41
43
|
switch type {
|
|
42
44
|
case nil:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
// With write-only permissions granted, `eventStore.calendars` returns a single virtual calendar:
|
|
46
|
+
// https://developer.apple.com/documentation/EventKit/accessing-the-event-store#Use-EventKit-with-write-only-calendar-access
|
|
47
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
48
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
45
49
|
calendars = eventStore.calendars(for: .event) + eventStore.calendars(for: .reminder)
|
|
46
50
|
case .event:
|
|
47
|
-
try calendarAccessGuard?.
|
|
51
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
48
52
|
calendars = eventStore.calendars(for: .event)
|
|
49
53
|
case .reminder:
|
|
50
|
-
try calendarAccessGuard?.
|
|
54
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
51
55
|
calendars = eventStore.calendars(for: .reminder)
|
|
52
56
|
}
|
|
53
57
|
return calendars.map { ExpoCalendar(calendar: $0) }
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
AsyncFunction("getCalendarById") { (calendarId: String) -> ExpoCalendar in
|
|
57
|
-
|
|
61
|
+
// With write-only access, this can resolve the virtual calendar's identifier.
|
|
62
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
58
63
|
guard let calendar = eventStore.calendar(withIdentifier: calendarId) else {
|
|
59
64
|
throw CalendarIdNotFoundException(calendarId)
|
|
60
65
|
}
|
|
@@ -62,6 +67,7 @@ public final class CalendarNextModule: Module {
|
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
AsyncFunction("presentPicker") { (promise: Promise) in
|
|
70
|
+
// No access guard here on purpose. The system picker itself shows a message when permissions aren't granted.
|
|
65
71
|
guard let currentVc = appContext?.utilities?.currentViewController() else {
|
|
66
72
|
throw MissingCurrentViewControllerException()
|
|
67
73
|
}
|
|
@@ -88,10 +94,10 @@ public final class CalendarNextModule: Module {
|
|
|
88
94
|
let calendar: EKCalendar
|
|
89
95
|
switch calendarRecord.entityType {
|
|
90
96
|
case .event:
|
|
91
|
-
try calendarAccessGuard?.
|
|
97
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
92
98
|
calendar = EKCalendar(for: .event, eventStore: eventStore)
|
|
93
99
|
case .reminder:
|
|
94
|
-
try calendarAccessGuard?.
|
|
100
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
95
101
|
calendar = EKCalendar(for: .reminder, eventStore: eventStore)
|
|
96
102
|
case .none:
|
|
97
103
|
throw EntityNotSupportedException(calendarRecord.entityType?.rawValue)
|
|
@@ -122,7 +128,9 @@ public final class CalendarNextModule: Module {
|
|
|
122
128
|
startDateStr: Either<String, Double>,
|
|
123
129
|
endDateStr: Either<String, Double>,
|
|
124
130
|
promise: Promise) throws in
|
|
125
|
-
|
|
131
|
+
// The default EventKit behavior is to return an empty array if write-only permissions are granted.
|
|
132
|
+
// Ensuring full access makes the function throw instead of returning an ambiguous empty array.
|
|
133
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
126
134
|
|
|
127
135
|
let startDate = try requireDate(from: startDateStr)
|
|
128
136
|
let endDate = try requireDate(from: endDateStr)
|
|
@@ -147,7 +155,7 @@ public final class CalendarNextModule: Module {
|
|
|
147
155
|
|
|
148
156
|
AsyncFunction("getEventById") {
|
|
149
157
|
(eventId: String) -> ExpoCalendarEvent in
|
|
150
|
-
try calendarAccessGuard?.
|
|
158
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
151
159
|
guard let event = eventStore.event(withIdentifier: eventId) else {
|
|
152
160
|
throw EventNotFoundException(eventId)
|
|
153
161
|
}
|
|
@@ -156,7 +164,7 @@ public final class CalendarNextModule: Module {
|
|
|
156
164
|
|
|
157
165
|
AsyncFunction("getReminderById") {
|
|
158
166
|
(reminderId: String) -> ExpoCalendarReminder in
|
|
159
|
-
try calendarAccessGuard?.
|
|
167
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
160
168
|
guard let reminder = eventStore.calendarItem(withIdentifier: reminderId) as? EKReminder else {
|
|
161
169
|
throw ReminderNotFoundException(reminderId)
|
|
162
170
|
}
|
|
@@ -260,7 +268,9 @@ public final class CalendarNextModule: Module {
|
|
|
260
268
|
startDateStr: Either<String, Double>,
|
|
261
269
|
endDateStr: Either<String, Double>,
|
|
262
270
|
promise: Promise) throws in
|
|
263
|
-
|
|
271
|
+
// The default EventKit behavior is to return an empty array if write-only permissions are granted.
|
|
272
|
+
// Ensuring full access makes the function throw instead of returning an ambiguous empty array.
|
|
273
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
264
274
|
let startDate = try requireDate(from: startDateStr)
|
|
265
275
|
let endDate = try requireDate(from: endDateStr)
|
|
266
276
|
promise.resolve(try expoCalendar.listEvents(startDate: startDate, endDate: endDate))
|
|
@@ -272,7 +282,7 @@ public final class CalendarNextModule: Module {
|
|
|
272
282
|
endDateStr: String?,
|
|
273
283
|
status: String?,
|
|
274
284
|
promise: Promise) throws in
|
|
275
|
-
try calendarAccessGuard?.
|
|
285
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
276
286
|
|
|
277
287
|
var startDate: Date?
|
|
278
288
|
var endDate: Date?
|
|
@@ -290,7 +300,7 @@ public final class CalendarNextModule: Module {
|
|
|
290
300
|
|
|
291
301
|
// swiftlint:enable closure_parameter_position
|
|
292
302
|
AsyncFunction("createEvent") { (expoCalendar: ExpoCalendar, eventRecord: EventNext, options: RecurringEventOptions?) -> ExpoCalendarEvent in
|
|
293
|
-
try calendarAccessGuard?.
|
|
303
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
294
304
|
|
|
295
305
|
guard let calendar = expoCalendar.calendar else {
|
|
296
306
|
throw CalendarNoLongerExistsException()
|
|
@@ -312,7 +322,7 @@ public final class CalendarNextModule: Module {
|
|
|
312
322
|
}
|
|
313
323
|
|
|
314
324
|
AsyncFunction("createReminder") { (expoCalendar: ExpoCalendar, reminderRecord: Reminder, _: RecurringEventOptions?) -> ExpoCalendarReminder in
|
|
315
|
-
try calendarAccessGuard?.
|
|
325
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
316
326
|
|
|
317
327
|
guard let calendarInstance = expoCalendar.calendar else {
|
|
318
328
|
throw CalendarNoLongerExistsException()
|
|
@@ -334,7 +344,7 @@ public final class CalendarNextModule: Module {
|
|
|
334
344
|
}
|
|
335
345
|
|
|
336
346
|
AsyncFunction("addEventWithForm") { (expoCalendar: ExpoCalendar, options: AddEventWithFormOptions?, promise: Promise) in
|
|
337
|
-
try calendarAccessGuard?.
|
|
347
|
+
try calendarAccessGuard?.ensureCalendarWriteOnlyOrFullAccess()
|
|
338
348
|
|
|
339
349
|
let event = EKEvent(eventStore: eventStore)
|
|
340
350
|
event.calendar = expoCalendar.calendar
|
|
@@ -364,12 +374,12 @@ public final class CalendarNextModule: Module {
|
|
|
364
374
|
}.runOnQueue(.main)
|
|
365
375
|
|
|
366
376
|
AsyncFunction("update") { (expoCalendar: ExpoCalendar, calendarRecord: CalendarRecordNext) throws in
|
|
367
|
-
try calendarAccessGuard?.
|
|
377
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
368
378
|
try expoCalendar.update(calendarRecord: calendarRecord)
|
|
369
379
|
}
|
|
370
380
|
|
|
371
381
|
AsyncFunction("delete") { (expoCalendar: ExpoCalendar) in
|
|
372
|
-
try calendarAccessGuard?.
|
|
382
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
373
383
|
try expoCalendar.delete()
|
|
374
384
|
}
|
|
375
385
|
}
|
|
@@ -468,7 +478,7 @@ public final class CalendarNextModule: Module {
|
|
|
468
478
|
}
|
|
469
479
|
|
|
470
480
|
AsyncFunction("openInCalendar") { (expoEvent: ExpoCalendarEvent, options: OpenInCalendarOptions?, promise: Promise) in
|
|
471
|
-
try calendarAccessGuard?.
|
|
481
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
472
482
|
|
|
473
483
|
let startDate = parse(date: options?.instanceStartDate)
|
|
474
484
|
guard let calendarEvent = expoEvent.getOccurrence(startDate: startDate) else {
|
|
@@ -503,7 +513,7 @@ public final class CalendarNextModule: Module {
|
|
|
503
513
|
}.runOnQueue(.main)
|
|
504
514
|
|
|
505
515
|
AsyncFunction("editInCalendar") { (expoEvent: ExpoCalendarEvent, _: OpenInCalendarOptions?, promise: Promise) in
|
|
506
|
-
try calendarAccessGuard?.
|
|
516
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
507
517
|
|
|
508
518
|
guard let event = expoEvent.event else {
|
|
509
519
|
throw ItemNoLongerExistsException()
|
|
@@ -513,7 +523,7 @@ public final class CalendarNextModule: Module {
|
|
|
513
523
|
}.runOnQueue(.main)
|
|
514
524
|
|
|
515
525
|
Function("getOccurrenceSync") { (expoEvent: ExpoCalendarEvent, options: RecurringEventOptions?) throws in
|
|
516
|
-
try calendarAccessGuard?.
|
|
526
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
517
527
|
guard let ekEvent = try expoEvent.getOccurrence(options: options) else {
|
|
518
528
|
throw EventNotFoundException(options?.instanceStartDate ?? "")
|
|
519
529
|
}
|
|
@@ -522,17 +532,17 @@ public final class CalendarNextModule: Module {
|
|
|
522
532
|
}
|
|
523
533
|
|
|
524
534
|
AsyncFunction("getAttendees") { (expoEvent: ExpoCalendarEvent) throws in
|
|
525
|
-
try calendarAccessGuard?.
|
|
535
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
526
536
|
return try expoEvent.getAttendees()
|
|
527
537
|
}
|
|
528
538
|
|
|
529
539
|
AsyncFunction("update") { (expoEvent: ExpoCalendarEvent, eventRecord: EventNext, nullableFields: [String]?) throws in
|
|
530
|
-
try calendarAccessGuard?.
|
|
540
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
531
541
|
try expoEvent.update(eventRecord: eventRecord, nullableFields: nullableFields)
|
|
532
542
|
}
|
|
533
543
|
|
|
534
544
|
AsyncFunction("delete") { (expoEvent: ExpoCalendarEvent) in
|
|
535
|
-
try calendarAccessGuard?.
|
|
545
|
+
try calendarAccessGuard?.ensureCalendarFullAccess()
|
|
536
546
|
try expoEvent.delete()
|
|
537
547
|
}
|
|
538
548
|
}
|
|
@@ -633,12 +643,12 @@ public final class CalendarNextModule: Module {
|
|
|
633
643
|
}
|
|
634
644
|
|
|
635
645
|
AsyncFunction("update") { (expoReminder: ExpoCalendarReminder, reminderRecord: Reminder, nullableFields: [String]?) in
|
|
636
|
-
try calendarAccessGuard?.
|
|
646
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
637
647
|
try expoReminder.update(reminderRecord: reminderRecord, nullableFields: nullableFields)
|
|
638
648
|
}
|
|
639
649
|
|
|
640
650
|
AsyncFunction("delete") { (expoReminder: ExpoCalendarReminder) in
|
|
641
|
-
try calendarAccessGuard?.
|
|
651
|
+
try calendarAccessGuard?.ensureRemindersAccess()
|
|
642
652
|
try expoReminder.delete()
|
|
643
653
|
}
|
|
644
654
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0bb1839c2ba8d966b097bd7e64fad3af
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2def1eab41c237da05f474e650bf17d968f24f31
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ab0d4e0e57068dfa2393d46cfd8653f384aa22d8cbfe76bbed8df827cb281e1c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2d7d438655de585b11ca6fd77535fe2875ac322bf0f902147f2906564cc699dec3ae60a5b06f4528f0cb7d80d519ba763983ef678bd94a26aa37c81215446690
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6e933ae137d3af55dc876dca47fea99b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d1475b87a5ae80d7dad1a248c1ff5119047670dc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
80866ebfc8473572bc4bffcf5843df1acf678f658335fd01295dad70cd28b886
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e607e5430d2f16d6632d76f1e74e57bff12f59f3ae65e159804c77807f0c95da2cffbfc330a2763468af0596d4126accf93a5d963d663448fed8f415ec5d0114
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.calendar",
|
|
6
|
-
"version": "57.0.
|
|
6
|
+
"version": "57.0.4",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.calendar-57.0.
|
|
28
|
-
"url": "expo.modules.calendar-57.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.calendar-57.0.4.aar",
|
|
28
|
+
"url": "expo.modules.calendar-57.0.4.aar",
|
|
29
|
+
"size": 752397,
|
|
30
|
+
"sha512": "e607e5430d2f16d6632d76f1e74e57bff12f59f3ae65e159804c77807f0c95da2cffbfc330a2763468af0596d4126accf93a5d963d663448fed8f415ec5d0114",
|
|
31
|
+
"sha256": "80866ebfc8473572bc4bffcf5843df1acf678f658335fd01295dad70cd28b886",
|
|
32
|
+
"sha1": "d1475b87a5ae80d7dad1a248c1ff5119047670dc",
|
|
33
|
+
"md5": "6e933ae137d3af55dc876dca47fea99b"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
],
|
|
82
82
|
"files": [
|
|
83
83
|
{
|
|
84
|
-
"name": "expo.modules.calendar-57.0.
|
|
85
|
-
"url": "expo.modules.calendar-57.0.
|
|
86
|
-
"size":
|
|
87
|
-
"sha512": "
|
|
88
|
-
"sha256": "
|
|
89
|
-
"sha1": "
|
|
90
|
-
"md5": "
|
|
84
|
+
"name": "expo.modules.calendar-57.0.4.aar",
|
|
85
|
+
"url": "expo.modules.calendar-57.0.4.aar",
|
|
86
|
+
"size": 752397,
|
|
87
|
+
"sha512": "e607e5430d2f16d6632d76f1e74e57bff12f59f3ae65e159804c77807f0c95da2cffbfc330a2763468af0596d4126accf93a5d963d663448fed8f415ec5d0114",
|
|
88
|
+
"sha256": "80866ebfc8473572bc4bffcf5843df1acf678f658335fd01295dad70cd28b886",
|
|
89
|
+
"sha1": "d1475b87a5ae80d7dad1a248c1ff5119047670dc",
|
|
90
|
+
"md5": "6e933ae137d3af55dc876dca47fea99b"
|
|
91
91
|
}
|
|
92
92
|
]
|
|
93
93
|
},
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
},
|
|
102
102
|
"files": [
|
|
103
103
|
{
|
|
104
|
-
"name": "expo.modules.calendar-57.0.
|
|
105
|
-
"url": "expo.modules.calendar-57.0.
|
|
106
|
-
"size":
|
|
107
|
-
"sha512": "
|
|
108
|
-
"sha256": "
|
|
109
|
-
"sha1": "
|
|
110
|
-
"md5": "
|
|
104
|
+
"name": "expo.modules.calendar-57.0.4-sources.jar",
|
|
105
|
+
"url": "expo.modules.calendar-57.0.4-sources.jar",
|
|
106
|
+
"size": 88596,
|
|
107
|
+
"sha512": "2d7d438655de585b11ca6fd77535fe2875ac322bf0f902147f2906564cc699dec3ae60a5b06f4528f0cb7d80d519ba763983ef678bd94a26aa37c81215446690",
|
|
108
|
+
"sha256": "ab0d4e0e57068dfa2393d46cfd8653f384aa22d8cbfe76bbed8df827cb281e1c",
|
|
109
|
+
"sha1": "2def1eab41c237da05f474e650bf17d968f24f31",
|
|
110
|
+
"md5": "0bb1839c2ba8d966b097bd7e64fad3af"
|
|
111
111
|
}
|
|
112
112
|
]
|
|
113
113
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aabbe5794d568f944464e882e053d952
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7b20e9a1068e9a12a75547b5e9d3c4eb93755735
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4e8194124826bdce73a5731ad76980ee2225c36b18c09abd4290cc8814f400af
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9abd708a660cffabdee079e6b12e51140c758568fb1e3862b220dbc7c5c661b818f429c15ea7bd48ad9bad51713ef366a74bb9e73cfea284d23a4af76207180b
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.calendar</artifactId>
|
|
12
|
-
<version>57.0.
|
|
12
|
+
<version>57.0.4</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.calendar</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a1c6e5f64c94fbd9f89c703a86123f09
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8a51c71081cfcc583674cca5540687e5eb3f2a2c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
98dcd5115b2abb0c5da5ecec59d1532793392b4ca8154e2796275042c3c4a918
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aec4660b4fdd0ce048e3aa81404c5229bb355f19f07bb601d756bb053a6187fcdcfbe30c197c070cd0ba22a9bb9f6e6027ca88847ad55236b49fdc9c7184b636
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.calendar</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>57.0.
|
|
7
|
-
<release>57.0.
|
|
6
|
+
<latest>57.0.4</latest>
|
|
7
|
+
<release>57.0.4</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>57.0.
|
|
9
|
+
<version>57.0.4</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260916151204</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4d3ddabb496f4a8eae0a84cad950796d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ad992a59b51176ddbb86df0e3bbfe8b684cb0e7f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8a6b73e63b01b0e50365e1bcc8824fb69c7aa7055b572089efe0b9d28a39ea33
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e92e6933213f66b05aaeb345e35e37585b1767e2945480f500f5fe689522f0de0c76462aa1de27894d2a4b897ec409ef59adf5370ac324e288e0c9ffa8bf4437
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-calendar",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.4",
|
|
4
4
|
"description": "Provides an API for interacting with the device's system calendars, events, reminders, and associated records.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.14.0",
|
|
48
|
-
"expo": "57.0.
|
|
48
|
+
"expo": "57.0.23",
|
|
49
49
|
"expo-module-scripts": "56.0.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"expo": "*",
|
|
53
53
|
"react-native": "*"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d0c137db622ac5b32a4088846a92b8177427eec2",
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "expo-module build",
|
|
58
58
|
"clean": "expo-module clean",
|
package/spm.config.json
CHANGED
package/src/Calendar.ts
CHANGED
|
@@ -206,6 +206,10 @@ export class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {
|
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
208
|
* Gets an instance of the default calendar object.
|
|
209
|
+
*
|
|
210
|
+
* > **iOS 17+:** With write-only calendar access, this returns EventKit's virtual calendar,
|
|
211
|
+
* > which can be used to create events but does not expose existing calendar data.
|
|
212
|
+
*
|
|
209
213
|
* > **Android:** This function is not available on Android. Android does not expose a single
|
|
210
214
|
* > system-managed default calendar. Use `getCalendars()` and choose an appropriate writable
|
|
211
215
|
* > calendar for your app; `isPrimary` can help identify per-account primary calendars.
|
|
@@ -222,12 +226,16 @@ export function getDefaultCalendarSync(): ExpoCalendar {
|
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
/**
|
|
225
|
-
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* >
|
|
230
|
-
*
|
|
229
|
+
* Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the
|
|
230
|
+
* calendars available to the app.
|
|
231
|
+
*
|
|
232
|
+
* > **iOS 17+:** With write-only calendar access, requesting `EntityTypes.EVENT` returns a
|
|
233
|
+
* > single virtual calendar, which can be used to create events but does not expose the user's
|
|
234
|
+
* > real calendars.
|
|
235
|
+
*
|
|
236
|
+
* @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to a specific [entity type](#entitytypes).
|
|
237
|
+
* > **Note:** If not defined, both calendar (write-only is enough) and reminders permissions are required.
|
|
238
|
+
* @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type, if provided.
|
|
231
239
|
*/
|
|
232
240
|
export async function getCalendars(entityType?: EntityTypes): Promise<ExpoCalendar[]> {
|
|
233
241
|
if (!InternalExpoCalendar.getCalendars) {
|
|
@@ -229,6 +229,10 @@ export declare class ExpoCalendar {
|
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* Gets a calendar by its ID. Throws an error if the calendar with the given ID does not exist.
|
|
232
|
+
*
|
|
233
|
+
* > **iOS 17+:** With write-only calendar access, only the virtual calendar's ID can be
|
|
234
|
+
* > resolved - real calendars require full calendar access.
|
|
235
|
+
*
|
|
232
236
|
* @param calendarId The ID of the calendar to get.
|
|
233
237
|
* @returns An [`ExpoCalendar`](#expocalendar) object representing the calendar.
|
|
234
238
|
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e300313be20aa208c9e2f4982bd152ff
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
08cd172269b8e16e5f6c99e6faef31070614ba8f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a8e1f00353977b0bdf4d602866331ec01b0bea17c595ae8e58bece1a468535b5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ca25c1d51ff3574010a680be5b5cc1e9bd28eea4178703f07ddd754acb1eb64770784f67267eb268ba21a587754047f3521ca100bbde835dd872d1e2d1ae3687
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
28b2ec8ed6e6c8b829b929b9bd6ab100
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c7da8155428e9b9595b58c3144934d1dba13fbf9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9a3784a7080327cf79786b4bf64f31f1d02ed511a7d2790bf2a87de2b8033457
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b4ec89c9e48972ac8679ad79214ec5212b448310669cf485a882170e5ba4886496f2755492af931cd217b561040748a96fb2bd3dd733e2d592d22581f4155c39
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a7f1b7a4a6bf989b0fadcd3388d97b05
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
665b2d5c67d4632771e2e9ccb654c5493e537664
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ea3def85e567647337dde99d0e43c83c0c031e25f29eb4edf3155f2723fd7811
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f940d948d1431c56a81f5b0c22daea70f7111f59a478fb551ecf641698a110ef0f24f4603b4b99b2d254ee16f331fb727fd4901994e578939b0534c2672c3277
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
52dc24e8c069bdf63d2dee24fd63a9a6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
176461f443bb4760ac21b1560c8cc3568597b417
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
02efdd4b92cdcbc8c664d194c83a51c74a5c8843acf24141638614c020b25028
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b1677d623d6b930ed1840f7b3fd678c8cb5009003db75077c56c69cd8e2eb758b80a768ef25f4e92d4e7cf196d938866a0a63411d3643f0cc4cf578d8e8b29e2
|