@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/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<h1 align="center">CapacitorCalendar</h1>
|
|
2
2
|
<p align="center">
|
|
3
3
|
<em>
|
|
4
|
-
|
|
5
|
-
With CRUD functionalities (Create, Read, Update, Delete), you can seamlessly interact with the device's native
|
|
6
|
-
calendar directly from your app.
|
|
4
|
+
The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.
|
|
7
5
|
</em>
|
|
8
6
|
</p>
|
|
9
7
|
<p align="center">
|
|
@@ -41,7 +39,9 @@ npx cap sync
|
|
|
41
39
|
|:--------------------------------------:|:------------------------------------------:|
|
|
42
40
|
|  |  |
|
|
43
41
|
|
|
44
|
-
On iOS, `readCalendar` permission is not needed when you
|
|
42
|
+
On iOS, `readCalendar` permission is not needed when you a
|
|
43
|
+
|
|
44
|
+
re creating an event using the native prompt.
|
|
45
45
|
The video is just for showing the functionality, otherwise the `createEventWithPrompt` method works without the `readCalendar` authorization.
|
|
46
46
|
|
|
47
47
|
## MVP
|
|
@@ -49,7 +49,7 @@ The video is just for showing the functionality, otherwise the `createEventWithP
|
|
|
49
49
|
- ✅ Choose calendars with prompt (only supported on iOS)
|
|
50
50
|
- ✅ Get list of available calendars
|
|
51
51
|
- ✅ Get default calendar
|
|
52
|
-
-
|
|
52
|
+
- ✅ Create calendar events without native prompts
|
|
53
53
|
- ⌛️ Create reminders (only supported on iOS)
|
|
54
54
|
- ⌛️ Find calendar events
|
|
55
55
|
- ⌛️ Delete calendar events
|
|
@@ -75,6 +75,9 @@ permissions can be found below:
|
|
|
75
75
|
* [`listCalendars()`](#listcalendars)
|
|
76
76
|
* [`getDefaultCalendar()`](#getdefaultcalendar)
|
|
77
77
|
* [`createEvent(...)`](#createevent)
|
|
78
|
+
* [`getDefaultRemindersList()`](#getdefaultreminderslist)
|
|
79
|
+
* [`getRemindersLists()`](#getreminderslists)
|
|
80
|
+
* [`createReminder(...)`](#createreminder)
|
|
78
81
|
* [Interfaces](#interfaces)
|
|
79
82
|
* [Type Aliases](#type-aliases)
|
|
80
83
|
* [Enums](#enums)
|
|
@@ -87,14 +90,14 @@ permissions can be found below:
|
|
|
87
90
|
### checkPermission(...)
|
|
88
91
|
|
|
89
92
|
```typescript
|
|
90
|
-
checkPermission(options: { alias:
|
|
93
|
+
checkPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
|
|
91
94
|
```
|
|
92
95
|
|
|
93
96
|
Checks the current authorization status of a specific permission.
|
|
94
97
|
|
|
95
|
-
| Param | Type
|
|
96
|
-
| ------------- |
|
|
97
|
-
| **`options`** | <code>{ alias:
|
|
98
|
+
| Param | Type | Description |
|
|
99
|
+
| ------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
|
|
100
|
+
| **`options`** | <code>{ alias: <a href="#pluginpermission">PluginPermission</a>; }</code> | An object with the name of the permission |
|
|
98
101
|
|
|
99
102
|
**Returns:** <code>Promise<{ result: <a href="#permissionstate">PermissionState</a>; }></code>
|
|
100
103
|
|
|
@@ -104,12 +107,12 @@ Checks the current authorization status of a specific permission.
|
|
|
104
107
|
### checkAllPermissions()
|
|
105
108
|
|
|
106
109
|
```typescript
|
|
107
|
-
checkAllPermissions() => Promise<
|
|
110
|
+
checkAllPermissions() => Promise<PluginPermissionsMap>
|
|
108
111
|
```
|
|
109
112
|
|
|
110
113
|
Checks the current authorization status of all the required permissions for the plugin.
|
|
111
114
|
|
|
112
|
-
**Returns:** <code>Promise<<a href="#
|
|
115
|
+
**Returns:** <code>Promise<<a href="#pluginpermissionsmap">PluginPermissionsMap</a>></code>
|
|
113
116
|
|
|
114
117
|
--------------------
|
|
115
118
|
|
|
@@ -117,15 +120,15 @@ Checks the current authorization status of all the required permissions for the
|
|
|
117
120
|
### requestPermission(...)
|
|
118
121
|
|
|
119
122
|
```typescript
|
|
120
|
-
requestPermission(options: { alias:
|
|
123
|
+
requestPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
|
|
121
124
|
```
|
|
122
125
|
|
|
123
126
|
Requests authorization to a specific permission, if not already granted.
|
|
124
127
|
If the permission is already granted, it will directly return the status.
|
|
125
128
|
|
|
126
|
-
| Param | Type
|
|
127
|
-
| ------------- |
|
|
128
|
-
| **`options`** | <code>{ alias:
|
|
129
|
+
| Param | Type | Description |
|
|
130
|
+
| ------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
|
|
131
|
+
| **`options`** | <code>{ alias: <a href="#pluginpermission">PluginPermission</a>; }</code> | An object with the name of the permission |
|
|
129
132
|
|
|
130
133
|
**Returns:** <code>Promise<{ result: <a href="#permissionstate">PermissionState</a>; }></code>
|
|
131
134
|
|
|
@@ -135,12 +138,12 @@ If the permission is already granted, it will directly return the status.
|
|
|
135
138
|
### requestAllPermissions()
|
|
136
139
|
|
|
137
140
|
```typescript
|
|
138
|
-
requestAllPermissions() => Promise<
|
|
141
|
+
requestAllPermissions() => Promise<PluginPermissionsMap>
|
|
139
142
|
```
|
|
140
143
|
|
|
141
144
|
Requests authorization to all the required permissions for the plugin, if they have not already been granted.
|
|
142
145
|
|
|
143
|
-
**Returns:** <code>Promise<<a href="#
|
|
146
|
+
**Returns:** <code>Promise<<a href="#pluginpermissionsmap">PluginPermissionsMap</a>></code>
|
|
144
147
|
|
|
145
148
|
--------------------
|
|
146
149
|
|
|
@@ -221,17 +224,53 @@ Creates an event with the provided options.
|
|
|
221
224
|
--------------------
|
|
222
225
|
|
|
223
226
|
|
|
224
|
-
###
|
|
227
|
+
### getDefaultRemindersList()
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
getDefaultRemindersList() => Promise<{ result: RemindersList; }>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Retrieves the default reminders list set on the device.
|
|
234
|
+
|
|
235
|
+
**Returns:** <code>Promise<{ result: <a href="#reminderslist">RemindersList</a>; }></code>
|
|
236
|
+
|
|
237
|
+
--------------------
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
### getRemindersLists()
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
getRemindersLists() => Promise<{ result: RemindersList[]; }>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Retrieves all available reminders lists on the device.
|
|
247
|
+
|
|
248
|
+
**Returns:** <code>Promise<{ result: RemindersList[]; }></code>
|
|
249
|
+
|
|
250
|
+
--------------------
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
### createReminder(...)
|
|
225
254
|
|
|
255
|
+
```typescript
|
|
256
|
+
createReminder(options: { title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: ReminderRecurrenceRule; }) => Promise<{ reminderCreated: boolean; }>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Creates a reminder with the provided options.
|
|
260
|
+
|
|
261
|
+
| Param | Type | Description |
|
|
262
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
263
|
+
| **`options`** | <code>{ title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: <a href="#reminderrecurrencerule">ReminderRecurrenceRule</a>; }</code> | - Options for creating the reminder. |
|
|
264
|
+
|
|
265
|
+
**Returns:** <code>Promise<{ reminderCreated: boolean; }></code>
|
|
266
|
+
|
|
267
|
+
--------------------
|
|
226
268
|
|
|
227
|
-
#### CalendarPermissionStatus
|
|
228
269
|
|
|
229
|
-
|
|
270
|
+
### Interfaces
|
|
230
271
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
| **`readCalendar`** | <code><a href="#permissionstate">PermissionState</a></code> |
|
|
234
|
-
| **`writeCalendar`** | <code><a href="#permissionstate">PermissionState</a></code> |
|
|
272
|
+
|
|
273
|
+
#### PluginPermissionsMap
|
|
235
274
|
|
|
236
275
|
|
|
237
276
|
#### Calendar
|
|
@@ -295,6 +334,18 @@ Enables basic storage and retrieval of dates and times.
|
|
|
295
334
|
| **toJSON** | (key?: any) => string | Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. |
|
|
296
335
|
|
|
297
336
|
|
|
337
|
+
#### RemindersList
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
#### ReminderRecurrenceRule
|
|
341
|
+
|
|
342
|
+
| Prop | Type | Description |
|
|
343
|
+
| --------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
344
|
+
| **`frequency`** | <code><a href="#reminderrecurrencefrequency">ReminderRecurrenceFrequency</a></code> | How frequent should the reminder repeat. |
|
|
345
|
+
| **`interval`** | <code>number</code> | The interval should be a number greater than 0. For values lower than 1 the method will throw an error. |
|
|
346
|
+
| **`end`** | <code>number</code> | When provided, the reminder will stop repeating at the given time. |
|
|
347
|
+
|
|
348
|
+
|
|
298
349
|
### Type Aliases
|
|
299
350
|
|
|
300
351
|
|
|
@@ -306,6 +357,16 @@ Enables basic storage and retrieval of dates and times.
|
|
|
306
357
|
### Enums
|
|
307
358
|
|
|
308
359
|
|
|
360
|
+
#### PluginPermission
|
|
361
|
+
|
|
362
|
+
| Members | Value | Description |
|
|
363
|
+
| --------------------- | ----------------------------- | ------------------------------------------------------ |
|
|
364
|
+
| **`READ_CALENDAR`** | <code>'readCalendar'</code> | Represents the permission state for reading calendar. |
|
|
365
|
+
| **`WRITE_CALENDAR`** | <code>'writeCalendar'</code> | Represents the permission state for writing calendar. |
|
|
366
|
+
| **`READ_REMINDERS`** | <code>'readReminders'</code> | Represents the permission state for reading reminders. |
|
|
367
|
+
| **`WRITE_REMINDERS`** | <code>'writeReminders'</code> | Represents the permission state for writing reminders. |
|
|
368
|
+
|
|
369
|
+
|
|
309
370
|
#### CalendarChooserDisplayStyle
|
|
310
371
|
|
|
311
372
|
| Members | Description |
|
|
@@ -321,4 +382,14 @@ Enables basic storage and retrieval of dates and times.
|
|
|
321
382
|
| **`SINGLE`** | Allows only a single selection in the calendar chooser. |
|
|
322
383
|
| **`MULTIPLE`** | Allows multiple selections in the calendar chooser. |
|
|
323
384
|
|
|
385
|
+
|
|
386
|
+
#### ReminderRecurrenceFrequency
|
|
387
|
+
|
|
388
|
+
| Members |
|
|
389
|
+
| ------------- |
|
|
390
|
+
| **`DAILY`** |
|
|
391
|
+
| **`WEEKLY`** |
|
|
392
|
+
| **`MONTHLY`** |
|
|
393
|
+
| **`YEARLY`** |
|
|
394
|
+
|
|
324
395
|
</docgen-api>
|
|
@@ -183,4 +183,22 @@ class CapacitorCalendarPlugin: Plugin() {
|
|
|
183
183
|
return
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
+
|
|
187
|
+
@PluginMethod
|
|
188
|
+
fun getDefaultRemindersList(call: PluginCall) {
|
|
189
|
+
call.unimplemented("[CapacitorCalendar.${::getDefaultRemindersList.name}] Not implemented on Android")
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@PluginMethod
|
|
194
|
+
fun getRemindersLists(call: PluginCall) {
|
|
195
|
+
call.unimplemented("[CapacitorCalendar.${::getRemindersLists.name}] Not implemented on Android")
|
|
196
|
+
return
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@PluginMethod
|
|
200
|
+
fun createReminder(call: PluginCall) {
|
|
201
|
+
call.unimplemented("[CapacitorCalendar.${::createReminder.name}] Not implemented on Android")
|
|
202
|
+
return
|
|
203
|
+
}
|
|
186
204
|
}
|