@ebarooni/capacitor-calendar 8.2.0 → 8.4.0

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.
Files changed (97) hide show
  1. package/README.md +219 -93
  2. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +42 -7
  3. package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +33 -19
  4. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +88 -21
  5. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventDeleteInfo.kt +8 -0
  6. package/android/src/main/java/dev/barooni/capacitor/calendar/models/enums/EventSpan.kt +13 -0
  7. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CheckPermissionInput.kt +0 -4
  8. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateCalendarInput.kt +3 -1
  9. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteCalendarInput.kt +4 -1
  10. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventInput.kt +4 -1
  11. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventWithPromptInput.kt +4 -1
  12. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventsByIdInput.kt +2 -0
  13. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/GetDefaultCalendarInput.kt +9 -0
  14. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyCalendarInput.kt +10 -1
  15. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/RequestPermissionInput.kt +3 -5
  16. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CheckAllPermissionsResult.kt +3 -2
  17. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/RequestAllPermissionsResult.kt +1 -1
  18. package/android/src/main/java/dev/barooni/capacitor/calendar/models/templates/PluginCompletion.kt +8 -0
  19. package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +340 -35
  20. package/dist/docs.json +616 -88
  21. package/dist/esm/index.d.ts +8 -1
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/schemas/enums/calendar-permission-scope.d.ts +8 -0
  24. package/dist/esm/schemas/enums/calendar-permission-scope.js +8 -0
  25. package/dist/esm/schemas/enums/calendar-permission-scope.js.map +1 -1
  26. package/dist/esm/schemas/enums/event-span.d.ts +4 -0
  27. package/dist/esm/schemas/enums/event-span.js +4 -0
  28. package/dist/esm/schemas/enums/event-span.js.map +1 -1
  29. package/dist/esm/schemas/interfaces/calendar-source.d.ts +3 -0
  30. package/dist/esm/schemas/interfaces/calendar-source.js.map +1 -1
  31. package/dist/esm/schemas/interfaces/calendar.d.ts +12 -2
  32. package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
  33. package/dist/esm/schemas/interfaces/check-permission-options.d.ts +19 -0
  34. package/dist/esm/schemas/interfaces/check-permission-options.js +2 -0
  35. package/dist/esm/schemas/interfaces/check-permission-options.js.map +1 -0
  36. package/dist/esm/schemas/interfaces/create-calendar-options.d.ts +16 -5
  37. package/dist/esm/schemas/interfaces/create-calendar-options.js.map +1 -1
  38. package/dist/esm/schemas/interfaces/create-calendar-result.d.ts +12 -0
  39. package/dist/esm/schemas/interfaces/create-calendar-result.js +2 -0
  40. package/dist/esm/schemas/interfaces/create-calendar-result.js.map +1 -0
  41. package/dist/esm/schemas/interfaces/delete-calendar-options.d.ts +1 -0
  42. package/dist/esm/schemas/interfaces/delete-calendar-options.js.map +1 -1
  43. package/dist/esm/schemas/interfaces/delete-event-options.d.ts +28 -3
  44. package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -1
  45. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +38 -13
  46. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -1
  47. package/dist/esm/schemas/interfaces/delete-events-by-id-options.d.ts +15 -3
  48. package/dist/esm/schemas/interfaces/delete-events-by-id-options.js.map +1 -1
  49. package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.d.ts +13 -0
  50. package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.js +2 -0
  51. package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.js.map +1 -0
  52. package/dist/esm/schemas/interfaces/get-default-calendar-options.d.ts +13 -0
  53. package/dist/esm/schemas/interfaces/get-default-calendar-options.js +2 -0
  54. package/dist/esm/schemas/interfaces/get-default-calendar-options.js.map +1 -0
  55. package/dist/esm/schemas/interfaces/list-calendars-result.d.ts +13 -0
  56. package/dist/esm/schemas/interfaces/list-calendars-result.js +2 -0
  57. package/dist/esm/schemas/interfaces/list-calendars-result.js.map +1 -0
  58. package/dist/esm/schemas/interfaces/list-events-in-range-options.d.ts +7 -2
  59. package/dist/esm/schemas/interfaces/list-events-in-range-options.js.map +1 -1
  60. package/dist/esm/schemas/interfaces/modify-calendar-options.d.ts +8 -1
  61. package/dist/esm/schemas/interfaces/modify-calendar-options.js.map +1 -1
  62. package/dist/esm/schemas/interfaces/open-calendar-options.d.ts +5 -1
  63. package/dist/esm/schemas/interfaces/open-calendar-options.js.map +1 -1
  64. package/dist/esm/schemas/interfaces/request-permission-options.d.ts +16 -0
  65. package/dist/esm/schemas/interfaces/request-permission-options.js +2 -0
  66. package/dist/esm/schemas/interfaces/request-permission-options.js.map +1 -0
  67. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.d.ts +14 -0
  68. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.js +2 -0
  69. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.js.map +1 -0
  70. package/dist/esm/sub-definitions/calendar-access.d.ts +22 -10
  71. package/dist/esm/sub-definitions/calendar-access.js.map +1 -1
  72. package/dist/esm/sub-definitions/calendar-operations.d.ts +62 -15
  73. package/dist/esm/sub-definitions/calendar-operations.js.map +1 -1
  74. package/dist/esm/sub-definitions/event-operations.d.ts +15 -1
  75. package/dist/esm/sub-definitions/event-operations.js.map +1 -1
  76. package/dist/esm/sub-definitions/reminders-access.d.ts +4 -0
  77. package/dist/esm/sub-definitions/reminders-access.js.map +1 -1
  78. package/dist/esm/web.d.ts +15 -21
  79. package/dist/esm/web.js +1 -1
  80. package/dist/esm/web.js.map +1 -1
  81. package/dist/plugin.cjs.js +13 -1
  82. package/dist/plugin.cjs.js.map +1 -1
  83. package/dist/plugin.js +13 -1
  84. package/dist/plugin.js.map +1 -1
  85. package/ios/Plugin/CapacitorCalendarPlugin.swift +19 -16
  86. package/ios/Plugin/Implementation/CapacitorCalendar.swift +67 -37
  87. package/ios/Plugin/Models/Enums/EventSpan.swift +8 -0
  88. package/ios/Plugin/Models/Inputs/CreateCalendarInput.swift +4 -5
  89. package/ios/Plugin/Models/Inputs/DeleteCalendarInput.swift +1 -1
  90. package/ios/Plugin/Models/Inputs/DeleteEventInput.swift +9 -4
  91. package/ios/Plugin/Models/Inputs/DeleteEventWithPromptInput.swift +9 -4
  92. package/ios/Plugin/Models/Inputs/DeleteEventsByIdInput.swift +9 -4
  93. package/ios/Plugin/Models/Inputs/GetDefaultCalendarInput.swift +13 -0
  94. package/ios/Plugin/Models/Inputs/ModifyCalendarInput.swift +4 -1
  95. package/ios/Plugin/PluginError.swift +68 -56
  96. package/ios/Plugin/Utils/ImplementationHelper.swift +22 -14
  97. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <img src="https://img.shields.io/npm/l/@ebarooni/capacitor-calendar?style=flat-square" />
7
7
  </a>
8
8
  <a href="https://www.npmjs.com/package/@ebarooni/capacitor-calendar">
9
- <img src="https://img.shields.io/npm/dw/@ebarooni/capacitor-calendar?style=flat-square" />
9
+ <img src="https://img.shields.io/npm/dm/@ebarooni/capacitor-calendar?style=flat-square" />
10
10
  </a>
11
11
  <a href="https://www.npmjs.com/package/@ebarooni/capacitor-calendar">
12
12
  <img src="https://img.shields.io/npm/v/@ebarooni/capacitor-calendar?style=flat-square" />
@@ -14,6 +14,9 @@
14
14
  <a href="https://capacitorjs.com/">
15
15
  <img src="https://img.shields.io/badge/Capacitor-8.x-119EFF.svg?style=flat-square" />
16
16
  </a>
17
+ <a href="mcp/README.md">
18
+ <img src="https://img.shields.io/badge/MCP-161b22?style=flat&logo=modelcontextprotocol&logoColor=5FB8AF" />
19
+ </a>
17
20
  </p>
18
21
 
19
22
  ![capacitor-calendar-logo](assets/images/text-logo.png)
@@ -43,6 +46,16 @@ Full-featured Capacitor plugin for native calendar and reminders access. Manage
43
46
  - **Fast support.** Questions, bug reports, and integration help are handled promptly.
44
47
  - **Reduced vendor risk.** Relying on a single plugin provider for all your needs is a liability. Choosing specialized, independent maintainers keeps your stack resilient.
45
48
 
49
+ ## MCP Server
50
+
51
+ `@ebarooni/capacitor-calendar` ships an official [MCP](https://modelcontextprotocol.io) server so AI coding assistants can work with the plugin accurately.
52
+
53
+ ```bash
54
+ docker run --rm -d --name capacitor-calendar-mcp -p 8080:8080 ghcr.io/ebarooni/capacitor-calendar-mcp:1.0.0
55
+ ```
56
+
57
+ See [`mcp/README.md`](mcp/README.md) for client configuration and full details.
58
+
46
59
  ## Table of Contents
47
60
 
48
61
  - [Installation](#installation)
@@ -65,7 +78,7 @@ npx cap sync
65
78
 
66
79
  ## Demo
67
80
 
68
- | iOS 26 | Android 16 |
81
+ | iOS 26 | Android 17 |
69
82
  | :-----------------------------: | :---------------------------------: |
70
83
  | ![](./assets/demo/ios-demo.gif) | ![](./assets/demo/android-demo.gif) |
71
84
 
@@ -162,7 +175,9 @@ await CapacitorCalendar.createEventWithPrompt({
162
175
  > [!NOTE]
163
176
  > On Android, this method always returns null. If you need the event ID, call `listEventsInRange(...)` afterward.
164
177
 
165
- ### List upcoming events
178
+ ### List events in a range
179
+
180
+ `listEventsInRange` returns events that overlap the given range, not only events that start or end inside it. Multi-day events that span the interval are included.
166
181
 
167
182
  ```typescript
168
183
  const now = Date.now();
@@ -176,6 +191,20 @@ const { result: events } = await CapacitorCalendar.listEventsInRange({
176
191
  console.log('Upcoming events:', events);
177
192
  ```
178
193
 
194
+ To list events on a single day, use that day's bounds:
195
+
196
+ ```typescript
197
+ const startOfDay = new Date();
198
+ startOfDay.setHours(0, 0, 0, 0);
199
+ const startOfNextDay = new Date(startOfDay);
200
+ startOfNextDay.setDate(startOfNextDay.getDate() + 1);
201
+
202
+ const { result: todaysEvents } = await CapacitorCalendar.listEventsInRange({
203
+ from: startOfDay.getTime(),
204
+ to: startOfNextDay.getTime(),
205
+ });
206
+ ```
207
+
179
208
  ### Working with Calendars
180
209
 
181
210
  ```typescript
@@ -239,7 +268,7 @@ See [CHANGELOG.md](CHANGELOG.md) for the latest updates and release history.
239
268
  * [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt)
240
269
  * [`fetchAllCalendarSources()`](#fetchallcalendarsources)
241
270
  * [`listCalendars()`](#listcalendars)
242
- * [`getDefaultCalendar()`](#getdefaultcalendar)
271
+ * [`getDefaultCalendar(...)`](#getdefaultcalendar)
243
272
  * [`openCalendar(...)`](#opencalendar)
244
273
  * [`createCalendar(...)`](#createcalendar)
245
274
  * [`deleteCalendar(...)`](#deletecalendar)
@@ -270,14 +299,15 @@ See [CHANGELOG.md](CHANGELOG.md) for the latest updates and release history.
270
299
  ### checkPermission(...)
271
300
 
272
301
  ```typescript
273
- checkPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>
302
+ checkPermission(options: CheckPermissionOptions) => Promise<{ result: PermissionState; }>
274
303
  ```
275
304
 
276
305
  Retrieves the current permission state for a given scope.
306
+ On Android, `readReminders` and `writeReminders` resolve to `"prompt"`.
277
307
 
278
- | Param | Type |
279
- | ------------- | --------------------------------------------------------------------------------------- |
280
- | **`options`** | <code>{ scope: <a href="#calendarpermissionscope">CalendarPermissionScope</a>; }</code> |
308
+ | Param | Type |
309
+ | ------------- | ------------------------------------------------------------------------- |
310
+ | **`options`** | <code><a href="#checkpermissionoptions">CheckPermissionOptions</a></code> |
281
311
 
282
312
  **Returns:** <code>Promise&lt;{ result: <a href="#permissionstate">PermissionState</a>; }&gt;</code>
283
313
 
@@ -295,6 +325,7 @@ checkAllPermissions() => Promise<{ result: CheckAllPermissionsResult; }>
295
325
  ```
296
326
 
297
327
  Retrieves the current state of all permissions.
328
+ On Android, reminder keys always resolve to `"prompt"`.
298
329
 
299
330
  **Returns:** <code>Promise&lt;{ result: <a href="#checkallpermissionsresult">CheckAllPermissionsResult</a>; }&gt;</code>
300
331
 
@@ -308,14 +339,15 @@ Retrieves the current state of all permissions.
308
339
  ### requestPermission(...)
309
340
 
310
341
  ```typescript
311
- requestPermission(options: { scope: CalendarPermissionScope; }) => Promise<{ result: PermissionState; }>
342
+ requestPermission(options: RequestPermissionOptions) => Promise<{ result: PermissionState; }>
312
343
  ```
313
344
 
314
345
  Requests permission for a given scope.
346
+ On Android, `readReminders` and `writeReminders` reject with `Invalid scope.`
315
347
 
316
- | Param | Type |
317
- | ------------- | --------------------------------------------------------------------------------------- |
318
- | **`options`** | <code>{ scope: <a href="#calendarpermissionscope">CalendarPermissionScope</a>; }</code> |
348
+ | Param | Type |
349
+ | ------------- | ----------------------------------------------------------------------------- |
350
+ | **`options`** | <code><a href="#requestpermissionoptions">RequestPermissionOptions</a></code> |
319
351
 
320
352
  **Returns:** <code>Promise&lt;{ result: <a href="#permissionstate">PermissionState</a>; }&gt;</code>
321
353
 
@@ -333,6 +365,7 @@ requestAllPermissions() => Promise<{ result: RequestAllPermissionsResult; }>
333
365
  ```
334
366
 
335
367
  Requests permission for all calendar and reminder permissions.
368
+ On Android, only calendar permissions are requested; reminder keys stay `"prompt"`.
336
369
 
337
370
  **Returns:** <code>Promise&lt;{ result: <a href="#checkallpermissionsresult">CheckAllPermissionsResult</a>; }&gt;</code>
338
371
 
@@ -401,6 +434,8 @@ requestFullRemindersAccess() => Promise<{ result: PermissionState; }>
401
434
  ```
402
435
 
403
436
  Requests read and write access to the reminders.
437
+ Resolves with `"granted"` or `"denied"` (never `"prompt"`).
438
+ A grant covers both `readReminders` and `writeReminders`.
404
439
 
405
440
  **Returns:** <code>Promise&lt;{ result: <a href="#permissionstate">PermissionState</a>; }&gt;</code>
406
441
 
@@ -563,7 +598,10 @@ Opens a dialog to delete an event.
563
598
  listEventsInRange(options: ListEventsInRangeOptions) => Promise<{ result: CalendarEvent[]; }>
564
599
  ```
565
600
 
566
- Retrieves the events within a date range.
601
+ Retrieves events that overlap a date range.
602
+
603
+ An event is included when its time interval intersects `[from, to]`, including
604
+ multi-day events that span the range without starting or ending inside it.
567
605
 
568
606
  | Param | Type |
569
607
  | ------------- | ----------------------------------------------------------------------------- |
@@ -584,7 +622,7 @@ Retrieves the events within a date range.
584
622
  commit() => Promise<void>
585
623
  ```
586
624
 
587
- Save the changes to the calendar.
625
+ Saves pending calendar changes.
588
626
 
589
627
  **Since:** 7.1.0
590
628
 
@@ -596,16 +634,25 @@ Save the changes to the calendar.
596
634
  ### selectCalendarsWithPrompt(...)
597
635
 
598
636
  ```typescript
599
- selectCalendarsWithPrompt(options?: SelectCalendarsWithPromptOptions | undefined) => Promise<{ result: Calendar[]; }>
637
+ selectCalendarsWithPrompt(options?: SelectCalendarsWithPromptOptions | undefined) => Promise<SelectCalendarsWithPromptResult>
600
638
  ```
601
639
 
602
640
  Opens a system interface to choose one or multiple calendars.
603
641
 
642
+ Calendar access is expected. Call `requestFullCalendarAccess()` first.
643
+ Without authorization the chooser can look empty.
644
+
645
+ On confirm, `result` contains the calendars the user selected.
646
+ On cancel, `result` is an empty array.
647
+
648
+ If a chooser is already presented, a new call is rejected; the in-flight
649
+ call continues until the user confirms or cancels.
650
+
604
651
  | Param | Type |
605
652
  | ------------- | --------------------------------------------------------------------------------------------- |
606
653
  | **`options`** | <code><a href="#selectcalendarswithpromptoptions">SelectCalendarsWithPromptOptions</a></code> |
607
654
 
608
- **Returns:** <code>Promise&lt;{ result: Calendar[]; }&gt;</code>
655
+ **Returns:** <code>Promise&lt;<a href="#selectcalendarswithpromptresult">SelectCalendarsWithPromptResult</a>&gt;</code>
609
656
 
610
657
  **Since:** 0.2.0
611
658
 
@@ -617,12 +664,15 @@ Opens a system interface to choose one or multiple calendars.
617
664
  ### fetchAllCalendarSources()
618
665
 
619
666
  ```typescript
620
- fetchAllCalendarSources() => Promise<{ result: CalendarSource[]; }>
667
+ fetchAllCalendarSources() => Promise<FetchAllCalendarSourcesResult>
621
668
  ```
622
669
 
623
670
  Retrieves a list of calendar sources.
624
671
 
625
- **Returns:** <code>Promise&lt;{ result: CalendarSource[]; }&gt;</code>
672
+ Requires calendar access. Without authorization, `result` is typically
673
+ an empty array. This method does not reject solely for missing permission.
674
+
675
+ **Returns:** <code>Promise&lt;<a href="#fetchallcalendarsourcesresult">FetchAllCalendarSourcesResult</a>&gt;</code>
626
676
 
627
677
  **Since:** 6.6.0
628
678
 
@@ -634,12 +684,15 @@ Retrieves a list of calendar sources.
634
684
  ### listCalendars()
635
685
 
636
686
  ```typescript
637
- listCalendars() => Promise<{ result: Calendar[]; }>
687
+ listCalendars() => Promise<ListCalendarsResult>
638
688
  ```
639
689
 
640
690
  Retrieves a list of all available calendars.
641
691
 
642
- **Returns:** <code>Promise&lt;{ result: Calendar[]; }&gt;</code>
692
+ Requires calendar read access. On Android, missing permission typically
693
+ rejects. On iOS, missing authorization typically returns an empty `result`.
694
+
695
+ **Returns:** <code>Promise&lt;<a href="#listcalendarsresult">ListCalendarsResult</a>&gt;</code>
643
696
 
644
697
  **Since:** 7.1.0
645
698
 
@@ -648,14 +701,26 @@ Retrieves a list of all available calendars.
648
701
  --------------------
649
702
 
650
703
 
651
- ### getDefaultCalendar()
704
+ ### getDefaultCalendar(...)
652
705
 
653
706
  ```typescript
654
- getDefaultCalendar() => Promise<{ result: Calendar | null; }>
707
+ getDefaultCalendar(options?: GetDefaultCalendarOptions | undefined) => Promise<{ result: Calendar | null; }>
655
708
  ```
656
709
 
657
710
  Retrieves the default calendar.
658
711
 
712
+ Requires calendar read access. On Android, missing permission typically
713
+ rejects. On iOS, missing authorization typically yields `result: null`.
714
+
715
+ The system default is the primary calendar on Android and
716
+ `defaultCalendarForNewEvents` on iOS. When neither exists and
717
+ `useFallbackCalendar` is true, the first available calendar is returned.
718
+ Otherwise the method returns `null` when there is no system default.
719
+
720
+ | Param | Type |
721
+ | ------------- | ------------------------------------------------------------------------------- |
722
+ | **`options`** | <code><a href="#getdefaultcalendaroptions">GetDefaultCalendarOptions</a></code> |
723
+
659
724
  **Returns:** <code>Promise&lt;{ result: <a href="#calendar">Calendar</a> | null; }&gt;</code>
660
725
 
661
726
  **Since:** 0.3.0
@@ -687,16 +752,19 @@ Opens the calendar app.
687
752
  ### createCalendar(...)
688
753
 
689
754
  ```typescript
690
- createCalendar(options: CreateCalendarOptions) => Promise<{ id: string; }>
755
+ createCalendar(options: CreateCalendarOptions) => Promise<CreateCalendarResult>
691
756
  ```
692
757
 
693
758
  Creates a calendar.
694
759
 
760
+ `title` is required. `color` is optional and defaults to `#007AFF`.
761
+ On Android, `accountName` and `ownerAccount` are required at runtime.
762
+
695
763
  | Param | Type |
696
764
  | ------------- | ----------------------------------------------------------------------- |
697
765
  | **`options`** | <code><a href="#createcalendaroptions">CreateCalendarOptions</a></code> |
698
766
 
699
- **Returns:** <code>Promise&lt;{ id: string; }&gt;</code>
767
+ **Returns:** <code>Promise&lt;<a href="#createcalendarresult">CreateCalendarResult</a>&gt;</code>
700
768
 
701
769
  **Since:** 5.2.0
702
770
 
@@ -1016,6 +1084,24 @@ Update a reminders list with options.
1016
1084
  ### Interfaces
1017
1085
 
1018
1086
 
1087
+ #### CheckPermissionOptions
1088
+
1089
+ Options for {@link CalendarAccess#checkPermission}.
1090
+
1091
+ | Prop | Type | Description | Since | Platform |
1092
+ | ----------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1093
+ | **`scope`** | <code><a href="#calendarpermissionscope">CalendarPermissionScope</a></code> | The permission scope to check. On Android, `readReminders` and `writeReminders` resolve to `"prompt"` (reminders are not supported on Android). | 8.3.1 | Android, iOS |
1094
+
1095
+
1096
+ #### RequestPermissionOptions
1097
+
1098
+ Options for {@link CalendarAccess#requestPermission}.
1099
+
1100
+ | Prop | Type | Description | Since | Platform |
1101
+ | ----------- | --------------------------------------------------------------------------- | -------------------------------- | ----- | ------------ |
1102
+ | **`scope`** | <code><a href="#calendarpermissionscope">CalendarPermissionScope</a></code> | The permission scope to request. | 8.3.1 | Android, iOS |
1103
+
1104
+
1019
1105
  #### CreateEventWithPromptOptions
1020
1106
 
1021
1107
  | Prop | Type | Description | Since | Platform |
@@ -1131,30 +1217,35 @@ Update a reminders list with options.
1131
1217
 
1132
1218
  #### DeleteEventsByIdOptions
1133
1219
 
1134
- | Prop | Type | Description | Default | Since | Platform |
1135
- | ---------- | ----------------------------------------------- | --------------------- | --------------------------------- | ----- | -------- |
1136
- | **`ids`** | <code>string[]</code> | | | 7.1.0 | |
1137
- | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | The span of deletion. | <code>EventSpan.THIS_EVENT</code> | | iOS |
1220
+ | Prop | Type | Description | Default | Since | Platform |
1221
+ | ------------ | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1222
+ | **`commit`** | <code>boolean</code> | Whether to save the deletion to the event store immediately. Pass `false` to batch multiple changes and commit them together using `CapacitorCalendar.commit()`, which is more efficient than committing each save individually. | <code>true</code> | 8.3.0 | iOS |
1223
+ | **`ids`** | <code>string[]</code> | | | 7.1.0 | |
1224
+ | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | How much of a recurring series to delete. On Android, `THIS_EVENT` cannot target a single recurring occurrence here — use `deleteEvent` with `instanceDate`. Those ids are reported in `failed`. | <code>EventSpan.THIS_EVENT</code> | 7.1.0 | Android, iOS |
1138
1225
 
1139
1226
 
1140
1227
  #### DeleteEventOptions
1141
1228
 
1142
- | Prop | Type | Description | Default | Since | Platform |
1143
- | ---------- | ----------------------------------------------- | --------------------- | --------------------------------- | ----- | -------- |
1144
- | **`id`** | <code>string</code> | | | 7.1.0 | |
1145
- | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | The span of deletion. | <code>EventSpan.THIS_EVENT</code> | | iOS |
1229
+ | Prop | Type | Description | Default | Since | Platform |
1230
+ | ------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1231
+ | **`commit`** | <code>boolean</code> | Whether to save the deletion to the event store immediately. Pass `false` to batch multiple changes and commit them together using `CapacitorCalendar.commit()`, which is more efficient than committing each save individually. | <code>true</code> | 8.3.0 | iOS |
1232
+ | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1233
+ | **`instanceDate`** | <code>number</code> | The start time of the occurrence to delete, in milliseconds since the epoch. Use `startDate` from `listEventsInRange`. On Android, required for `THIS_EVENT` on recurring events. If omitted with `THIS_AND_FUTURE_EVENTS`, the whole series is deleted. | | 8.3.0 | Android |
1234
+ | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | How much of a recurring series to delete. | <code>EventSpan.THIS_EVENT</code> | 7.1.0 | Android, iOS |
1146
1235
 
1147
1236
 
1148
1237
  #### DeleteEventWithPromptOptions
1149
1238
 
1150
- | Prop | Type | Description | Default | Since | Platform |
1151
- | ----------------------- | ----------------------------------------------- | ----------------------------------- | --------------------------------- | ----- | ------------ |
1152
- | **`id`** | <code>string</code> | | | 7.1.0 | |
1153
- | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | The span of deletion. | <code>EventSpan.THIS_EVENT</code> | | iOS |
1154
- | **`title`** | <code>string</code> | Title of the dialog. | | 7.1.0 | Android, iOS |
1155
- | **`message`** | <code>string</code> | Message of the dialog. | | 7.1.0 | Android, iOS |
1156
- | **`confirmButtonText`** | <code>string</code> | Text to show on the confirm button. | <code>'Delete'</code> | 7.1.0 | Android, iOS |
1157
- | **`cancelButtonText`** | <code>string</code> | Text to show on the cancel button. | <code>'Cancel'</code> | 7.1.0 | Android, iOS |
1239
+ | Prop | Type | Description | Default | Since | Platform |
1240
+ | ----------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1241
+ | **`cancelButtonText`** | <code>string</code> | Text to show on the cancel button. | <code>'Cancel'</code> | 7.1.0 | Android, iOS |
1242
+ | **`commit`** | <code>boolean</code> | Whether to save the deletion to the event store immediately. Pass `false` to batch multiple changes and commit them together using `CapacitorCalendar.commit()`, which is more efficient than committing each save individually. | <code>true</code> | 8.3.0 | iOS |
1243
+ | **`confirmButtonText`** | <code>string</code> | Text to show on the confirm button. | <code>'Delete'</code> | 7.1.0 | Android, iOS |
1244
+ | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1245
+ | **`instanceDate`** | <code>number</code> | The start time of the occurrence to delete, in milliseconds since the epoch. Use `startDate` from `listEventsInRange`. On Android, required for `THIS_EVENT` on recurring events. If omitted with `THIS_AND_FUTURE_EVENTS`, the whole series is deleted. | | 8.3.0 | Android |
1246
+ | **`message`** | <code>string</code> | Message of the dialog. | | 7.1.0 | Android, iOS |
1247
+ | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | How much of a recurring series to delete. | <code>EventSpan.THIS_EVENT</code> | 7.1.0 | Android, iOS |
1248
+ | **`title`** | <code>string</code> | Title of the dialog. | | 7.1.0 | Android, iOS |
1158
1249
 
1159
1250
 
1160
1251
  #### CalendarEvent
@@ -1186,39 +1277,46 @@ Update a reminders list with options.
1186
1277
 
1187
1278
  #### ListEventsInRangeOptions
1188
1279
 
1189
- | Prop | Type | Description | Since |
1190
- | ---------- | ------------------- | ------------------------------ | ----- |
1191
- | **`from`** | <code>number</code> | The timestamp in milliseconds. | 7.1.0 |
1192
- | **`to`** | <code>number</code> | The timestamp in milliseconds. | 7.1.0 |
1280
+ | Prop | Type | Description | Since |
1281
+ | ---------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
1282
+ | **`from`** | <code>number</code> | The start of the range, in milliseconds since the epoch. Events still in progress at this time are included. | 7.1.0 |
1283
+ | **`to`** | <code>number</code> | The end of the range, in milliseconds since the epoch. Events that begin at or after this time are typically excluded; prefer the next day's start when querying a single calendar day. | 7.1.0 |
1284
+
1285
+
1286
+ #### SelectCalendarsWithPromptResult
1287
+
1288
+ | Prop | Type | Description | Since | Platform |
1289
+ | ------------ | ----------------------- | ------------------------------------------------------------------------- | ----- | -------- |
1290
+ | **`result`** | <code>Calendar[]</code> | Calendars the user confirmed in the chooser. Empty when the user cancels. | 8.4.0 | iOS |
1193
1291
 
1194
1292
 
1195
1293
  #### Calendar
1196
1294
 
1197
- | Prop | Type | Description | Since | Platform |
1198
- | -------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------ | ----- | ------------ |
1199
- | **`id`** | <code>string</code> | | 7.1.0 | Android, iOS |
1200
- | **`title`** | <code>string</code> | | 7.1.0 | Android, iOS |
1201
- | **`internalTitle`** | <code>string \| null</code> | Internal name of the calendar (`CalendarContract.Calendars.NAME`). | 7.1.0 | Android |
1202
- | **`color`** | <code>string</code> | | 7.1.0 | Android, iOS |
1203
- | **`isImmutable`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1204
- | **`allowsContentModifications`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1205
- | **`type`** | <code><a href="#calendartype">CalendarType</a> \| null</code> | | 7.1.0 | iOS |
1206
- | **`isSubscribed`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1207
- | **`source`** | <code><a href="#calendarsource">CalendarSource</a> \| null</code> | | 7.1.0 | iOS |
1208
- | **`visible`** | <code>boolean \| null</code> | Indicates if the events from this calendar should be shown. | 7.1.0 | Android |
1209
- | **`accountName`** | <code>string \| null</code> | The account under which the calendar is registered. | 7.1.0 | Android |
1210
- | **`ownerAccount`** | <code>string \| null</code> | The owner of the calendar. | 7.1.0 | Android |
1211
- | **`maxReminders`** | <code>number \| null</code> | Maximum number of reminders allowed per event. | 7.1.0 | Android |
1212
- | **`location`** | <code>string \| null</code> | | 7.1.0 | Android |
1295
+ | Prop | Type | Description | Since | Platform |
1296
+ | -------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1297
+ | **`id`** | <code>string</code> | | 7.1.0 | Android, iOS |
1298
+ | **`title`** | <code>string \| null</code> | Display title of the calendar. May be `null` when the platform does not provide a title. | 7.1.0 | Android, iOS |
1299
+ | **`internalTitle`** | <code>string \| null</code> | Internal name of the calendar (`CalendarContract.Calendars.NAME`). | 7.1.0 | Android |
1300
+ | **`color`** | <code>string \| null</code> | <a href="#calendar">Calendar</a> color as a hex string. Format: `#RRGGBB` when opaque; `#RRGGBBAA` when alpha is below fully opaque. May be `null` when the platform does not provide a color. | 7.1.0 | Android, iOS |
1301
+ | **`isImmutable`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1302
+ | **`allowsContentModifications`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1303
+ | **`type`** | <code><a href="#calendartype">CalendarType</a> \| null</code> | | 7.1.0 | iOS |
1304
+ | **`isSubscribed`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1305
+ | **`source`** | <code><a href="#calendarsource">CalendarSource</a> \| null</code> | | 7.1.0 | iOS |
1306
+ | **`visible`** | <code>boolean \| null</code> | Indicates if the events from this calendar should be shown. | 7.1.0 | Android |
1307
+ | **`accountName`** | <code>string \| null</code> | The account under which the calendar is registered. | 7.1.0 | Android |
1308
+ | **`ownerAccount`** | <code>string \| null</code> | The owner of the calendar. | 7.1.0 | Android |
1309
+ | **`maxReminders`** | <code>number \| null</code> | Maximum number of reminders allowed per event. | 7.1.0 | Android |
1310
+ | **`location`** | <code>string \| null</code> | | 7.1.0 | Android |
1213
1311
 
1214
1312
 
1215
1313
  #### CalendarSource
1216
1314
 
1217
- | Prop | Type | Since |
1218
- | ----------- | ----------------------------------------------------------------- | ----- |
1219
- | **`type`** | <code><a href="#calendarsourcetype">CalendarSourceType</a></code> | 7.1.0 |
1220
- | **`id`** | <code>string</code> | 7.1.0 |
1221
- | **`title`** | <code>string</code> | 7.1.0 |
1315
+ | Prop | Type | Since | Platform |
1316
+ | ----------- | ----------------------------------------------------------------- | ----- | -------- |
1317
+ | **`type`** | <code><a href="#calendarsourcetype">CalendarSourceType</a></code> | 7.1.0 | iOS |
1318
+ | **`id`** | <code>string</code> | 7.1.0 | iOS |
1319
+ | **`title`** | <code>string</code> | 7.1.0 | iOS |
1222
1320
 
1223
1321
 
1224
1322
  #### SelectCalendarsWithPromptOptions
@@ -1229,38 +1327,66 @@ Update a reminders list with options.
1229
1327
  | **`multiple`** | <code>boolean</code> | Allow multiple selections. | <code>false</code> | 7.1.0 |
1230
1328
 
1231
1329
 
1330
+ #### FetchAllCalendarSourcesResult
1331
+
1332
+ | Prop | Type | Description | Since | Platform |
1333
+ | ------------ | ----------------------------- | -------------------------------------------------- | ----- | -------- |
1334
+ | **`result`** | <code>CalendarSource[]</code> | All calendar sources (accounts) known to EventKit. | 8.4.0 | iOS |
1335
+
1336
+
1337
+ #### ListCalendarsResult
1338
+
1339
+ | Prop | Type | Description | Since | Platform |
1340
+ | ------------ | ----------------------- | ------------------------ | ----- | ------------ |
1341
+ | **`result`** | <code>Calendar[]</code> | All available calendars. | 8.4.0 | Android, iOS |
1342
+
1343
+
1344
+ #### GetDefaultCalendarOptions
1345
+
1346
+ | Prop | Type | Description | Default | Since | Platform |
1347
+ | ------------------------- | -------------------- | --------------------------------------------------------------------------- | ------------------ | ----- | ------------ |
1348
+ | **`useFallbackCalendar`** | <code>boolean</code> | When there is no system default calendar, use the first available calendar. | <code>false</code> | 8.4.0 | Android, iOS |
1349
+
1350
+
1232
1351
  #### OpenCalendarOptions
1233
1352
 
1234
- | Prop | Type | Default | Since |
1235
- | ---------- | ------------------- | ----------------------- | ----- |
1236
- | **`date`** | <code>number</code> | <code>Date.now()</code> | 7.1.0 |
1353
+ | Prop | Type | Description | Default | Since | Platform |
1354
+ | ---------- | ------------------- | ------------------------------------------------------------------ | ----------------------- | ----- | ------------ |
1355
+ | **`date`** | <code>number</code> | The date to open the calendar at, in milliseconds since the epoch. | <code>Date.now()</code> | 7.1.0 | Android, iOS |
1356
+
1357
+
1358
+ #### CreateCalendarResult
1359
+
1360
+ | Prop | Type | Description | Since | Platform |
1361
+ | -------- | ------------------- | ----------------------------------------- | ----- | ------------ |
1362
+ | **`id`** | <code>string</code> | Identifier of the newly created calendar. | 8.4.0 | Android, iOS |
1237
1363
 
1238
1364
 
1239
1365
  #### CreateCalendarOptions
1240
1366
 
1241
- | Prop | Type | Description | Since | Platform |
1242
- | ------------------ | ------------------- | ---------------------------------------------------------- | ----- | ------------ |
1243
- | **`title`** | <code>string</code> | | 5.2.0 | Android, iOS |
1244
- | **`color`** | <code>string</code> | The color of the calendar. Should be provided on Android. | 5.2.0 | Android, iOS |
1245
- | **`sourceId`** | <code>string</code> | | 5.2.0 | iOS |
1246
- | **`accountName`** | <code>string</code> | Only needed on Android. Typically set to an email address. | 7.1.0 | Android |
1247
- | **`ownerAccount`** | <code>string</code> | Only needed on Android. Typically set to an email address. | 7.1.0 | Android |
1367
+ | Prop | Type | Description | Default | Since | Platform |
1368
+ | ------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----- | ------------ |
1369
+ | **`title`** | <code>string</code> | | | 5.2.0 | Android, iOS |
1370
+ | **`color`** | <code>string</code> | The color of the calendar as `#RRGGBB` or `#RRGGBBAA`. When omitted, Android and iOS use `#007AFF` (light-mode iOS system blue). | <code>#007AFF</code> | 5.2.0 | Android, iOS |
1371
+ | **`sourceId`** | <code>string</code> | The EventKit source (account) where the calendar should be created. If provided, it must match an existing source from `fetchAllCalendarSources()`. If omitted, iCloud is used when available, otherwise the local source. | | 5.2.0 | iOS |
1372
+ | **`accountName`** | <code>string</code> | The account under which the calendar is registered. Required on Android. Typically an email address. | | 7.1.0 | Android |
1373
+ | **`ownerAccount`** | <code>string</code> | The owner of the calendar. Required on Android. Typically an email address. | | 7.1.0 | Android |
1248
1374
 
1249
1375
 
1250
1376
  #### DeleteCalendarOptions
1251
1377
 
1252
- | Prop | Type | Since |
1253
- | -------- | ------------------- | ----- |
1254
- | **`id`** | <code>string</code> | 7.1.0 |
1378
+ | Prop | Type | Since | Platform |
1379
+ | -------- | ------------------- | ----- | ------------ |
1380
+ | **`id`** | <code>string</code> | 7.1.0 | Android, iOS |
1255
1381
 
1256
1382
 
1257
1383
  #### ModifyCalendarOptions
1258
1384
 
1259
- | Prop | Type | Since | Platform |
1260
- | ----------- | ------------------- | ----- | ------------ |
1261
- | **`id`** | <code>string</code> | 7.2.0 | Android, iOS |
1262
- | **`title`** | <code>string</code> | 7.2.0 | Android, iOS |
1263
- | **`color`** | <code>string</code> | 7.2.0 | Android, iOS |
1385
+ | Prop | Type | Description | Since | Platform |
1386
+ | ----------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1387
+ | **`id`** | <code>string</code> | | 7.2.0 | Android, iOS |
1388
+ | **`title`** | <code>string</code> | Display title of the calendar. On Android this updates both `CALENDAR_DISPLAY_NAME` (`title`) and `Calendars.NAME` (`internalTitle`). | 7.2.0 | Android, iOS |
1389
+ | **`color`** | <code>string</code> | The color of the calendar as `#RRGGBB` or `#RRGGBBAA`. | 7.2.0 | Android, iOS |
1264
1390
 
1265
1391
 
1266
1392
  #### CreateRemindersListResult
@@ -1462,12 +1588,12 @@ Construct a type with a set of properties K of type T
1462
1588
 
1463
1589
  #### CalendarPermissionScope
1464
1590
 
1465
- | Members | Value | Description | Since | Platform |
1466
- | --------------------- | ----------------------------- | ------------------------------------------------------------ | ----- | ------------ |
1467
- | **`READ_CALENDAR`** | <code>'readCalendar'</code> | Permission required for reading calendar events. | 7.1.0 | Android, iOS |
1468
- | **`READ_REMINDERS`** | <code>'readReminders'</code> | Permission required for reading reminders. | 7.1.0 | iOS |
1469
- | **`WRITE_CALENDAR`** | <code>'writeCalendar'</code> | Permission required for adding or modifying calendar events. | 7.1.0 | Android, iOS |
1470
- | **`WRITE_REMINDERS`** | <code>'writeReminders'</code> | Permission required for adding or modifying reminders. | 7.1.0 | iOS |
1591
+ | Members | Value | Description | Since | Platform |
1592
+ | --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1593
+ | **`READ_CALENDAR`** | <code>'readCalendar'</code> | Permission required for reading calendar events. | 7.1.0 | Android, iOS |
1594
+ | **`READ_REMINDERS`** | <code>'readReminders'</code> | Permission required for reading reminders. On Android, reminders are not supported. `checkPermission` and `checkAllPermissions` return `"prompt"` for this scope. `requestPermission` rejects with `Invalid scope.`. | 7.1.0 | iOS |
1595
+ | **`WRITE_CALENDAR`** | <code>'writeCalendar'</code> | Permission required for adding or modifying calendar events. | 7.1.0 | Android, iOS |
1596
+ | **`WRITE_REMINDERS`** | <code>'writeReminders'</code> | Permission required for adding or modifying reminders. On Android, reminders are not supported. `checkPermission` and `checkAllPermissions` return `"prompt"` for this scope. `requestPermission` rejects with `Invalid scope.`. | 7.1.0 | iOS |
1471
1597
 
1472
1598
 
1473
1599
  #### EventAvailability
@@ -1483,10 +1609,10 @@ Construct a type with a set of properties K of type T
1483
1609
 
1484
1610
  #### EventSpan
1485
1611
 
1486
- | Members | Since |
1487
- | ---------------------------- | ----- |
1488
- | **`THIS_EVENT`** | 7.1.0 |
1489
- | **`THIS_AND_FUTURE_EVENTS`** | 7.1.0 |
1612
+ | Members | Description | Since |
1613
+ | ---------------------------- | --------------------------------------------------------------- | ----- |
1614
+ | **`THIS_EVENT`** | Only the identified event or occurrence. | 7.1.0 |
1615
+ | **`THIS_AND_FUTURE_EVENTS`** | The identified occurrence and future occurrences in the series. | 7.1.0 |
1490
1616
 
1491
1617
 
1492
1618
  #### EventStatus