@ebarooni/capacitor-calendar 0.6.1 → 0.8.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 (34) hide show
  1. package/README.md +41 -62
  2. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +12 -10
  3. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +13 -2
  4. package/dist/docs.json +87 -783
  5. package/dist/esm/definitions.d.ts +31 -6
  6. package/dist/esm/definitions.js.map +1 -1
  7. package/dist/esm/schemas/enums/calendar-chooser-display-style.d.ts +2 -1
  8. package/dist/esm/schemas/enums/calendar-chooser-display-style.js +2 -1
  9. package/dist/esm/schemas/enums/calendar-chooser-display-style.js.map +1 -1
  10. package/dist/esm/schemas/enums/calendar-chooser-selection-style.d.ts +2 -1
  11. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js +2 -1
  12. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js.map +1 -1
  13. package/dist/esm/schemas/enums/plugin-permission.d.ts +36 -0
  14. package/dist/esm/schemas/enums/plugin-permission.js +36 -0
  15. package/dist/esm/schemas/enums/plugin-permission.js.map +1 -1
  16. package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +18 -0
  17. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +18 -0
  18. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -1
  19. package/dist/esm/schemas/interfaces/calendar.d.ts +1 -1
  20. package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
  21. package/dist/esm/web.d.ts +6 -2
  22. package/dist/esm/web.js +6 -0
  23. package/dist/esm/web.js.map +1 -1
  24. package/dist/plugin.cjs.js +64 -2
  25. package/dist/plugin.cjs.js.map +1 -1
  26. package/dist/plugin.js +64 -2
  27. package/dist/plugin.js.map +1 -1
  28. package/ios/Plugin/CapacitorCalendar.swift +26 -2
  29. package/ios/Plugin/CapacitorCalendarPlugin.m +2 -0
  30. package/ios/Plugin/CapacitorCalendarPlugin.swift +31 -2
  31. package/ios/Plugin/CapacitorCalendarPluginError.swift +2 -0
  32. package/ios/Plugin/CapacitorReminders.swift +25 -0
  33. package/ios/Plugin/EventCreationParameters.swift +2 -2
  34. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -3,7 +3,8 @@ var capacitorCapacitorCalendar = (function (exports, core) {
3
3
 
4
4
  /**
5
5
  * Enum representing the display styles for the calendar chooser.
6
- * @enum
6
+ *
7
+ * @enum CalendarChooserDisplayStyle
7
8
  * @platform iOS
8
9
  */
9
10
  exports.CalendarChooserDisplayStyle = void 0;
@@ -20,7 +21,8 @@ var capacitorCapacitorCalendar = (function (exports, core) {
20
21
 
21
22
  /**
22
23
  * Enum representing the selection style for the calendar chooser.
23
- * @enum
24
+ *
25
+ * @enum CalendarChooserSelectionStyle
24
26
  * @platform iOS
25
27
  */
26
28
  exports.CalendarChooserSelectionStyle = void 0;
@@ -35,35 +37,89 @@ var capacitorCapacitorCalendar = (function (exports, core) {
35
37
  CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
36
38
  })(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
37
39
 
40
+ /**
41
+ * Enum representing the available runtime permissions for the plugin.
42
+ *
43
+ * @enum PluginPermission
44
+ * @platform iOS, Android
45
+ */
38
46
  exports.PluginPermission = void 0;
39
47
  (function (PluginPermission) {
40
48
  /**
41
49
  * Represents the permission state for reading calendar.
50
+ *
42
51
  * @platform iOS, Android
52
+ * @permissions
53
+ * <h3>Manifest Permissions:</h3>
54
+ * <ul>
55
+ * <li><strong>iOS 17 &le;:</strong> NSCalendarsFullAccessUsageDescription</li>
56
+ * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSCalendarsUsageDescription</li>
57
+ * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>
58
+ * </ul>
43
59
  */
44
60
  PluginPermission["READ_CALENDAR"] = "readCalendar";
45
61
  /**
46
62
  * Represents the permission state for writing calendar.
63
+ *
47
64
  * @platform iOS, Android
65
+ * @permissions
66
+ * <h3>Manifest Permissions:</h3>
67
+ * <ul>
68
+ * <li><strong>iOS 17 &le;:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>
69
+ * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSCalendarsUsageDescription</li>
70
+ * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>
71
+ * </ul>
48
72
  */
49
73
  PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
50
74
  /**
51
75
  * Represents the permission state for reading reminders.
76
+ *
52
77
  * @platform iOS
78
+ * @permissions
79
+ * <h3>Manifest Permissions:</h3>
80
+ * <ul>
81
+ * <li><strong>iOS 17 &le;:</strong> NSRemindersFullAccessUsageDescription</li>
82
+ * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSRemindersUsageDescription</li>
83
+ * </ul>
53
84
  */
54
85
  PluginPermission["READ_REMINDERS"] = "readReminders";
55
86
  /**
56
87
  * Represents the permission state for writing reminders.
88
+ *
57
89
  * @platform iOS
90
+ * @permissions
91
+ * <h3>Manifest Permissions:</h3>
92
+ * <ul>
93
+ * <li><strong>iOS 17 &le;:</strong> NSRemindersFullAccessUsageDescription</li>
94
+ * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSRemindersUsageDescription</li>
95
+ * </ul>
58
96
  */
59
97
  PluginPermission["WRITE_REMINDERS"] = "writeReminders";
60
98
  })(exports.PluginPermission || (exports.PluginPermission = {}));
61
99
 
100
+ /**
101
+ * Enum representing the repeating frequency of the reminder.
102
+ *
103
+ * @enum ReminderRecurrenceFrequency
104
+ * @platform iOS
105
+ */
62
106
  exports.ReminderRecurrenceFrequency = void 0;
63
107
  (function (ReminderRecurrenceFrequency) {
108
+ /**
109
+ * The reminder repeats on a daily basis
110
+ */
64
111
  ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
112
+ /**
113
+ * The reminder repeats on a weekly basis
114
+ */
65
115
  ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
116
+ /**
117
+ * The reminder repeats on a monthly basis
118
+ */
66
119
  ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
120
+ /**
121
+ * The reminder repeats on a yearly basis
122
+ */
67
123
  ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
68
124
  })(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {}));
69
125
 
@@ -109,6 +165,12 @@ var capacitorCapacitorCalendar = (function (exports, core) {
109
165
  getRemindersLists() {
110
166
  throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
111
167
  }
168
+ openCalendar(_options) {
169
+ throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
170
+ }
171
+ openReminders() {
172
+ throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
173
+ }
112
174
  }
113
175
 
114
176
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","export var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n * @platform iOS\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n * @platform iOS\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","export var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;ICfrE;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC;;ACf9DC,sCAAiB;IAC5B,CAAC,UAAU,gBAAgB,EAAE;IAC7B;IACA;IACA;IACA;IACA,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,cAAc,CAAC;IACvD;IACA;IACA;IACA;IACA,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;IACzD;IACA;IACA;IACA;IACA,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;IACzD;IACA;IACA;IACA;IACA,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,CAAC;IAC3D,CAAC,EAAEA,wBAAgB,KA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AAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,iBAAiB,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 &le;:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 &le;:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 &le;:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 &le;:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>iOS 10 &le; x &le; iOS 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;IChBrE;IACA;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UA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IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,aAAa,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL;;;;;;;;;;;;;;;"}
@@ -91,12 +91,12 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
91
91
  newEvent.location = location
92
92
  }
93
93
  if let startDate = parameters.startDate {
94
- newEvent.startDate = startDate
94
+ newEvent.startDate = Date(timeIntervalSince1970: startDate / 1000)
95
95
  } else {
96
96
  newEvent.startDate = fallbackStartDate
97
97
  }
98
98
  if let endDate = parameters.endDate {
99
- newEvent.endDate = endDate
99
+ newEvent.endDate = Date(timeIntervalSince1970: endDate / 1000)
100
100
  } else {
101
101
  newEvent.endDate = fallbackStartDate.addingTimeInterval(3600)
102
102
  }
@@ -215,6 +215,30 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
215
215
  }
216
216
  }
217
217
 
218
+ public func openCalendar(date: Double) async throws {
219
+ return try await withCheckedThrowingContinuation { continuation in
220
+ guard let url = URL(string: "calshow:\(date)") else {
221
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenCalendar)
222
+ return
223
+ }
224
+
225
+ Task { @MainActor in
226
+ guard UIApplication.shared.canOpenURL(url) else {
227
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenCalendar)
228
+ return
229
+ }
230
+
231
+ UIApplication.shared.open(url, options: [:]) { success in
232
+ if success {
233
+ continuation.resume()
234
+ } else {
235
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenCalendar)
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
+
218
242
  public func eventEditViewController(
219
243
  _ controller: EKEventEditViewController,
220
244
  didCompleteWith action: EKEventEditViewAction
@@ -16,4 +16,6 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
16
16
  CAP_PLUGIN_METHOD(getDefaultRemindersList, CAPPluginReturnPromise);
17
17
  CAP_PLUGIN_METHOD(getRemindersLists, CAPPluginReturnPromise);
18
18
  CAP_PLUGIN_METHOD(createReminder, CAPPluginReturnPromise);
19
+ CAP_PLUGIN_METHOD(openCalendar, CAPPluginReturnNone);
20
+ CAP_PLUGIN_METHOD(openReminders, CAPPluginReturnNone);
19
21
  )
@@ -175,8 +175,8 @@ public class CapacitorCalendarPlugin: CAPPlugin {
175
175
  return
176
176
  }
177
177
  let location = call.getString("location")
178
- let startDate = call.getDate("startDate")
179
- let endDate = call.getDate("endDate")
178
+ let startDate = call.getDouble("startDate")
179
+ let endDate = call.getDouble("endDate")
180
180
  let isAllDay = call.getBool("isAllDay")
181
181
  let calendarId = call.getString("calendarId")
182
182
 
@@ -265,4 +265,33 @@ public class CapacitorCalendarPlugin: CAPPlugin {
265
265
  return
266
266
  }
267
267
  }
268
+
269
+ @objc public func openCalendar(_ call: CAPPluginCall) {
270
+ let interval: Double
271
+ if let date = call.getDouble("date") {
272
+ interval = Date(timeIntervalSince1970: date / 1000).timeIntervalSinceReferenceDate
273
+ } else {
274
+ interval = Date.timeIntervalSinceReferenceDate
275
+ }
276
+
277
+ Task {
278
+ do {
279
+ try await calendar.openCalendar(date: interval)
280
+ } catch {
281
+ call.reject("[CapacitorCalendar.\(#function)] Unable to open the calendar")
282
+ return
283
+ }
284
+ }
285
+ }
286
+
287
+ @objc public func openReminders(_ call: CAPPluginCall) {
288
+ Task {
289
+ do {
290
+ try await reminders.openReminders()
291
+ } catch {
292
+ call.reject("[CapacitorCalendar.\(#function)] Unable to open reminders")
293
+ return
294
+ }
295
+ }
296
+ }
268
297
  }
@@ -15,4 +15,6 @@ public enum CapacitorCalendarPluginError: Error {
15
15
  case unknownActionEventCreationPrompt
16
16
  case canceledCalendarsSelectionPrompt
17
17
  case noDefaultCalendar
18
+ case unableToOpenCalendar
19
+ case unableToOpenReminders
18
20
  }
@@ -8,6 +8,7 @@
8
8
 
9
9
  import Foundation
10
10
  import EventKit
11
+ import UIKit
11
12
 
12
13
  public class CapacitorReminders: NSObject {
13
14
  private let eventStore: EKEventStore
@@ -146,6 +147,30 @@ public class CapacitorReminders: NSObject {
146
147
  }
147
148
  }
148
149
 
150
+ public func openReminders() async throws {
151
+ return try await withCheckedThrowingContinuation { continuation in
152
+ guard let url = URL(string: "x-apple-reminderkit://") else {
153
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenReminders)
154
+ return
155
+ }
156
+
157
+ Task { @MainActor in
158
+ guard UIApplication.shared.canOpenURL(url) else {
159
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenReminders)
160
+ return
161
+ }
162
+
163
+ UIApplication.shared.open(url, options: [:]) { success in
164
+ if success {
165
+ continuation.resume()
166
+ } else {
167
+ continuation.resume(throwing: CapacitorCalendarPluginError.unableToOpenReminders)
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+
149
174
  private func convertEKCalendarsToDictionaries(calendars: Set<EKCalendar>) -> [[String: String]] {
150
175
  var result: [[String: String]] = []
151
176
 
@@ -12,7 +12,7 @@ public struct EventCreationParameters {
12
12
  public var title: String
13
13
  public var calendarId: String?
14
14
  public var location: String?
15
- public var startDate: Date?
16
- public var endDate: Date?
15
+ public var startDate: Double?
16
+ public var endDate: Double?
17
17
  public var isAllDay: Bool?
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebarooni/capacitor-calendar",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",