@ebarooni/capacitor-calendar 8.10.0 → 8.12.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 (116) hide show
  1. package/README.md +372 -156
  2. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +55 -0
  3. package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +4 -0
  4. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CalendarChangeObserver.kt +181 -0
  5. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +184 -8
  6. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventDeleteInfo.kt +6 -0
  7. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventRecurrenceRule.kt +4 -3
  8. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/GetEventByIdInput.kt +13 -0
  9. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ListEventsInRangeInput.kt +5 -0
  10. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/StartListeningInput.kt +20 -0
  11. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/GetEventByIdResult.kt +15 -0
  12. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListEventsInRangeResult.kt +47 -43
  13. package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +123 -69
  14. package/dist/docs.json +1594 -989
  15. package/dist/esm/definitions.d.ts +2 -1
  16. package/dist/esm/definitions.js.map +1 -1
  17. package/dist/esm/index.d.ts +15 -2
  18. package/dist/esm/index.js +4 -1
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/schemas/enums/capacitor-calendar-error-code.d.ts +2 -2
  21. package/dist/esm/schemas/enums/capacitor-calendar-error-code.js +2 -2
  22. package/dist/esm/schemas/enums/capacitor-calendar-error-code.js.map +1 -1
  23. package/dist/esm/schemas/interfaces/calendar-changed-event.d.ts +52 -0
  24. package/dist/esm/schemas/interfaces/calendar-changed-event.js +2 -0
  25. package/dist/esm/schemas/interfaces/calendar-changed-event.js.map +1 -0
  26. package/dist/esm/schemas/interfaces/calendar-links.d.ts +32 -0
  27. package/dist/esm/schemas/interfaces/calendar-links.js +2 -0
  28. package/dist/esm/schemas/interfaces/calendar-links.js.map +1 -0
  29. package/dist/esm/schemas/interfaces/create-event-options.d.ts +18 -0
  30. package/dist/esm/schemas/interfaces/create-event-options.js.map +1 -1
  31. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.d.ts +9 -0
  32. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.js.map +1 -1
  33. package/dist/esm/schemas/interfaces/create-ics-file-options.d.ts +20 -0
  34. package/dist/esm/schemas/interfaces/create-ics-file-options.js +2 -0
  35. package/dist/esm/schemas/interfaces/create-ics-file-options.js.map +1 -0
  36. package/dist/esm/schemas/interfaces/delete-event-options.d.ts +2 -1
  37. package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -1
  38. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +2 -1
  39. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -1
  40. package/dist/esm/schemas/interfaces/get-event-by-id-options.d.ts +11 -0
  41. package/dist/esm/schemas/interfaces/get-event-by-id-options.js +2 -0
  42. package/dist/esm/schemas/interfaces/get-event-by-id-options.js.map +1 -0
  43. package/dist/esm/schemas/interfaces/get-event-by-id-result.d.ts +13 -0
  44. package/dist/esm/schemas/interfaces/get-event-by-id-result.js +2 -0
  45. package/dist/esm/schemas/interfaces/get-event-by-id-result.js.map +1 -0
  46. package/dist/esm/schemas/interfaces/list-events-in-range-options.d.ts +8 -0
  47. package/dist/esm/schemas/interfaces/list-events-in-range-options.js.map +1 -1
  48. package/dist/esm/schemas/interfaces/modify-event-options.d.ts +11 -0
  49. package/dist/esm/schemas/interfaces/modify-event-options.js.map +1 -1
  50. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.d.ts +10 -0
  51. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js.map +1 -1
  52. package/dist/esm/schemas/interfaces/open-calendar-options.d.ts +9 -0
  53. package/dist/esm/schemas/interfaces/open-calendar-options.js.map +1 -1
  54. package/dist/esm/schemas/interfaces/share-ics-file-options.d.ts +17 -0
  55. package/dist/esm/schemas/interfaces/share-ics-file-options.js +2 -0
  56. package/dist/esm/schemas/interfaces/share-ics-file-options.js.map +1 -0
  57. package/dist/esm/schemas/interfaces/start-listening-options.d.ts +46 -0
  58. package/dist/esm/schemas/interfaces/start-listening-options.js +2 -0
  59. package/dist/esm/schemas/interfaces/start-listening-options.js.map +1 -0
  60. package/dist/esm/schemas/types/calendar-day-view-provider.d.ts +7 -0
  61. package/dist/esm/schemas/types/calendar-day-view-provider.js +2 -0
  62. package/dist/esm/schemas/types/calendar-day-view-provider.js.map +1 -0
  63. package/dist/esm/schemas/types/calendar-link-provider.d.ts +6 -0
  64. package/dist/esm/schemas/types/calendar-link-provider.js +2 -0
  65. package/dist/esm/schemas/types/calendar-link-provider.js.map +1 -0
  66. package/dist/esm/sub-definitions/calendar-listening.d.ts +49 -0
  67. package/dist/esm/sub-definitions/calendar-listening.js +2 -0
  68. package/dist/esm/sub-definitions/calendar-listening.js.map +1 -0
  69. package/dist/esm/sub-definitions/calendar-operations.d.ts +2 -1
  70. package/dist/esm/sub-definitions/calendar-operations.js.map +1 -1
  71. package/dist/esm/sub-definitions/event-operations.d.ts +33 -0
  72. package/dist/esm/sub-definitions/event-operations.js.map +1 -1
  73. package/dist/esm/web/calendar-links.d.ts +26 -0
  74. package/dist/esm/web/calendar-links.js +114 -0
  75. package/dist/esm/web/calendar-links.js.map +1 -0
  76. package/dist/esm/web/create-ics-file.d.ts +21 -0
  77. package/dist/esm/web/create-ics-file.js +30 -0
  78. package/dist/esm/web/create-ics-file.js.map +1 -0
  79. package/dist/esm/web/ics.d.ts +11 -0
  80. package/dist/esm/web/ics.js +48 -32
  81. package/dist/esm/web/ics.js.map +1 -1
  82. package/dist/esm/web/share-ics-file.d.ts +21 -0
  83. package/dist/esm/web/share-ics-file.js +46 -0
  84. package/dist/esm/web/share-ics-file.js.map +1 -0
  85. package/dist/esm/web.d.ts +7 -1
  86. package/dist/esm/web.js +21 -4
  87. package/dist/esm/web.js.map +1 -1
  88. package/dist/plugin.cjs.js +295 -72
  89. package/dist/plugin.cjs.js.map +1 -1
  90. package/dist/plugin.js +295 -72
  91. package/dist/plugin.js.map +1 -1
  92. package/ios/Plugin/CapacitorCalendarPlugin.swift +36 -1
  93. package/ios/Plugin/Implementation/CalendarChangeObserver.swift +259 -0
  94. package/ios/Plugin/Implementation/CapacitorCalendar.swift +56 -8
  95. package/ios/Plugin/Models/Inputs/CreateEventInput.swift +1 -1
  96. package/ios/Plugin/Models/Inputs/CreateEventWithPromptInput.swift +61 -70
  97. package/ios/Plugin/Models/Inputs/DeleteEventInput.swift +7 -0
  98. package/ios/Plugin/Models/Inputs/DeleteEventWithPromptInput.swift +7 -0
  99. package/ios/Plugin/Models/Inputs/DeleteReminderInput.swift +1 -1
  100. package/ios/Plugin/Models/Inputs/DeleteReminderWithPromptInput.swift +1 -1
  101. package/ios/Plugin/Models/Inputs/DeleteRemindersListInput.swift +1 -1
  102. package/ios/Plugin/Models/Inputs/GetEventByIdInput.swift +16 -0
  103. package/ios/Plugin/Models/Inputs/GetReminderByIdInput.swift +1 -1
  104. package/ios/Plugin/Models/Inputs/ListEventsInRangeInput.swift +20 -0
  105. package/ios/Plugin/Models/Inputs/ModifyEventInput.swift +13 -23
  106. package/ios/Plugin/Models/Inputs/ModifyEventWithPromptInput.swift +10 -5
  107. package/ios/Plugin/Models/Inputs/ModifyReminderInput.swift +1 -1
  108. package/ios/Plugin/Models/Inputs/StartListeningInput.swift +26 -0
  109. package/ios/Plugin/Models/Inputs/UpdateRemindersListInput.swift +1 -1
  110. package/ios/Plugin/Models/Results/GetEventByIdResult.swift +27 -0
  111. package/ios/Plugin/Models/Structs/RecurrenceInput.swift +14 -0
  112. package/ios/Plugin/PluginConfig.swift +3 -0
  113. package/ios/Plugin/PluginError.swift +32 -3
  114. package/ios/Plugin/Utils/ImplementationHelper.swift +49 -32
  115. package/ios/Plugin/Utils/PluginCallRejecter.swift +13 -0
  116. package/package.json +1 -1
package/README.md CHANGED
@@ -44,18 +44,18 @@
44
44
 
45
45
  ## Features and Platforms
46
46
 
47
- | Capability | iOS | Android | Web |
48
- | :------------------------------------------------ | :-: | :-----: | :-----------: |
49
- | Create, update, and delete events | ✅ | ✅ | Create only\* |
50
- | Native prompts to create, edit, and delete events | ✅ | ✅ | Create only\* |
51
- | List events in a date range | ✅ | ✅ | – |
52
- | Request calendar permissions | ✅ | ✅ | – |
53
- | List, create, modify, and delete calendars | ✅ | ✅ | – |
54
- | Open the native Calendar app | ✅ | ✅ | – |
55
- | Calendar sources and a calendar picker prompt | ✅ | – | – |
56
- | Reminders and reminder lists | ✅ | – | – |
57
-
58
- \* On the web, `createEvent` and `createEventWithPrompt` return a downloadable `.ics` file. They do not write to a device calendar. See [Create and download an event on the web](#create-and-download-an-event-on-the-web).
47
+ | Capability | iOS | Android | Web |
48
+ | :------------------------------------------------ | :-: | :-----: | :------------: |
49
+ | Create, update, and delete events | ✅ | ✅ | Create only\* |
50
+ | Native prompts to create, edit, and delete events | ✅ | ✅ | Create only\* |
51
+ | List events in a date range | ✅ | ✅ | – |
52
+ | Request calendar permissions | ✅ | ✅ | – |
53
+ | List, create, modify, and delete calendars | ✅ | ✅ | – |
54
+ | Open the native Calendar app | ✅ | ✅ | Web calendar\* |
55
+ | Calendar sources and a calendar picker prompt | ✅ | – | – |
56
+ | Reminders and reminder lists | ✅ | – | – |
57
+
58
+ \* On the web, `createEvent` and `createEventWithPrompt` return a downloadable `.ics` file. They do not write to a device calendar. `openCalendar({ provider })` opens a web calendar in a new tab. See [Create and download an event on the web](#create-and-download-an-event-on-the-web).
59
59
 
60
60
  ## Demo
61
61
 
@@ -169,11 +169,11 @@ Defined codes:
169
169
 
170
170
  Android rejects a non-numeric or empty calendar or event `id` as `InvalidArgument`. iOS looks up the string in the system calendar store and may reject as `NotFound` when nothing matches.
171
171
 
172
- `IoError`: Android and iOS map store failures such as failed create/delete ID retrieval and delete failures. Other calendar store errors that are not permission or launch failures also use this code. On iOS, EventKit store or system rejects use this code, including some authorization-related failures; Android permission-provider denials still use `PermissionDenied` (`EB-CLDR-0020`). On iOS, this code also covers the edit-prompt `processFailed` outcome.
172
+ `IoError`: Android and iOS map store failures such as failed create/delete ID retrieval and delete failures. Other calendar store errors that are not permission or launch failures also use this code. On iOS, EventKit store or system rejects use this code, except an EventKit authorization denial, which uses `PermissionDenied` (`EB-CLDR-0020`). On iOS, an unhandled permission status also uses this code. On iOS, this code also covers the edit-prompt `processFailed` outcome.
173
173
 
174
- `NotSupported`: Android maps a missing calendar activity handler (`ActivityNotFoundException`, for example `openCalendar`) to this code. iOS maps launch and URL failures (`Failed to launch calendar app.`, reminders, `Unable to open URL.`).
174
+ `NotSupported`: Android maps a missing calendar activity handler (`ActivityNotFoundException`, for example `openCalendar`) to this code. iOS maps launch and URL failures (`Failed to launch calendar app.`, reminders, `Unable to open URL.`). iOS also uses this code for a missing view controller and a calendar chooser that is already open.
175
175
 
176
- On Android, calendar operations that fail with a permission error reject with `PermissionDenied` (`EB-CLDR-0020`). Permission check and request APIs still resolve `"denied"` on Android and iOS; they do not reject with `0020`.
176
+ On Android and iOS, calendar operations that fail with a permission error reject with `PermissionDenied` (`EB-CLDR-0020`). On iOS, this applies when EventKit reports `eventStoreNotAuthorized`. Permission check and request APIs still resolve `"denied"` on Android and iOS; they do not reject with `0020`.
177
177
 
178
178
  For Android and iOS wraps of system store, launch, and permission failures, the message starts with a fixed sentence. If the OS provides a different detail, it is appended in parentheses.
179
179
 
@@ -229,6 +229,28 @@ const { ics } = await CapacitorCalendar.createEvent({
229
229
  });
230
230
  ```
231
231
 
232
+ #### Share the file, or open a web calendar
233
+
234
+ ```typescript
235
+ import { CapacitorCalendar, createIcsFile, getCalendarLinks, shareIcsFile } from '@ebarooni/capacitor-calendar';
236
+
237
+ const event = { title: 'Team standup', startDate: Date.now() + 60 * 60 * 1000, uid: 'standup-1' };
238
+
239
+ // Open the share sheet from a click. Build the file synchronously so the click still counts.
240
+ // The file downloads when the browser cannot share .ics files (for example Chrome).
241
+ await shareIcsFile(createIcsFile(event));
242
+
243
+ // Links open a web calendar with the event filled in. The user confirms there.
244
+ const { google, outlook, office365, yahoo } = getCalendarLinks(event);
245
+ window.open(google, '_blank', 'noopener');
246
+
247
+ // Cancel an event that the user imported before
248
+ const cancelFile = createIcsFile({ ...event, sequence: 1 }, { method: 'CANCEL' });
249
+
250
+ // Open the day view of a web calendar
251
+ await CapacitorCalendar.openCalendar({ provider: 'google', date: event.startDate });
252
+ ```
253
+
232
254
  ### Open the native event editor
233
255
 
234
256
  Use the system calendar UI to let users create or edit events (on Web: confirm dialog + ICS):
@@ -304,6 +326,43 @@ const targetCalendarId = defaultCalendar?.id ?? calendars[0]?.id;
304
326
  > [!NOTE]
305
327
  > On iOS you can also use `selectCalendarsWithPrompt()` to let the user pick calendars via the native interface.
306
328
 
329
+ ### Listen for calendar changes (Android and iOS)
330
+
331
+ ```typescript
332
+ const handle = await CapacitorCalendar.addListener('calendarChanged', (change) => {
333
+ if (!change.precise) {
334
+ // Something changed, but the plugin could not find what. Read the data again.
335
+ return;
336
+ }
337
+ console.log(change.created, change.updated, change.deletedIds, change.calendarsChanged);
338
+ });
339
+
340
+ const from = Date.now();
341
+ await CapacitorCalendar.startListening({ from, to: from + 30 * 24 * 60 * 60 * 1000 });
342
+
343
+ // Later:
344
+ await CapacitorCalendar.stopListening();
345
+ await handle.remove();
346
+ ```
347
+
348
+ How it works:
349
+
350
+ - The plugin reads the window once as a baseline. After each change it reads the window again and compares. The listener gets only the difference. The baseline itself sends nothing.
351
+ - Only fields with a change are present. An event that moves out of the window is reported in `deletedIds`. A change outside the window is not reported.
352
+ - Changes made by this plugin also trigger the listener. Changes made while the app is stopped are not sent.
353
+ - `remindersChanged` needs `includeReminders: true` and is iOS only. It is a signal only and best effort.
354
+ - Use a window of a few months. A large window makes each check slower.
355
+ - On the web, `startListening` and `stopListening` are unimplemented.
356
+
357
+ Lifecycle:
358
+
359
+ - Call `startListening` again to change the window or options. It replaces the previous watch, keeps one native observer, and sends no difference for the change of window.
360
+ - `stopListening` stops the watch and removes the pending work and the snapshot. It does nothing when no watch is active. It keeps your listeners.
361
+ - All listeners share one observer. Each listener gets every event.
362
+ - `removeAllListeners` ends the watch. On Android it ends at once. On iOS it ends at the next calendar change, and sends nothing.
363
+ - The watch also ends when the plugin is destroyed.
364
+ - Calls to `startListening` made before `addListener` lose no events, because the observer waits for the first listener.
365
+
307
366
  ### Create a Reminder (iOS only)
308
367
 
309
368
  ```typescript
@@ -344,6 +403,10 @@ See [BREAKING.md](BREAKING.md) for breaking changes and migration steps.
344
403
  - [`requestWriteOnlyCalendarAccess()`](#requestwriteonlycalendaraccess)
345
404
  - [`requestReadOnlyCalendarAccess()`](#requestreadonlycalendaraccess)
346
405
  - [`requestFullCalendarAccess()`](#requestfullcalendaraccess)
406
+ - [`startListening(...)`](#startlistening)
407
+ - [`stopListening()`](#stoplistening)
408
+ - [`addListener('calendarChanged', ...)`](#addlistenercalendarchanged-)
409
+ - [`removeAllListeners()`](#removealllisteners)
347
410
  - [`requestFullRemindersAccess()`](#requestfullremindersaccess)
348
411
  - [`createEventWithPrompt(...)`](#createeventwithprompt)
349
412
  - [`modifyEventWithPrompt(...)`](#modifyeventwithprompt)
@@ -353,6 +416,7 @@ See [BREAKING.md](BREAKING.md) for breaking changes and migration steps.
353
416
  - [`deleteEvent(...)`](#deleteevent)
354
417
  - [`deleteEventWithPrompt(...)`](#deleteeventwithprompt)
355
418
  - [`listEventsInRange(...)`](#listeventsinrange)
419
+ - [`getEventById(...)`](#geteventbyid)
356
420
  - [`commit()`](#commit)
357
421
  - [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt)
358
422
  - [`fetchAllCalendarSources()`](#fetchallcalendarsources)
@@ -509,6 +573,78 @@ Requests read and write access to the calendar.
509
573
 
510
574
  ---
511
575
 
576
+ ### startListening(...)
577
+
578
+ ```typescript
579
+ startListening(options: StartListeningOptions) => Promise<void>
580
+ ```
581
+
582
+ Starts to watch the calendar for changes in a time window.
583
+ Call `addListener('calendarChanged', ...)` to receive them.
584
+ A new call replaces the previous window.
585
+ The plugin reads the window once as a baseline. It then compares the window after each change.
586
+ Changes made by this plugin also trigger the listener.
587
+ Changes made while the app is stopped are not sent.
588
+ Needs calendar read access.
589
+
590
+ | Param | Type |
591
+ | ------------- | ----------------------------------------------------------------------- |
592
+ | **`options`** | <code><a href="#startlisteningoptions">StartListeningOptions</a></code> |
593
+
594
+ **Since:** 8.12.0
595
+
596
+ **Platform:** Android, iOS
597
+
598
+ ---
599
+
600
+ ### stopListening()
601
+
602
+ ```typescript
603
+ stopListening() => Promise<void>
604
+ ```
605
+
606
+ Stops to watch the calendar. Does nothing when no watch is active.
607
+ Listeners stay registered. Remove them with their handle or `removeAllListeners`.
608
+
609
+ **Since:** 8.12.0
610
+
611
+ **Platform:** Android, iOS
612
+
613
+ ---
614
+
615
+ ### addListener('calendarChanged', ...)
616
+
617
+ ```typescript
618
+ addListener(eventName: 'calendarChanged', listenerFunc: (event: CalendarChangedEvent) => void) => Promise<PluginListenerHandle>
619
+ ```
620
+
621
+ Adds a listener for calendar changes. Call `startListening` to start the events.
622
+
623
+ | Param | Type |
624
+ | ------------------ | ----------------------------------------------------------------------------------------- |
625
+ | **`eventName`** | <code>'calendarChanged'</code> |
626
+ | **`listenerFunc`** | <code>(event: <a href="#calendarchangedevent">CalendarChangedEvent</a>) =&gt; void</code> |
627
+
628
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
629
+
630
+ **Since:** 8.12.0
631
+
632
+ **Platform:** Android, iOS
633
+
634
+ ---
635
+
636
+ ### removeAllListeners()
637
+
638
+ ```typescript
639
+ removeAllListeners() => Promise<void>
640
+ ```
641
+
642
+ Removes all listeners of this plugin.
643
+
644
+ **Since:** 8.12.0
645
+
646
+ ---
647
+
512
648
  ### requestFullRemindersAccess()
513
649
 
514
650
  ```typescript
@@ -600,6 +736,7 @@ modifyEvent(options: ModifyEventOptions) => Promise<void>
600
736
  ```
601
737
 
602
738
  Modifies an event.
739
+ Fields that you omit keep their current values.
603
740
 
604
741
  | Param | Type |
605
742
  | ------------- | ----------------------------------------------------------------- |
@@ -679,6 +816,7 @@ Retrieves events that overlap a date range.
679
816
 
680
817
  An event is included when its time interval intersects `[from, to]`, including
681
818
  multi-day events that span the range without starting or ending inside it.
819
+ Pass `calendarIds` to search only some calendars.
682
820
 
683
821
  | Param | Type |
684
822
  | ------------- | ----------------------------------------------------------------------------- |
@@ -692,6 +830,28 @@ multi-day events that span the range without starting or ending inside it.
692
830
 
693
831
  ---
694
832
 
833
+ ### getEventById(...)
834
+
835
+ ```typescript
836
+ getEventById(options: GetEventByIdOptions) => Promise<GetEventByIdResult>
837
+ ```
838
+
839
+ Retrieves an event by id.
840
+
841
+ For a recurring event, the result is the first occurrence on iOS and the series master on Android.
842
+
843
+ | Param | Type |
844
+ | ------------- | ------------------------------------------------------------------- |
845
+ | **`options`** | <code><a href="#geteventbyidoptions">GetEventByIdOptions</a></code> |
846
+
847
+ **Returns:** <code>Promise&lt;<a href="#geteventbyidresult">GetEventByIdResult</a>&gt;</code>
848
+
849
+ **Since:** 8.11.0
850
+
851
+ **Platform:** Android, iOS
852
+
853
+ ---
854
+
695
855
  ### commit()
696
856
 
697
857
  ```typescript
@@ -808,6 +968,7 @@ openCalendar(options?: OpenCalendarOptions | undefined) => Promise<void>
808
968
  ```
809
969
 
810
970
  Opens the calendar app.
971
+ On Web, opens a web calendar in a new tab when `provider` is set, and rejects otherwise.
811
972
 
812
973
  | Param | Type |
813
974
  | ------------- | ------------------------------------------------------------------- |
@@ -815,7 +976,7 @@ Opens the calendar app.
815
976
 
816
977
  **Since:** 7.1.0
817
978
 
818
- **Platform:** Android, iOS
979
+ **Platform:** Android, iOS, Web
819
980
 
820
981
  ---
821
982
 
@@ -1152,6 +1313,65 @@ Options for {@link CalendarAccess#requestPermission}.
1152
1313
  | ----------- | --------------------------------------------------------------------------- | -------------------------------- | ----- | ------------ |
1153
1314
  | **`scope`** | <code><a href="#calendarpermissionscope">CalendarPermissionScope</a></code> | The permission scope to request. | 8.3.1 | Android, iOS |
1154
1315
 
1316
+ #### StartListeningOptions
1317
+
1318
+ | Prop | Type | Description | Default | Since | Platform |
1319
+ | ---------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------ | -------- |
1320
+ | **`from`** | <code>number</code> | The start of the window to watch, in milliseconds since the epoch. Events still in progress at this time are watched. | | 8.12.0 | |
1321
+ | **`to`** | <code>number</code> | The end of the window to watch, in milliseconds since the epoch. Use a window of a few months. A large window makes each check slower. | | 8.12.0 | |
1322
+ | **`calendarIds`** | <code>string[]</code> | Ids of the calendars whose events are watched. When omitted or empty, all calendars are watched. Rejects if an id does not match a calendar. | | 8.12.0 | |
1323
+ | **`includeEvents`** | <code>boolean</code> | Whether `created` and `updated` hold the full events. Defaults to `true`. When `false`, those fields are omitted. `precise` is then `false` when events were created or updated. | <code>true</code> | 8.12.0 | |
1324
+ | **`includeReminders`** | <code>boolean</code> | Whether to report reminder changes with `remindersChanged`. Defaults to `false`. Needs reminders access. No reminders are sent, only a signal. | <code>false</code> | 8.12.0 | iOS |
1325
+
1326
+ #### PluginListenerHandle
1327
+
1328
+ | Prop | Type |
1329
+ | ------------ | ----------------------------------------- |
1330
+ | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
1331
+
1332
+ #### CalendarChangedEvent
1333
+
1334
+ Sent to `calendarChanged` listeners. Only fields that have a change are present.
1335
+
1336
+ | Prop | Type | Description | Since | Platform |
1337
+ | ---------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
1338
+ | **`created`** | <code>CalendarEvent[]</code> | Events that are new in the watched window. Not present when `includeEvents` is `false`. | 8.12.0 | |
1339
+ | **`updated`** | <code>CalendarEvent[]</code> | Events in the watched window that changed. A moved event is listed here, with its new `startDate`. Not present when `includeEvents` is `false`. | 8.12.0 | |
1340
+ | **`deletedIds`** | <code>string[]</code> | Ids of events that were deleted or left the watched window. | 8.12.0 | |
1341
+ | **`calendarsChanged`** | <code>boolean</code> | `true` when a calendar was added, removed or edited. | 8.12.0 | |
1342
+ | **`remindersChanged`** | <code>boolean</code> | `true` when reminders probably changed. This is a signal only. No reminders are sent. Best effort. It is set only when `includeReminders` is `true`, reminders access is granted and no event or calendar change was found. It is never set on Android. | 8.12.0 | iOS |
1343
+ | **`precise`** | <code>boolean</code> | `true` when the lists above are complete for the watched window. `false` when something changed but the change could not be found, or when an occurrence of a repeating event was removed from the window while the series stays (its id is not in `deletedIds`). Then read the data again with `listEventsInRange`. | 8.12.0 | |
1344
+
1345
+ #### CalendarEvent
1346
+
1347
+ | Prop | Type | Description | Since | Platform |
1348
+ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1349
+ | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. | 7.1.0 | Android, iOS |
1350
+ | **`attendees`** | <code>{ email: string \| null; name: string \| null; role: <a href="#attendeerole">AttendeeRole</a> \| null; status: <a href="#attendeestatus">AttendeeStatus</a> \| null; type: <a href="#attendeetype">AttendeeType</a> \| null; }[]</code> | | 7.1.0 | Android, iOS |
1351
+ | **`availability`** | <code><a href="#eventavailability">EventAvailability</a> \| null</code> | | 7.1.0 | Android, iOS |
1352
+ | **`birthdayContactIdentifier`** | <code>string \| null</code> | | 7.1.0 | iOS |
1353
+ | **`calendarId`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1354
+ | **`calendarItemExternalIdentifier`** | <code>string \| null</code> | A stable external id for this calendar item. On iOS this is set when the system provides it. On Android and web it is always `null`. Use `masterId` on Android for the series master id. Do not treat this field as the same as `masterId`. They identify different things on different platforms. For non-detached occurrences of a series, this value is shared across those occurrences. On one device, `id` is often already shared for them. This field is mainly useful as a stable id across devices. Detached exceptions usually get a new identifier. You cannot find the original series from this value. Use `isDetached` and `isPartOfSeries` instead. Do not pass this value where the plugin expects an event `id`. | 8.6.0 | iOS |
1355
+ | **`color`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1356
+ | **`creationDate`** | <code>number \| null</code> | | 7.1.0 | iOS |
1357
+ | **`description`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1358
+ | **`duration`** | <code>string \| null</code> | | 7.1.0 | Android |
1359
+ | **`endDate`** | <code>number</code> | | 7.1.0 | Android, iOS |
1360
+ | **`id`** | <code>string</code> | | 7.1.0 | Android, iOS |
1361
+ | **`isAllDay`** | <code>boolean</code> | | 7.1.0 | Android, iOS |
1362
+ | **`isDetached`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1363
+ | **`isPartOfSeries`** | <code>boolean</code> | Whether this event belongs to a recurring series. `true` for series occurrences and detached exceptions. `false` for one-off events. Detached exceptions also set `isDetached` (iOS only). | 8.6.0 | Android, iOS |
1364
+ | **`lastModifiedDate`** | <code>number \| null</code> | | 7.1.0 | iOS |
1365
+ | **`location`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1366
+ | **`masterId`** | <code>string \| null</code> | The id of the series master for this listed occurrence. On Android this is always a string. On iOS and web it is always `null`. iOS has no public master event id. Use `calendarItemExternalIdentifier` on iOS instead. Do not treat this field as the same as `calendarItemExternalIdentifier`. They identify different things on different platforms. If this row is the master or a one-shot event, `masterId` equals `id`. If this row is an exception, `id` is the exception and `masterId` is the series master. To modify or delete the whole series, pass `masterId` as the `id` option. You still need `span` and `instanceDate` when those APIs require them. In rare sync cases, an exception may temporarily report `masterId` equal to `id` until the platform links it to the series master. | 8.6.0 | Android |
1367
+ | **`organizer`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1368
+ | **`seriesStartDate`** | <code>number</code> | Start time of the recurring series, in milliseconds since the epoch. Equals `startDate` for one-off events. On iOS, equals `startDate` when the series start is not available for a detached exception. | 8.6.0 | Android, iOS |
1369
+ | **`startDate`** | <code>number</code> | | 7.1.0 | Android, iOS |
1370
+ | **`status`** | <code><a href="#eventstatus">EventStatus</a> \| null</code> | | 7.1.0 | Android, iOS |
1371
+ | **`timezone`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1372
+ | **`title`** | <code>string</code> | | 7.1.0 | Android, iOS |
1373
+ | **`url`** | <code>string \| null</code> | | 7.1.0 | iOS |
1374
+
1155
1375
  #### CreateEventWithPromptResult
1156
1376
 
1157
1377
  | Prop | Type | Description | Since | Platform |
@@ -1161,23 +1381,24 @@ Options for {@link CalendarAccess#requestPermission}.
1161
1381
 
1162
1382
  #### CreateEventWithPromptOptions
1163
1383
 
1164
- | Prop | Type | Description | Default | Since | Platform |
1165
- | ------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- | ----- | ----------------- |
1166
- | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for reminders before the start, and positive numbers for reminders after the start. On iOS only 2 alerts are supported. | | 7.1.0 | iOS, Web |
1167
- | **`autoDownloadIcsFile`** | <code>boolean</code> | Start a browser download of the ICS file. | <code>true</code> | 8.8.0 | Web |
1168
- | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS, Web |
1169
- | **`calendarId`** | <code>string</code> | | | 0.1.0 | iOS |
1170
- | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS, Web |
1171
- | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1172
- | **`icsFileName`** | <code>string</code> | Download filename for the `.ics` file. When omitted, a name is derived from `title` (fallback `event.ics`). If the value has no `.ics` extension, `.ics` is appended. | | 8.8.0 | Web |
1173
- | **`invitees`** | <code>string[]</code> | An array of emails to invite. | | 7.1.0 | Android |
1174
- | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS, Web |
1175
- | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1176
- | **`promptMessage`** | <code>string</code> | Confirm dialog message. When omitted, the dialog uses the event title and time summary. | | 8.8.0 | Web |
1177
- | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS, Web |
1178
- | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1179
- | **`title`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1180
- | **`url`** | <code>string</code> | | | 0.1.0 | iOS, Web |
1384
+ | Prop | Type | Description | Default | Since | Platform |
1385
+ | ------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ | ------ | ----------------- |
1386
+ | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for reminders before the start, and positive numbers for reminders after the start. On iOS only 2 alerts are supported. | | 7.1.0 | iOS, Web |
1387
+ | **`autoDownloadIcsFile`** | <code>boolean</code> | Start a browser download of the ICS file. | <code>true</code> | 8.8.0 | Web |
1388
+ | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS, Web |
1389
+ | **`calendarId`** | <code>string</code> | | | 0.1.0 | iOS |
1390
+ | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS, Web |
1391
+ | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1392
+ | **`icsFileName`** | <code>string</code> | Download filename for the `.ics` file. When omitted, a name is derived from `title` (fallback `event.ics`). If the value has no `.ics` extension, `.ics` is appended. | | 8.8.0 | Web |
1393
+ | **`invitees`** | <code>string[]</code> | An array of emails to invite. | | 7.1.0 | Android |
1394
+ | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS, Web |
1395
+ | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1396
+ | **`promptMessage`** | <code>string</code> | Confirm dialog message. When omitted, the dialog uses the event title and time summary. | | 8.8.0 | Web |
1397
+ | **`skipPrompt`** | <code>boolean</code> | Skip the confirm dialog and build the `.ics` file at once. Use it when the browser blocks `window.confirm` (for example in some iframes), or when you show your own prompt. | <code>false</code> | 8.12.0 | Web |
1398
+ | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS, Web |
1399
+ | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1400
+ | **`title`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1401
+ | **`url`** | <code>string</code> | | | 0.1.0 | iOS, Web |
1181
1402
 
1182
1403
  #### EventRecurrenceRule
1183
1404
 
@@ -1195,21 +1416,22 @@ Options for {@link CalendarAccess#requestPermission}.
1195
1416
 
1196
1417
  #### ModifyEventWithPromptOptions
1197
1418
 
1198
- | Prop | Type | Description | Since | Platform |
1199
- | ------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | ------------ |
1200
- | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for reminders before the start, and positive numbers for reminders after the start. On iOS only 2 alerts are supported. | 7.1.0 | iOS |
1201
- | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | 7.1.0 | Android, iOS |
1202
- | **`calendarId`** | <code>string</code> | | 0.1.0 | iOS |
1203
- | **`description`** | <code>string</code> | | 7.1.0 | Android, iOS |
1204
- | **`endDate`** | <code>number</code> | | 0.1.0 | Android, iOS |
1205
- | **`id`** | <code>string</code> | The ID of the event to be modified. | 7.1.0 | Android, iOS |
1206
- | **`invitees`** | <code>string[]</code> | An array of emails to invite. | 7.1.0 | Android |
1207
- | **`isAllDay`** | <code>boolean</code> | | 0.1.0 | Android, iOS |
1208
- | **`location`** | <code>string</code> | | 0.1.0 | Android, iOS |
1209
- | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | 7.3.0 | Android, iOS |
1210
- | **`startDate`** | <code>number</code> | | 0.1.0 | Android, iOS |
1211
- | **`title`** | <code>string</code> | | 0.1.0 | Android, iOS |
1212
- | **`url`** | <code>string</code> | | 0.1.0 | iOS |
1419
+ | Prop | Type | Description | Since | Platform |
1420
+ | ------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------------ |
1421
+ | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for reminders before the start, and positive numbers for reminders after the start. On iOS only 2 alerts are supported. | 7.1.0 | iOS |
1422
+ | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | 7.1.0 | Android, iOS |
1423
+ | **`calendarId`** | <code>string</code> | | 0.1.0 | iOS |
1424
+ | **`description`** | <code>string</code> | | 7.1.0 | Android, iOS |
1425
+ | **`endDate`** | <code>number</code> | | 0.1.0 | Android, iOS |
1426
+ | **`id`** | <code>string</code> | The ID of the event to be modified. | 7.1.0 | Android, iOS |
1427
+ | **`instanceDate`** | <code>number</code> | The start time of the occurrence to modify, in milliseconds since the epoch. Use `startDate` from `listEventsInRange`. If omitted, the first occurrence of a recurring series is the target. | 8.11.0 | iOS |
1428
+ | **`invitees`** | <code>string[]</code> | An array of emails to invite. | 7.1.0 | Android |
1429
+ | **`isAllDay`** | <code>boolean</code> | | 0.1.0 | Android, iOS |
1430
+ | **`location`** | <code>string</code> | | 0.1.0 | Android, iOS |
1431
+ | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | 7.3.0 | Android, iOS |
1432
+ | **`startDate`** | <code>number</code> | | 0.1.0 | Android, iOS |
1433
+ | **`title`** | <code>string</code> | | 0.1.0 | Android, iOS |
1434
+ | **`url`** | <code>string</code> | | 0.1.0 | iOS |
1213
1435
 
1214
1436
  #### CreateEventResult
1215
1437
 
@@ -1220,26 +1442,28 @@ Options for {@link CalendarAccess#requestPermission}.
1220
1442
 
1221
1443
  #### CreateEventOptions
1222
1444
 
1223
- | Prop | Type | Description | Default | Since | Platform |
1224
- | ------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | ----------------- |
1225
- | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for alerts before the start, and positive numbers for alerts after the start. | | 7.1.0 | Android, iOS, Web |
1226
- | **`attendees`** | <code>EventGuest[]</code> | The event guests. | | 7.1.0 | Android, Web |
1227
- | **`autoDownloadIcsFile`** | <code>boolean</code> | Start a browser download of the ICS file. | <code>false</code> | 8.8.0 | Web |
1228
- | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS, Web |
1229
- | **`calendarId`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1230
- | **`color`** | <code>string</code> | | | 7.1.0 | Android |
1231
- | **`commit`** | <code>boolean</code> | Whether to save immediately (`true`) or batch changes for later (`false`). | <code>true</code> | 7.1.0 | iOS |
1232
- | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS, Web |
1233
- | **`duration`** | <code>string</code> | Duration of the event in RFC2445 format. On Web, used when `endDate` is omitted; `endDate` wins if both are set. | | 7.1.0 | Android, Web |
1234
- | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1235
- | **`icsFileName`** | <code>string</code> | Download filename for the `.ics` file. When omitted, a name is derived from `title` (fallback `event.ics`). If the value has no `.ics` extension, `.ics` is appended. | | 8.5.0 | Web |
1236
- | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS, Web |
1237
- | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1238
- | **`organizer`** | <code>string</code> | Email of the event organizer. | | 7.1.0 | Android, Web |
1239
- | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS, Web |
1240
- | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1241
- | **`title`** | <code>string</code> | | | 0.4.0 | Android, iOS, Web |
1242
- | **`url`** | <code>string</code> | | | 0.1.0 | iOS, Web |
1445
+ | Prop | Type | Description | Default | Since | Platform |
1446
+ | ------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------ | ----------------- |
1447
+ | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for alerts before the start, and positive numbers for alerts after the start. | | 7.1.0 | Android, iOS, Web |
1448
+ | **`attendees`** | <code>EventGuest[]</code> | The event guests. | | 7.1.0 | Android, Web |
1449
+ | **`autoDownloadIcsFile`** | <code>boolean</code> | Start a browser download of the ICS file. | <code>false</code> | 8.8.0 | Web |
1450
+ | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS, Web |
1451
+ | **`calendarId`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1452
+ | **`color`** | <code>string</code> | | | 7.1.0 | Android |
1453
+ | **`commit`** | <code>boolean</code> | Whether to save immediately (`true`) or batch changes for later (`false`). | <code>true</code> | 7.1.0 | iOS |
1454
+ | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS, Web |
1455
+ | **`duration`** | <code>string</code> | Duration of the event in RFC2445 format. On Web, used when `endDate` is omitted; `endDate` wins if both are set. | | 7.1.0 | Android, Web |
1456
+ | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1457
+ | **`icsFileName`** | <code>string</code> | Download filename for the `.ics` file. When omitted, a name is derived from `title` (fallback `event.ics`). If the value has no `.ics` extension, `.ics` is appended. | | 8.5.0 | Web |
1458
+ | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS, Web |
1459
+ | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS, Web |
1460
+ | **`organizer`** | <code>string</code> | Email of the event organizer. | | 7.1.0 | Android, Web |
1461
+ | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS, Web |
1462
+ | **`sequence`** | <code>number</code> | Sequence number of the event in the `.ics` file. Raise it each time you re-issue the same `uid`, so calendar apps update the event. Calendar apps ignore a lower number for the same `uid`. | | 8.12.0 | Web |
1463
+ | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS, Web |
1464
+ | **`title`** | <code>string</code> | | | 0.4.0 | Android, iOS, Web |
1465
+ | **`uid`** | <code>string</code> | Stable id of the event in the `.ics` file. When omitted, a new random id is made for each file. Reuse the same `uid` with a higher `sequence` to update or cancel an event that the user imported before. | | 8.12.0 | Web |
1466
+ | **`url`** | <code>string</code> | | | 0.1.0 | iOS, Web |
1243
1467
 
1244
1468
  #### EventGuest
1245
1469
 
@@ -1250,25 +1474,26 @@ Options for {@link CalendarAccess#requestPermission}.
1250
1474
 
1251
1475
  #### ModifyEventOptions
1252
1476
 
1253
- | Prop | Type | Description | Default | Since | Platform |
1254
- | ------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- | ----- | ------------ |
1255
- | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for alerts before the start, and positive numbers for alerts after the start. | | 7.1.0 | Android, iOS |
1256
- | **`attendees`** | <code>EventGuest[]</code> | The event guests. | | 7.1.0 | Android |
1257
- | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS |
1258
- | **`calendarId`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1259
- | **`color`** | <code>string</code> | | | 7.1.0 | Android |
1260
- | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS |
1261
- | **`duration`** | <code>string</code> | Duration of the event in RFC2445 format. | | 7.1.0 | Android |
1262
- | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS |
1263
- | **`id`** | <code>string</code> | The ID of the event to be modified. | | 7.1.0 | Android, iOS |
1264
- | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS |
1265
- | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1266
- | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS |
1267
- | **`organizer`** | <code>string</code> | Email of the event organizer. | | 7.1.0 | Android |
1268
- | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | The span of modifications. | <code>EventSpan.THIS_EVENT</code> | | iOS |
1269
- | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS |
1270
- | **`title`** | <code>string</code> | | | 0.4.0 | Android, iOS |
1271
- | **`url`** | <code>string</code> | | | 0.1.0 | iOS |
1477
+ | Prop | Type | Description | Default | Since | Platform |
1478
+ | ------------------ | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ------ | ------------ |
1479
+ | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. Use negative numbers for alerts before the start, and positive numbers for alerts after the start. | | 7.1.0 | Android, iOS |
1480
+ | **`attendees`** | <code>EventGuest[]</code> | The event guests. | | 7.1.0 | Android |
1481
+ | **`availability`** | <code><a href="#eventavailability">EventAvailability</a></code> | | | 7.1.0 | Android, iOS |
1482
+ | **`calendarId`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1483
+ | **`color`** | <code>string</code> | | | 7.1.0 | Android |
1484
+ | **`description`** | <code>string</code> | | | 7.1.0 | Android, iOS |
1485
+ | **`duration`** | <code>string</code> | Duration of the event in RFC2445 format. | | 7.1.0 | Android |
1486
+ | **`endDate`** | <code>number</code> | | | 0.1.0 | Android, iOS |
1487
+ | **`id`** | <code>string</code> | The ID of the event to be modified. | | 7.1.0 | Android, iOS |
1488
+ | **`instanceDate`** | <code>number</code> | The start time of the occurrence to modify, in milliseconds since the epoch. Use `startDate` from `listEventsInRange`. If omitted, the first occurrence of a recurring series is the target. The call rejects when `recurrence` is also set and `span` is `THIS_EVENT`. Use `THIS_AND_FUTURE_EVENTS` to change the rule from this occurrence. | | 8.11.0 | iOS |
1489
+ | **`isAllDay`** | <code>boolean</code> | | | 0.1.0 | Android, iOS |
1490
+ | **`location`** | <code>string</code> | | | 0.1.0 | Android, iOS |
1491
+ | **`recurrence`** | <code><a href="#eventrecurrencerule">EventRecurrenceRule</a></code> | Rules for creating a recurring event. | | 7.3.0 | Android, iOS |
1492
+ | **`organizer`** | <code>string</code> | Email of the event organizer. | | 7.1.0 | Android |
1493
+ | **`span`** | <code><a href="#eventspan">EventSpan</a></code> | The span of modifications. | <code>EventSpan.THIS_EVENT</code> | | iOS |
1494
+ | **`startDate`** | <code>number</code> | | | 0.1.0 | Android, iOS |
1495
+ | **`title`** | <code>string</code> | | | 0.4.0 | Android, iOS |
1496
+ | **`url`** | <code>string</code> | | | 0.1.0 | iOS |
1272
1497
 
1273
1498
  #### DeleteEventsByIdResult
1274
1499
 
@@ -1287,25 +1512,25 @@ Options for {@link CalendarAccess#requestPermission}.
1287
1512
 
1288
1513
  #### DeleteEventOptions
1289
1514
 
1290
- | Prop | Type | Description | Default | Since | Platform |
1291
- | ------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1292
- | **`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 |
1293
- | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1294
- | **`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 |
1295
- | **`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 |
1515
+ | Prop | Type | Description | Default | Since | Platform |
1516
+ | ------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1517
+ | **`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 |
1518
+ | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1519
+ | **`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. On iOS, optional since 8.11.0. If omitted, the first occurrence of the series is the target. | | 8.3.0 | Android, iOS |
1520
+ | **`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 |
1296
1521
 
1297
1522
  #### DeleteEventWithPromptOptions
1298
1523
 
1299
- | Prop | Type | Description | Default | Since | Platform |
1300
- | ----------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1301
- | **`cancelButtonText`** | <code>string</code> | Text to show on the cancel button. | <code>'Cancel'</code> | 7.1.0 | Android, iOS |
1302
- | **`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 |
1303
- | **`confirmButtonText`** | <code>string</code> | Text to show on the confirm button. | <code>'Delete'</code> | 7.1.0 | Android, iOS |
1304
- | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1305
- | **`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 |
1306
- | **`message`** | <code>string</code> | Message of the dialog. | | 7.1.0 | Android, iOS |
1307
- | **`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 |
1308
- | **`title`** | <code>string</code> | Title of the dialog. | | 7.1.0 | Android, iOS |
1524
+ | Prop | Type | Description | Default | Since | Platform |
1525
+ | ----------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----- | ------------ |
1526
+ | **`cancelButtonText`** | <code>string</code> | Text to show on the cancel button. | <code>'Cancel'</code> | 7.1.0 | Android, iOS |
1527
+ | **`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 |
1528
+ | **`confirmButtonText`** | <code>string</code> | Text to show on the confirm button. | <code>'Delete'</code> | 7.1.0 | Android, iOS |
1529
+ | **`id`** | <code>string</code> | The ID of the event to delete. | | 7.1.0 | Android, iOS |
1530
+ | **`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. On iOS, optional since 8.11.0. If omitted, the first occurrence of the series is the target. | | 8.3.0 | Android, iOS |
1531
+ | **`message`** | <code>string</code> | Message of the dialog. | | 7.1.0 | Android, iOS |
1532
+ | **`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 |
1533
+ | **`title`** | <code>string</code> | Title of the dialog. | | 7.1.0 | Android, iOS |
1309
1534
 
1310
1535
  #### ListEventsInRangeResult
1311
1536
 
@@ -1313,42 +1538,25 @@ Options for {@link CalendarAccess#requestPermission}.
1313
1538
  | ------------ | ---------------------------- | ---------------------------------------- | ----- | ------------ |
1314
1539
  | **`result`** | <code>CalendarEvent[]</code> | Events that overlap the requested range. | 8.6.0 | Android, iOS |
1315
1540
 
1316
- #### CalendarEvent
1541
+ #### ListEventsInRangeOptions
1317
1542
 
1318
- | Prop | Type | Description | Since | Platform |
1319
- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------ |
1320
- | **`alerts`** | <code>number[]</code> | Alert times in minutes relative to the event start. | 7.1.0 | Android, iOS |
1321
- | **`attendees`** | <code>{ email: string \| null; name: string \| null; role: <a href="#attendeerole">AttendeeRole</a> \| null; status: <a href="#attendeestatus">AttendeeStatus</a> \| null; type: <a href="#attendeetype">AttendeeType</a> \| null; }[]</code> | | 7.1.0 | Android, iOS |
1322
- | **`availability`** | <code><a href="#eventavailability">EventAvailability</a> \| null</code> | | 7.1.0 | Android, iOS |
1323
- | **`birthdayContactIdentifier`** | <code>string \| null</code> | | 7.1.0 | iOS |
1324
- | **`calendarId`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1325
- | **`calendarItemExternalIdentifier`** | <code>string \| null</code> | A stable external id for this calendar item. On iOS this is set when the system provides it. On Android and web it is always `null`. Use `masterId` on Android for the series master id. Do not treat this field as the same as `masterId`. They identify different things on different platforms. For non-detached occurrences of a series, this value is shared across those occurrences. On one device, `id` is often already shared for them. This field is mainly useful as a stable id across devices. Detached exceptions usually get a new identifier. You cannot find the original series from this value. Use `isDetached` and `isPartOfSeries` instead. Do not pass this value where the plugin expects an event `id`. | 8.6.0 | iOS |
1326
- | **`color`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1327
- | **`creationDate`** | <code>number \| null</code> | | 7.1.0 | iOS |
1328
- | **`description`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1329
- | **`duration`** | <code>string \| null</code> | | 7.1.0 | Android |
1330
- | **`endDate`** | <code>number</code> | | 7.1.0 | Android, iOS |
1331
- | **`id`** | <code>string</code> | | 7.1.0 | Android, iOS |
1332
- | **`isAllDay`** | <code>boolean</code> | | 7.1.0 | Android, iOS |
1333
- | **`isDetached`** | <code>boolean \| null</code> | | 7.1.0 | iOS |
1334
- | **`isPartOfSeries`** | <code>boolean</code> | Whether this event belongs to a recurring series. `true` for series occurrences and detached exceptions. `false` for one-off events. Detached exceptions also set `isDetached` (iOS only). | 8.6.0 | Android, iOS |
1335
- | **`lastModifiedDate`** | <code>number \| null</code> | | 7.1.0 | iOS |
1336
- | **`location`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1337
- | **`masterId`** | <code>string \| null</code> | The id of the series master for this listed occurrence. On Android this is always a string. On iOS and web it is always `null`. iOS has no public master event id. Use `calendarItemExternalIdentifier` on iOS instead. Do not treat this field as the same as `calendarItemExternalIdentifier`. They identify different things on different platforms. If this row is the master or a one-shot event, `masterId` equals `id`. If this row is an exception, `id` is the exception and `masterId` is the series master. To modify or delete the whole series, pass `masterId` as the `id` option. You still need `span` and `instanceDate` when those APIs require them. In rare sync cases, an exception may temporarily report `masterId` equal to `id` until the platform links it to the series master. | 8.6.0 | Android |
1338
- | **`organizer`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1339
- | **`seriesStartDate`** | <code>number</code> | Start time of the recurring series, in milliseconds since the epoch. Equals `startDate` for one-off events. On iOS, equals `startDate` when the series start is not available for a detached exception. | 8.6.0 | Android, iOS |
1340
- | **`startDate`** | <code>number</code> | | 7.1.0 | Android, iOS |
1341
- | **`status`** | <code><a href="#eventstatus">EventStatus</a> \| null</code> | | 7.1.0 | Android, iOS |
1342
- | **`timezone`** | <code>string \| null</code> | | 7.1.0 | Android, iOS |
1343
- | **`title`** | <code>string</code> | | 7.1.0 | Android, iOS |
1344
- | **`url`** | <code>string \| null</code> | | 7.1.0 | iOS |
1543
+ | Prop | Type | Description | Since |
1544
+ | ----------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
1545
+ | **`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 |
1546
+ | **`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 |
1547
+ | **`calendarIds`** | <code>string[]</code> | Ids of the calendars to search. When omitted or empty, all calendars are searched. Rejects if an id does not match a calendar. | 8.11.0 |
1345
1548
 
1346
- #### ListEventsInRangeOptions
1549
+ #### GetEventByIdResult
1550
+
1551
+ | Prop | Type | Description | Since | Platform |
1552
+ | ----------- | --------------------------------------------------------------- | ------------------------------------------------------- | ------ | ------------ |
1553
+ | **`event`** | <code><a href="#calendarevent">CalendarEvent</a> \| null</code> | The event for the given id, or `null` when none exists. | 8.11.0 | Android, iOS |
1554
+
1555
+ #### GetEventByIdOptions
1347
1556
 
1348
- | Prop | Type | Description | Since |
1349
- | ---------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
1350
- | **`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 |
1351
- | **`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 |
1557
+ | Prop | Type | Description | Since |
1558
+ | -------- | ------------------- | ------------- | ------ |
1559
+ | **`id`** | <code>string</code> | The event id. | 8.11.0 |
1352
1560
 
1353
1561
  #### SelectCalendarsWithPromptResult
1354
1562
 
@@ -1411,9 +1619,10 @@ Options for {@link CalendarAccess#requestPermission}.
1411
1619
 
1412
1620
  #### OpenCalendarOptions
1413
1621
 
1414
- | Prop | Type | Description | Default | Since | Platform |
1415
- | ---------- | ------------------- | ------------------------------------------------------------------ | ----------------------- | ----- | ------------ |
1416
- | **`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 |
1622
+ | Prop | Type | Description | Default | Since | Platform |
1623
+ | -------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------ | ------------ |
1624
+ | **`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 |
1625
+ | **`provider`** | <code><a href="#calendardayviewprovider">CalendarDayViewProvider</a></code> | Web calendar to open in a new browser tab, at the day of `date`. Without it, `openCalendar` rejects on Web, because browsers cannot open a calendar app. | | 8.12.0 | Web |
1417
1626
 
1418
1627
  #### CreateCalendarResult
1419
1628
 
@@ -1664,6 +1873,13 @@ Named iOS system color.
1664
1873
 
1665
1874
  <code>'blue' | 'brown' | 'gray' | 'green' | 'indigo' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow'</code>
1666
1875
 
1876
+ #### CalendarDayViewProvider
1877
+
1878
+ Web calendar services that `openCalendar` can open at a day view.
1879
+ Yahoo <a href="#calendar">Calendar</a> has no day view link.
1880
+
1881
+ <code>'google' | 'outlook' | 'office365'</code>
1882
+
1667
1883
  #### RemindersList
1668
1884
 
1669
1885
  A reminders list on iOS.
@@ -1687,23 +1903,6 @@ Same shape as {@link <a href="#calendar">Calendar</a>} today. Android-only calen
1687
1903
  | **`WRITE_CALENDAR`** | <code>'writeCalendar'</code> | Permission required for adding or modifying calendar events. | 7.1.0 | Android, iOS |
1688
1904
  | **`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 |
1689
1905
 
1690
- #### EventAvailability
1691
-
1692
- | Members | Value | Since | Platform |
1693
- | ------------------- | --------------- | ----- | ------------ |
1694
- | **`NOT_SUPPORTED`** | <code>-1</code> | 7.1.0 | iOS |
1695
- | **`BUSY`** | | 7.1.0 | Android, iOS |
1696
- | **`FREE`** | | 7.1.0 | Android, iOS |
1697
- | **`TENTATIVE`** | | 7.1.0 | Android, iOS |
1698
- | **`UNAVAILABLE`** | | 7.1.0 | iOS |
1699
-
1700
- #### EventSpan
1701
-
1702
- | Members | Description | Since |
1703
- | ---------------------------- | --------------------------------------------------------------- | ----- |
1704
- | **`THIS_EVENT`** | Only the identified event or occurrence. | 7.1.0 |
1705
- | **`THIS_AND_FUTURE_EVENTS`** | The identified occurrence and future occurrences in the series. | 7.1.0 |
1706
-
1707
1906
  #### AttendeeRole
1708
1907
 
1709
1908
  | Members | Value | Since | Platform |
@@ -1746,6 +1945,16 @@ Same shape as {@link <a href="#calendar">Calendar</a>} today. Android-only calen
1746
1945
  | **`NONE`** | <code>'none'</code> | 7.1.0 | Android |
1747
1946
  | **`OPTIONAL`** | <code>'optional'</code> | 7.1.0 | Android |
1748
1947
 
1948
+ #### EventAvailability
1949
+
1950
+ | Members | Value | Since | Platform |
1951
+ | ------------------- | --------------- | ----- | ------------ |
1952
+ | **`NOT_SUPPORTED`** | <code>-1</code> | 7.1.0 | iOS |
1953
+ | **`BUSY`** | | 7.1.0 | Android, iOS |
1954
+ | **`FREE`** | | 7.1.0 | Android, iOS |
1955
+ | **`TENTATIVE`** | | 7.1.0 | Android, iOS |
1956
+ | **`UNAVAILABLE`** | | 7.1.0 | iOS |
1957
+
1749
1958
  #### EventStatus
1750
1959
 
1751
1960
  | Members | Value | Since | Platform |
@@ -1755,6 +1964,13 @@ Same shape as {@link <a href="#calendar">Calendar</a>} today. Android-only calen
1755
1964
  | **`TENTATIVE`** | <code>'tentative'</code> | 7.1.0 | Android, iOS |
1756
1965
  | **`CANCELED`** | <code>'canceled'</code> | 7.1.0 | Android, iOS |
1757
1966
 
1967
+ #### EventSpan
1968
+
1969
+ | Members | Description | Since |
1970
+ | ---------------------------- | --------------------------------------------------------------- | ----- |
1971
+ | **`THIS_EVENT`** | Only the identified event or occurrence. | 7.1.0 |
1972
+ | **`THIS_AND_FUTURE_EVENTS`** | The identified occurrence and future occurrences in the series. | 7.1.0 |
1973
+
1758
1974
  #### CalendarType
1759
1975
 
1760
1976
  | Members | Since |