@ebarooni/capacitor-calendar 0.4.0 → 0.5.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.
- package/README.md +95 -24
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +18 -0
- package/dist/docs.json +290 -42
- package/dist/esm/definitions.d.ts +108 -55
- package/dist/esm/definitions.js +1 -31
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schemas/enums/calendar-chooser-display-style.d.ts +15 -0
- package/dist/esm/schemas/enums/calendar-chooser-display-style.js +17 -0
- package/dist/esm/schemas/enums/calendar-chooser-display-style.js.map +1 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.d.ts +15 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.js +17 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.js.map +1 -0
- package/dist/esm/schemas/enums/plugin-permission.d.ts +22 -0
- package/dist/esm/schemas/enums/plugin-permission.js +24 -0
- package/dist/esm/schemas/enums/plugin-permission.js.map +1 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +6 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +8 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -0
- package/dist/esm/schemas/interfaces/calendar.d.ts +12 -0
- package/dist/esm/schemas/interfaces/calendar.js +2 -0
- package/dist/esm/schemas/interfaces/calendar.js.map +1 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.d.ts +4 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.js +2 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.js.map +1 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +36 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js +2 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -0
- package/dist/esm/schemas/interfaces/reminders-list.d.ts +3 -0
- package/dist/esm/schemas/interfaces/reminders-list.js +2 -0
- package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -0
- package/dist/esm/web.d.ts +31 -5
- package/dist/esm/web.js +9 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +55 -14
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +55 -14
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendarPlugin.m +3 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +104 -23
- package/ios/Plugin/CapacitorReminders.swift +177 -0
- package/package.json +4 -4
- package/ios/Plugin/Calendar.swift +0 -14
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { PermissionState, WebPlugin } from '@capacitor/core';
|
|
2
|
-
import { CapacitorCalendarPlugin
|
|
2
|
+
import { CapacitorCalendarPlugin } from './definitions';
|
|
3
|
+
import { PluginPermission } from './schemas/enums/plugin-permission';
|
|
4
|
+
import { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule";
|
|
5
|
+
import type { Calendar } from "./schemas/interfaces/calendar";
|
|
6
|
+
import type { RemindersList } from "./schemas/interfaces/reminders-list";
|
|
7
|
+
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
|
|
3
8
|
export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {
|
|
4
9
|
checkPermission(_options: {
|
|
5
|
-
alias:
|
|
10
|
+
alias: PluginPermission;
|
|
6
11
|
}): Promise<{
|
|
7
12
|
result: PermissionState;
|
|
8
13
|
}>;
|
|
9
|
-
checkAllPermissions(): Promise<
|
|
14
|
+
checkAllPermissions(): Promise<PluginPermissionsMap>;
|
|
10
15
|
requestPermission(_options: {
|
|
11
|
-
alias:
|
|
16
|
+
alias: PluginPermission;
|
|
12
17
|
}): Promise<{
|
|
13
18
|
result: PermissionState;
|
|
14
19
|
}>;
|
|
15
|
-
requestAllPermissions(): Promise<
|
|
20
|
+
requestAllPermissions(): Promise<PluginPermissionsMap>;
|
|
16
21
|
createEventWithPrompt(): Promise<{
|
|
17
22
|
eventCreated: boolean;
|
|
18
23
|
}>;
|
|
@@ -35,4 +40,25 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
35
40
|
}): Promise<{
|
|
36
41
|
eventCreated: boolean;
|
|
37
42
|
}>;
|
|
43
|
+
createReminder(_options: {
|
|
44
|
+
title: string;
|
|
45
|
+
listId?: string;
|
|
46
|
+
priority?: number;
|
|
47
|
+
isCompleted?: boolean;
|
|
48
|
+
startDate?: number;
|
|
49
|
+
dueDate?: number;
|
|
50
|
+
completionDate?: number;
|
|
51
|
+
notes?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
location?: string;
|
|
54
|
+
recurrence?: ReminderRecurrenceRule;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
reminderCreated: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
getDefaultRemindersList(): Promise<{
|
|
59
|
+
result: RemindersList;
|
|
60
|
+
}>;
|
|
61
|
+
getRemindersLists(): Promise<{
|
|
62
|
+
result: RemindersList[];
|
|
63
|
+
}>;
|
|
38
64
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -27,5 +27,14 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
27
27
|
createEvent(_options) {
|
|
28
28
|
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
29
29
|
}
|
|
30
|
+
createReminder(_options) {
|
|
31
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
32
|
+
}
|
|
33
|
+
getDefaultRemindersList() {
|
|
34
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
35
|
+
}
|
|
36
|
+
getRemindersLists() {
|
|
37
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
38
|
+
}
|
|
30
39
|
}
|
|
31
40
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAQ3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAqC;QACxD,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAqC;QAC1D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,yBAAyB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,aAAa;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAEM,kBAAkB;QACrB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC9F,CAAC;IAEM,WAAW,CAAC,QAAyH;QAGxI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACvF,CAAC;IAEM,cAAc,CAAC,QAYrB;QACG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;IAEM,uBAAuB;QAC1B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;IAEM,iBAAiB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;CACJ","sourcesContent":["import {PermissionState, WebPlugin} from '@capacitor/core';\nimport {CapacitorCalendarPlugin} from './definitions';\nimport {PluginPermission} from './schemas/enums/plugin-permission';\nimport {ReminderRecurrenceRule} from \"./schemas/interfaces/reminder-recurrence-rule\";\nimport type {Calendar} from \"./schemas/interfaces/calendar\";\nimport type {RemindersList} from \"./schemas/interfaces/reminders-list\";\nimport type {PluginPermissionsMap} from './schemas/interfaces/plugin-permissions-map';\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`)\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(): Promise<{ eventCreated: boolean}> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n\n public createEvent(_options: { title: string; calendarId?: string, location?: string; startDate?: Date; endDate?: Date, isAllDay?: boolean }): Promise<{\n eventCreated: boolean\n }> {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n\n public createReminder(_options: {\n title: string,\n listId?: string,\n priority?: number,\n isCompleted?: boolean,\n startDate?: number,\n dueDate?: number,\n completionDate?: number,\n notes?: string,\n url?: string,\n location?: string,\n recurrence?: ReminderRecurrenceRule,\n }): Promise<{ reminderCreated: boolean }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Enum representing the display styles for the calendar chooser.
|
|
7
|
+
* @enum
|
|
8
|
+
* @platform iOS
|
|
9
|
+
*/
|
|
10
|
+
exports.CalendarChooserDisplayStyle = void 0;
|
|
11
|
+
(function (CalendarChooserDisplayStyle) {
|
|
12
|
+
/**
|
|
13
|
+
* Display all calendars available for selection.
|
|
14
|
+
*/
|
|
15
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
|
|
16
|
+
/**
|
|
17
|
+
* Display only writable calendars available for selection.
|
|
18
|
+
*/
|
|
19
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
|
|
20
|
+
})(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
|
|
21
|
+
|
|
7
22
|
/**
|
|
8
23
|
* Enum representing the selection style for the calendar chooser.
|
|
9
|
-
* @readonly
|
|
10
24
|
* @enum
|
|
25
|
+
* @platform iOS
|
|
11
26
|
*/
|
|
12
27
|
exports.CalendarChooserSelectionStyle = void 0;
|
|
13
28
|
(function (CalendarChooserSelectionStyle) {
|
|
@@ -20,21 +35,38 @@ exports.CalendarChooserSelectionStyle = void 0;
|
|
|
20
35
|
*/
|
|
21
36
|
CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
|
|
22
37
|
})(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
exports.CalendarChooserDisplayStyle = void 0;
|
|
28
|
-
(function (CalendarChooserDisplayStyle) {
|
|
38
|
+
|
|
39
|
+
exports.PluginPermission = void 0;
|
|
40
|
+
(function (PluginPermission) {
|
|
29
41
|
/**
|
|
30
|
-
*
|
|
42
|
+
* Represents the permission state for reading calendar.
|
|
43
|
+
* @platform iOS, Android
|
|
31
44
|
*/
|
|
32
|
-
|
|
45
|
+
PluginPermission["READ_CALENDAR"] = "readCalendar";
|
|
33
46
|
/**
|
|
34
|
-
*
|
|
47
|
+
* Represents the permission state for writing calendar.
|
|
48
|
+
* @platform iOS, Android
|
|
35
49
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
|
|
51
|
+
/**
|
|
52
|
+
* Represents the permission state for reading reminders.
|
|
53
|
+
* @platform iOS
|
|
54
|
+
*/
|
|
55
|
+
PluginPermission["READ_REMINDERS"] = "readReminders";
|
|
56
|
+
/**
|
|
57
|
+
* Represents the permission state for writing reminders.
|
|
58
|
+
* @platform iOS
|
|
59
|
+
*/
|
|
60
|
+
PluginPermission["WRITE_REMINDERS"] = "writeReminders";
|
|
61
|
+
})(exports.PluginPermission || (exports.PluginPermission = {}));
|
|
62
|
+
|
|
63
|
+
exports.ReminderRecurrenceFrequency = void 0;
|
|
64
|
+
(function (ReminderRecurrenceFrequency) {
|
|
65
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
|
|
66
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
|
|
67
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
|
|
68
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
|
|
69
|
+
})(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {}));
|
|
38
70
|
|
|
39
71
|
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
|
|
40
72
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
|
|
@@ -68,6 +100,15 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
68
100
|
createEvent(_options) {
|
|
69
101
|
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
70
102
|
}
|
|
103
|
+
createReminder(_options) {
|
|
104
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
105
|
+
}
|
|
106
|
+
getDefaultRemindersList() {
|
|
107
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
108
|
+
}
|
|
109
|
+
getRemindersLists() {
|
|
110
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
111
|
+
}
|
|
71
112
|
}
|
|
72
113
|
|
|
73
114
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/
|
|
1
|
+
{"version":3,"file":"plugin.cjs.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","import { 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":";;;;AAAA;AACA;AACA;AACA;AACA;AACWA,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,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|
1
1
|
var capacitorCapacitorCalendar = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the display styles for the calendar chooser.
|
|
6
|
+
* @enum
|
|
7
|
+
* @platform iOS
|
|
8
|
+
*/
|
|
9
|
+
exports.CalendarChooserDisplayStyle = void 0;
|
|
10
|
+
(function (CalendarChooserDisplayStyle) {
|
|
11
|
+
/**
|
|
12
|
+
* Display all calendars available for selection.
|
|
13
|
+
*/
|
|
14
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
|
|
15
|
+
/**
|
|
16
|
+
* Display only writable calendars available for selection.
|
|
17
|
+
*/
|
|
18
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
|
|
19
|
+
})(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
|
|
20
|
+
|
|
4
21
|
/**
|
|
5
22
|
* Enum representing the selection style for the calendar chooser.
|
|
6
|
-
* @readonly
|
|
7
23
|
* @enum
|
|
24
|
+
* @platform iOS
|
|
8
25
|
*/
|
|
9
26
|
exports.CalendarChooserSelectionStyle = void 0;
|
|
10
27
|
(function (CalendarChooserSelectionStyle) {
|
|
@@ -17,21 +34,38 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
17
34
|
*/
|
|
18
35
|
CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
|
|
19
36
|
})(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
exports.CalendarChooserDisplayStyle = void 0;
|
|
25
|
-
(function (CalendarChooserDisplayStyle) {
|
|
37
|
+
|
|
38
|
+
exports.PluginPermission = void 0;
|
|
39
|
+
(function (PluginPermission) {
|
|
26
40
|
/**
|
|
27
|
-
*
|
|
41
|
+
* Represents the permission state for reading calendar.
|
|
42
|
+
* @platform iOS, Android
|
|
28
43
|
*/
|
|
29
|
-
|
|
44
|
+
PluginPermission["READ_CALENDAR"] = "readCalendar";
|
|
30
45
|
/**
|
|
31
|
-
*
|
|
46
|
+
* Represents the permission state for writing calendar.
|
|
47
|
+
* @platform iOS, Android
|
|
32
48
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
|
|
50
|
+
/**
|
|
51
|
+
* Represents the permission state for reading reminders.
|
|
52
|
+
* @platform iOS
|
|
53
|
+
*/
|
|
54
|
+
PluginPermission["READ_REMINDERS"] = "readReminders";
|
|
55
|
+
/**
|
|
56
|
+
* Represents the permission state for writing reminders.
|
|
57
|
+
* @platform iOS
|
|
58
|
+
*/
|
|
59
|
+
PluginPermission["WRITE_REMINDERS"] = "writeReminders";
|
|
60
|
+
})(exports.PluginPermission || (exports.PluginPermission = {}));
|
|
61
|
+
|
|
62
|
+
exports.ReminderRecurrenceFrequency = void 0;
|
|
63
|
+
(function (ReminderRecurrenceFrequency) {
|
|
64
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
|
|
65
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
|
|
66
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
|
|
67
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
|
|
68
|
+
})(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {}));
|
|
35
69
|
|
|
36
70
|
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
|
|
37
71
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
|
|
@@ -65,6 +99,15 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
65
99
|
createEvent(_options) {
|
|
66
100
|
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
67
101
|
}
|
|
102
|
+
createReminder(_options) {
|
|
103
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
104
|
+
}
|
|
105
|
+
getDefaultRemindersList() {
|
|
106
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
107
|
+
}
|
|
108
|
+
getRemindersLists() {
|
|
109
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
110
|
+
}
|
|
68
111
|
}
|
|
69
112
|
|
|
70
113
|
var web = /*#__PURE__*/Object.freeze({
|
|
@@ -74,8 +117,6 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
74
117
|
|
|
75
118
|
exports.CapacitorCalendar = CapacitorCalendar;
|
|
76
119
|
|
|
77
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
78
|
-
|
|
79
120
|
return exports;
|
|
80
121
|
|
|
81
122
|
})({}, capacitorExports);
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/
|
|
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","import { 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,C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,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,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;;;;;;;;;;;;;;;"}
|
|
@@ -13,4 +13,7 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
|
|
|
13
13
|
CAP_PLUGIN_METHOD(listCalendars, CAPPluginReturnPromise);
|
|
14
14
|
CAP_PLUGIN_METHOD(getDefaultCalendar, CAPPluginReturnPromise);
|
|
15
15
|
CAP_PLUGIN_METHOD(createEvent, CAPPluginReturnPromise);
|
|
16
|
+
CAP_PLUGIN_METHOD(getDefaultRemindersList, CAPPluginReturnPromise);
|
|
17
|
+
CAP_PLUGIN_METHOD(getRemindersLists, CAPPluginReturnPromise);
|
|
18
|
+
CAP_PLUGIN_METHOD(createReminder, CAPPluginReturnPromise);
|
|
16
19
|
)
|
|
@@ -9,7 +9,8 @@ import Capacitor
|
|
|
9
9
|
@objc(CapacitorCalendarPlugin)
|
|
10
10
|
public class CapacitorCalendarPlugin: CAPPlugin {
|
|
11
11
|
private let eventStore = EKEventStore()
|
|
12
|
-
private lazy var
|
|
12
|
+
private lazy var calendar = CapacitorCalendar(bridge: self.bridge, eventStore: self.eventStore)
|
|
13
|
+
private lazy var reminders = CapacitorReminders(eventStore: self.eventStore)
|
|
13
14
|
|
|
14
15
|
@objc public func checkPermission(_ call: CAPPluginCall) {
|
|
15
16
|
guard let alias = call.getString("alias") else {
|
|
@@ -19,13 +20,19 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
19
20
|
|
|
20
21
|
Task {
|
|
21
22
|
do {
|
|
22
|
-
let permissionsState = try await implementation.checkAllPermissions()
|
|
23
|
-
|
|
24
23
|
switch alias {
|
|
25
24
|
case "readCalendar":
|
|
25
|
+
let permissionsState = try await calendar.checkAllPermissions()
|
|
26
26
|
call.resolve(["result": permissionsState["readCalendar"]!])
|
|
27
27
|
case "writeCalendar":
|
|
28
|
+
let permissionsState = try await calendar.checkAllPermissions()
|
|
28
29
|
call.resolve(["result": permissionsState["writeCalendar"]!])
|
|
30
|
+
case "readReminders":
|
|
31
|
+
let permissionsState = try await reminders.checkAllPermissions()
|
|
32
|
+
call.resolve(["result": permissionsState["readReminders"]!])
|
|
33
|
+
case "writeReminders":
|
|
34
|
+
let permissionsState = try await reminders.checkAllPermissions()
|
|
35
|
+
call.resolve(["result": permissionsState["writeReminders"]!])
|
|
29
36
|
default:
|
|
30
37
|
call.reject("[CapacitorCalendar.\(#function)] Could not determine the status of the requested permission")
|
|
31
38
|
return
|
|
@@ -40,8 +47,9 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
40
47
|
@objc public func checkAllPermissions(_ call: CAPPluginCall) {
|
|
41
48
|
Task {
|
|
42
49
|
do {
|
|
43
|
-
let
|
|
44
|
-
|
|
50
|
+
let calendarPermissionsState = try await calendar.checkAllPermissions()
|
|
51
|
+
let remindersPermissionsState = try await reminders.checkAllPermissions()
|
|
52
|
+
call.resolve(calendarPermissionsState.merging(remindersPermissionsState) { (_, new) in new })
|
|
45
53
|
} catch {
|
|
46
54
|
call.reject("[CapacitorCalendar.\(#function)] Could not determine the status of the requested permissions")
|
|
47
55
|
return
|
|
@@ -59,10 +67,16 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
59
67
|
do {
|
|
60
68
|
switch alias {
|
|
61
69
|
case "writeCalendar":
|
|
62
|
-
let result = try await
|
|
70
|
+
let result = try await calendar.requestWriteAccessToEvents()
|
|
63
71
|
call.resolve(result)
|
|
64
72
|
case "readCalendar":
|
|
65
|
-
let result = try await
|
|
73
|
+
let result = try await calendar.requestFullAccessToEvents()
|
|
74
|
+
call.resolve(["result": result])
|
|
75
|
+
case "writeReminders":
|
|
76
|
+
let result = try await reminders.requestFullAccessToReminders()
|
|
77
|
+
call.resolve(["result": result])
|
|
78
|
+
case "readReminders":
|
|
79
|
+
let result = try await reminders.requestFullAccessToReminders()
|
|
66
80
|
call.resolve(["result": result])
|
|
67
81
|
default:
|
|
68
82
|
call.reject("[CapacitorCalendar.\(#function)] Could not authorize \(alias)")
|
|
@@ -78,18 +92,24 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
78
92
|
@objc public func requestAllPermissions(_ call: CAPPluginCall) {
|
|
79
93
|
Task {
|
|
80
94
|
do {
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
]
|
|
95
|
+
let calendarResult = try await calendar.requestFullAccessToEvents()
|
|
96
|
+
let remindersResult = try await reminders.requestFullAccessToReminders()
|
|
97
|
+
var result: [String: String] = [
|
|
98
|
+
"readCalendar": PermissionState.denied.rawValue,
|
|
99
|
+
"writeCalendar": PermissionState.denied.rawValue,
|
|
100
|
+
"readReminders": PermissionState.denied.rawValue,
|
|
101
|
+
"writeReminders": PermissionState.denied.rawValue
|
|
102
|
+
]
|
|
103
|
+
if calendarResult == PermissionState.granted.rawValue {
|
|
104
|
+
result["readCalendar"] = PermissionState.granted.rawValue
|
|
105
|
+
result["writeCalendar"] = PermissionState.granted.rawValue
|
|
92
106
|
}
|
|
107
|
+
if remindersResult == PermissionState.granted.rawValue {
|
|
108
|
+
result["readReminders"] = PermissionState.granted.rawValue
|
|
109
|
+
result["writeReminders"] = PermissionState.granted.rawValue
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
call.resolve(result)
|
|
93
113
|
} catch {
|
|
94
114
|
call.reject("[CapacitorCalendar.\(#function)] Could not authorize all permissions")
|
|
95
115
|
return
|
|
@@ -100,7 +120,7 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
100
120
|
@objc public func createEventWithPrompt(_ call: CAPPluginCall) {
|
|
101
121
|
Task {
|
|
102
122
|
do {
|
|
103
|
-
let result = try await
|
|
123
|
+
let result = try await calendar.createEventWithPrompt()
|
|
104
124
|
call.resolve(["eventCreated": result])
|
|
105
125
|
} catch {
|
|
106
126
|
call.reject("[CapacitorCalendar.\(#function)] Unable to retrieve view controller")
|
|
@@ -121,7 +141,7 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
121
141
|
|
|
122
142
|
Task {
|
|
123
143
|
do {
|
|
124
|
-
let result = try await
|
|
144
|
+
let result = try await calendar.selectCalendarsWithPrompt(selectionStyle: selectionStyle, displayStyle: displayStyle)
|
|
125
145
|
call.resolve(["result": result])
|
|
126
146
|
} catch {
|
|
127
147
|
call.reject("[CapacitorCalendar.\(#function)] Calendars selection prompt got canceled")
|
|
@@ -131,12 +151,12 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
131
151
|
}
|
|
132
152
|
|
|
133
153
|
@objc public func listCalendars(_ call: CAPPluginCall) {
|
|
134
|
-
call.resolve(["result":
|
|
154
|
+
call.resolve(["result": calendar.listCalendars()])
|
|
135
155
|
}
|
|
136
156
|
|
|
137
157
|
@objc public func getDefaultCalendar(_ call: CAPPluginCall) {
|
|
138
158
|
do {
|
|
139
|
-
try call.resolve(["result":
|
|
159
|
+
try call.resolve(["result": calendar.getDefaultCalendar()])
|
|
140
160
|
} catch {
|
|
141
161
|
call.reject("[CapacitorCalendar.\(#function)] No default calendar was found")
|
|
142
162
|
return
|
|
@@ -155,7 +175,7 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
155
175
|
let calendarId = call.getString("calendarId")
|
|
156
176
|
|
|
157
177
|
do {
|
|
158
|
-
try
|
|
178
|
+
try calendar.createEvent(
|
|
159
179
|
title: title,
|
|
160
180
|
calendarId: calendarId,
|
|
161
181
|
location: location,
|
|
@@ -169,4 +189,65 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
169
189
|
return
|
|
170
190
|
}
|
|
171
191
|
}
|
|
192
|
+
|
|
193
|
+
@objc public func getDefaultRemindersList(_ call: CAPPluginCall) {
|
|
194
|
+
do {
|
|
195
|
+
try call.resolve(["result": reminders.getDefaultRemindersList()])
|
|
196
|
+
} catch {
|
|
197
|
+
call.reject("[CapacitorCalendar.\(#function)] No default Reminders list was found")
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@objc public func getRemindersLists(_ call: CAPPluginCall) {
|
|
203
|
+
call.resolve(["result": reminders.getRemindersLists()])
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@objc public func createReminder (_ call: CAPPluginCall) {
|
|
207
|
+
guard let title = call.getString("title") else {
|
|
208
|
+
call.reject("[CapacitorCalendar.\(#function)] A title for the reminder was not provided")
|
|
209
|
+
return
|
|
210
|
+
}
|
|
211
|
+
let listId = call.getString("listId")
|
|
212
|
+
let priority = call.getInt("priority")
|
|
213
|
+
let isCompleted = call.getBool("isCompleted")
|
|
214
|
+
let startDate = call.getDouble("startDate")
|
|
215
|
+
let dueDate = call.getDouble("dueDate")
|
|
216
|
+
let completionDate = call.getDouble("completionDate")
|
|
217
|
+
let notes = call.getString("notes")
|
|
218
|
+
let url = call.getString("url")
|
|
219
|
+
let location = call.getString("location")
|
|
220
|
+
var frequency: Int? = nil
|
|
221
|
+
var interval: Int? = nil
|
|
222
|
+
var end: Double? = nil
|
|
223
|
+
if let recurrence = call.getObject("recurrence") {
|
|
224
|
+
if let repFrequency = recurrence["frequency"] as? Int? {
|
|
225
|
+
frequency = repFrequency
|
|
226
|
+
} else {
|
|
227
|
+
call.reject("[CapacitorCalendar.\(#function)] Frequency must me provided when using recurrence")
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
if let repInterval = recurrence["interval"] as? Int {
|
|
231
|
+
if (repInterval < 1) {
|
|
232
|
+
call.reject("[CapacitorCalendar.\(#function)] Interval must be greater than 0")
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
interval = repInterval
|
|
236
|
+
} else {
|
|
237
|
+
call.reject("[CapacitorCalendar.\(#function)] Interval must me provided when using recurrence")
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
if let repEnd = recurrence["end"] as? Double {
|
|
241
|
+
end = repEnd
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
do {
|
|
246
|
+
try reminders.createReminder(title: title, listId: listId, priority: priority, isCompleted: isCompleted, startDate: startDate, dueDate: dueDate, completionDate: completionDate, notes: notes, url: url, location: location, frequency: frequency, interval: interval, end: end)
|
|
247
|
+
call.resolve(["reminderCreated": true])
|
|
248
|
+
} catch {
|
|
249
|
+
call.reject("[CapacitorCalendar.\(#function)] Unable to create reminder")
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
}
|
|
172
253
|
}
|