@capgo/capacitor-alarm 8.0.5 → 8.0.7

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 CHANGED
@@ -23,6 +23,17 @@ Essential for alarm clock apps, reminder apps, medication trackers, and any app
23
23
 
24
24
  The most complete doc is available here: https://capgo.app/docs/plugins/alarm/
25
25
 
26
+ ## Compatibility
27
+
28
+ | Plugin version | Capacitor compatibility | Maintained |
29
+ | -------------- | ----------------------- | ---------- |
30
+ | v8.\*.\* | v8.\*.\* | ✅ |
31
+ | v7.\*.\* | v7.\*.\* | On demand |
32
+ | v6.\*.\* | v6.\*.\* | ❌ |
33
+ | v5.\*.\* | v5.\*.\* | ❌ |
34
+
35
+ > **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
36
+
26
37
  ## Install
27
38
 
28
39
  ```bash
@@ -37,6 +48,12 @@ npx cap sync
37
48
 
38
49
  Note: This plugin only exposes native alarm actions (create/open). It does not implement any custom in-app alarm scheduling/CRUD.
39
50
 
51
+ ## Permission checks
52
+
53
+ Use `CapgoAlarm.checkPermissions()` to query whether AlarmKit (iOS) or the platform clock integration (Android) is ready before prompting users. The method never opens system UI and returns a `PermissionResult` with `details` describing platform-specific states (for example, `{ alarmKit: true }` on iOS or `{ exactAlarm: false }` on Android 12+).
54
+
55
+ If your native runtime ships an older build of this plugin that predates the `checkPermissions` bridge, the JavaScript shim resolves with `{ granted: false, message: 'CapgoAlarm.checkPermissions is not implemented...' }` so you can gracefully fall back to feature detection or request an update.
56
+
40
57
  ## API
41
58
 
42
59
  <docgen-index>
@@ -45,7 +62,9 @@ Note: This plugin only exposes native alarm actions (create/open). It does not i
45
62
  * [`openAlarms()`](#openalarms)
46
63
  * [`getOSInfo()`](#getosinfo)
47
64
  * [`requestPermissions(...)`](#requestpermissions)
65
+ * [`checkPermissions()`](#checkpermissions)
48
66
  * [`getPluginVersion()`](#getpluginversion)
67
+ * [`getAlarms()`](#getalarms)
49
68
  * [Interfaces](#interfaces)
50
69
  * [Type Aliases](#type-aliases)
51
70
 
@@ -126,6 +145,22 @@ On Android, may route to settings for exact alarms.
126
145
  --------------------
127
146
 
128
147
 
148
+ ### checkPermissions()
149
+
150
+ ```typescript
151
+ checkPermissions() => Promise<PermissionResult>
152
+ ```
153
+
154
+ Check the current permission state for native alarm access without triggering UI.
155
+ On iOS this reports AlarmKit readiness; on Android it reports capability details.
156
+
157
+ **Returns:** <code>Promise&lt;<a href="#permissionresult">PermissionResult</a>&gt;</code>
158
+
159
+ **Since:** 8.0.4
160
+
161
+ --------------------
162
+
163
+
129
164
  ### getPluginVersion()
130
165
 
131
166
  ```typescript
@@ -141,6 +176,23 @@ Get the native Capacitor plugin version.
141
176
  --------------------
142
177
 
143
178
 
179
+ ### getAlarms()
180
+
181
+ ```typescript
182
+ getAlarms() => Promise<{ alarms: AlarmInfo[]; message?: string; }>
183
+ ```
184
+
185
+ Get a list of alarms scheduled by this app.
186
+ On iOS 26+, returns alarms from AlarmKit. On Android, this is not supported
187
+ as the system does not provide an API to query alarms.
188
+
189
+ **Returns:** <code>Promise&lt;{ alarms: AlarmInfo[]; message?: string; }&gt;</code>
190
+
191
+ **Since:** 1.1.0
192
+
193
+ --------------------
194
+
195
+
144
196
  ### Interfaces
145
197
 
146
198
 
@@ -188,6 +240,20 @@ Result of a permissions request.
188
240
  | ------------- | ---------------------------------------------------------------- | ---------------------------------- |
189
241
  | **`granted`** | <code>boolean</code> | Overall grant for requested scope |
190
242
  | **`details`** | <code><a href="#record">Record</a>&lt;string, boolean&gt;</code> | Optional details by permission key |
243
+ | **`message`** | <code>string</code> | Optional human readable diagnostic |
244
+
245
+
246
+ #### AlarmInfo
247
+
248
+ Information about a scheduled alarm.
249
+
250
+ | Prop | Type | Description |
251
+ | ------------- | -------------------- | -------------------------------- |
252
+ | **`id`** | <code>string</code> | Unique identifier for the alarm |
253
+ | **`hour`** | <code>number</code> | Hour of day in 24h format (0-23) |
254
+ | **`minute`** | <code>number</code> | Minute of hour (0-59) |
255
+ | **`label`** | <code>string</code> | Optional label for the alarm |
256
+ | **`enabled`** | <code>boolean</code> | Whether the alarm is enabled |
191
257
 
192
258
 
193
259
  ### Type Aliases
@@ -30,7 +30,7 @@ android {
30
30
  buildTypes {
31
31
  release {
32
32
  minifyEnabled false
33
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
33
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
34
34
  }
35
35
  }
36
36
  lintOptions {
@@ -5,6 +5,7 @@ import android.content.Context;
5
5
  import android.content.Intent;
6
6
  import android.os.Build;
7
7
  import android.provider.AlarmClock;
8
+ import android.util.Log;
8
9
  import com.getcapacitor.JSObject;
9
10
  import com.getcapacitor.Plugin;
10
11
  import com.getcapacitor.PluginCall;
@@ -14,7 +15,8 @@ import com.getcapacitor.annotation.CapacitorPlugin;
14
15
  @CapacitorPlugin(name = "CapgoAlarm")
15
16
  public class CapgoAlarmPlugin extends Plugin {
16
17
 
17
- private final String pluginVersion = "8.0.5";
18
+ private final String pluginVersion = "8.0.7";
19
+ private static final String TAG = "CapgoAlarmPlugin";
18
20
 
19
21
  // ===== Native OS Alarm helpers (Android) =====
20
22
  @PluginMethod
@@ -82,7 +84,7 @@ public class CapgoAlarmPlugin extends Plugin {
82
84
  call.resolve(ret);
83
85
  }
84
86
 
85
- @PluginMethod
87
+ @Override
86
88
  public void requestPermissions(PluginCall call) {
87
89
  boolean requestExact = call.getBoolean("exactAlarm", false);
88
90
  JSObject ret = new JSObject();
@@ -107,6 +109,49 @@ public class CapgoAlarmPlugin extends Plugin {
107
109
  call.resolve(ret);
108
110
  }
109
111
 
112
+ @Override
113
+ public void checkPermissions(PluginCall call) {
114
+ JSObject ret = new JSObject();
115
+ JSObject details = new JSObject();
116
+ boolean granted = Build.VERSION.SDK_INT < Build.VERSION_CODES.S;
117
+ boolean hasDetails = false;
118
+ String message = null;
119
+
120
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
121
+ try {
122
+ Context context = getContext();
123
+ if (context == null) {
124
+ throw new IllegalStateException("Plugin context unavailable");
125
+ }
126
+ AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
127
+ boolean canExact = am != null && am.canScheduleExactAlarms();
128
+ details.put("exactAlarm", canExact);
129
+ hasDetails = true;
130
+ granted = canExact;
131
+ if (!canExact) {
132
+ message = "Exact alarm permission not granted";
133
+ }
134
+ } catch (Exception e) {
135
+ details.put("exactAlarm", false);
136
+ hasDetails = true;
137
+ message = "Failed to query exact alarm capability";
138
+ Log.w(TAG, "Unable to determine exact alarm capability status", e);
139
+ granted = false;
140
+ }
141
+ } else {
142
+ message = "Exact alarm capability check requires Android S+";
143
+ }
144
+
145
+ ret.put("granted", granted);
146
+ if (hasDetails) {
147
+ ret.put("details", details);
148
+ }
149
+ if (message != null) {
150
+ ret.put("message", message);
151
+ }
152
+ call.resolve(ret);
153
+ }
154
+
110
155
  @PluginMethod
111
156
  public void getPluginVersion(final PluginCall call) {
112
157
  try {
@@ -117,4 +162,13 @@ public class CapgoAlarmPlugin extends Plugin {
117
162
  call.reject("Could not get plugin version", e);
118
163
  }
119
164
  }
165
+
166
+ @PluginMethod
167
+ public void getAlarms(PluginCall call) {
168
+ // Android does not provide a public API to query system alarms
169
+ // Each app must track its own alarms
170
+ JSObject ret = new JSObject();
171
+ ret.put("alarms", new org.json.JSONArray());
172
+ call.resolve(ret);
173
+ }
120
174
  }
package/dist/docs.json CHANGED
@@ -147,6 +147,35 @@
147
147
  ],
148
148
  "slug": "requestpermissions"
149
149
  },
150
+ {
151
+ "name": "checkPermissions",
152
+ "signature": "() => Promise<PermissionResult>",
153
+ "parameters": [],
154
+ "returns": "Promise<PermissionResult>",
155
+ "tags": [
156
+ {
157
+ "name": "returns",
158
+ "text": "Promise that resolves with the permission result"
159
+ },
160
+ {
161
+ "name": "throws",
162
+ "text": "Error if the native layer fails to respond"
163
+ },
164
+ {
165
+ "name": "since",
166
+ "text": "8.0.4"
167
+ },
168
+ {
169
+ "name": "example",
170
+ "text": "```typescript\nconst status = await CapgoAlarm.checkPermissions();\nconsole.log('AlarmKit allowed?', status.details?.alarmKit);\n```"
171
+ }
172
+ ],
173
+ "docs": "Check the current permission state for native alarm access without triggering UI.\nOn iOS this reports AlarmKit readiness; on Android it reports capability details.",
174
+ "complexTypes": [
175
+ "PermissionResult"
176
+ ],
177
+ "slug": "checkpermissions"
178
+ },
150
179
  {
151
180
  "name": "getPluginVersion",
152
181
  "signature": "() => Promise<{ version: string; }>",
@@ -173,6 +202,31 @@
173
202
  "docs": "Get the native Capacitor plugin version.",
174
203
  "complexTypes": [],
175
204
  "slug": "getpluginversion"
205
+ },
206
+ {
207
+ "name": "getAlarms",
208
+ "signature": "() => Promise<{ alarms: AlarmInfo[]; message?: string; }>",
209
+ "parameters": [],
210
+ "returns": "Promise<{ alarms: AlarmInfo[]; message?: string | undefined; }>",
211
+ "tags": [
212
+ {
213
+ "name": "returns",
214
+ "text": "Promise that resolves with an array of alarm information"
215
+ },
216
+ {
217
+ "name": "since",
218
+ "text": "1.1.0"
219
+ },
220
+ {
221
+ "name": "example",
222
+ "text": "```typescript\nconst { alarms } = await CapgoAlarm.getAlarms();\nconsole.log('Scheduled alarms:', alarms);\nalarms.forEach(alarm => {\n console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);\n});\n```"
223
+ }
224
+ ],
225
+ "docs": "Get a list of alarms scheduled by this app.\nOn iOS 26+, returns alarms from AlarmKit. On Android, this is not supported\nas the system does not provide an API to query alarms.",
226
+ "complexTypes": [
227
+ "AlarmInfo"
228
+ ],
229
+ "slug": "getalarms"
176
230
  }
177
231
  ],
178
232
  "properties": []
@@ -331,6 +385,62 @@
331
385
  "Record"
332
386
  ],
333
387
  "type": "Record<string, boolean>"
388
+ },
389
+ {
390
+ "name": "message",
391
+ "tags": [],
392
+ "docs": "Optional human readable diagnostic",
393
+ "complexTypes": [],
394
+ "type": "string | undefined"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ "name": "AlarmInfo",
400
+ "slug": "alarminfo",
401
+ "docs": "Information about a scheduled alarm.",
402
+ "tags": [
403
+ {
404
+ "text": "1.1.0",
405
+ "name": "since"
406
+ }
407
+ ],
408
+ "methods": [],
409
+ "properties": [
410
+ {
411
+ "name": "id",
412
+ "tags": [],
413
+ "docs": "Unique identifier for the alarm",
414
+ "complexTypes": [],
415
+ "type": "string"
416
+ },
417
+ {
418
+ "name": "hour",
419
+ "tags": [],
420
+ "docs": "Hour of day in 24h format (0-23)",
421
+ "complexTypes": [],
422
+ "type": "number"
423
+ },
424
+ {
425
+ "name": "minute",
426
+ "tags": [],
427
+ "docs": "Minute of hour (0-59)",
428
+ "complexTypes": [],
429
+ "type": "number"
430
+ },
431
+ {
432
+ "name": "label",
433
+ "tags": [],
434
+ "docs": "Optional label for the alarm",
435
+ "complexTypes": [],
436
+ "type": "string | undefined"
437
+ },
438
+ {
439
+ "name": "enabled",
440
+ "tags": [],
441
+ "docs": "Whether the alarm is enabled",
442
+ "complexTypes": [],
443
+ "type": "boolean | undefined"
334
444
  }
335
445
  ]
336
446
  }
@@ -26,6 +26,23 @@ export interface NativeActionResult {
26
26
  /** Optional message with additional information */
27
27
  message?: string;
28
28
  }
29
+ /**
30
+ * Information about a scheduled alarm.
31
+ *
32
+ * @since 1.1.0
33
+ */
34
+ export interface AlarmInfo {
35
+ /** Unique identifier for the alarm */
36
+ id: string;
37
+ /** Hour of day in 24h format (0-23) */
38
+ hour: number;
39
+ /** Minute of hour (0-59) */
40
+ minute: number;
41
+ /** Optional label for the alarm */
42
+ label?: string;
43
+ /** Whether the alarm is enabled */
44
+ enabled?: boolean;
45
+ }
29
46
  /**
30
47
  * Returned info about current OS and capabilities.
31
48
  *
@@ -53,6 +70,8 @@ export interface PermissionResult {
53
70
  granted: boolean;
54
71
  /** Optional details by permission key */
55
72
  details?: Record<string, boolean>;
73
+ /** Optional human readable diagnostic */
74
+ message?: string;
56
75
  }
57
76
  /**
58
77
  * Capacitor Alarm Plugin interface for managing native OS alarms.
@@ -134,6 +153,20 @@ export interface CapgoAlarmPlugin {
134
153
  requestPermissions(options?: {
135
154
  exactAlarm?: boolean;
136
155
  }): Promise<PermissionResult>;
156
+ /**
157
+ * Check the current permission state for native alarm access without triggering UI.
158
+ * On iOS this reports AlarmKit readiness; on Android it reports capability details.
159
+ *
160
+ * @returns Promise that resolves with the permission result
161
+ * @throws Error if the native layer fails to respond
162
+ * @since 8.0.4
163
+ * @example
164
+ * ```typescript
165
+ * const status = await CapgoAlarm.checkPermissions();
166
+ * console.log('AlarmKit allowed?', status.details?.alarmKit);
167
+ * ```
168
+ */
169
+ checkPermissions(): Promise<PermissionResult>;
137
170
  /**
138
171
  * Get the native Capacitor plugin version.
139
172
  *
@@ -149,4 +182,24 @@ export interface CapgoAlarmPlugin {
149
182
  getPluginVersion(): Promise<{
150
183
  version: string;
151
184
  }>;
185
+ /**
186
+ * Get a list of alarms scheduled by this app.
187
+ * On iOS 26+, returns alarms from AlarmKit. On Android, this is not supported
188
+ * as the system does not provide an API to query alarms.
189
+ *
190
+ * @returns Promise that resolves with an array of alarm information
191
+ * @since 1.1.0
192
+ * @example
193
+ * ```typescript
194
+ * const { alarms } = await CapgoAlarm.getAlarms();
195
+ * console.log('Scheduled alarms:', alarms);
196
+ * alarms.forEach(alarm => {
197
+ * console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);
198
+ * });
199
+ * ```
200
+ */
201
+ getAlarms(): Promise<{
202
+ alarms: AlarmInfo[];
203
+ message?: string;
204
+ }>;
152
205
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for creating a native OS alarm via the platform clock app.\n *\n * @since 1.0.0\n */\nexport interface NativeAlarmCreateOptions {\n /** Hour of day in 24h format (0-23) */\n hour: number;\n /** Minute of hour (0-59) */\n minute: number;\n /** Optional label for the alarm */\n label?: string;\n /** Android only: attempt to skip UI if possible */\n skipUi?: boolean;\n /** Android only: set alarm to vibrate */\n vibrate?: boolean;\n}\n\n/**\n * Result of a native action.\n *\n * @since 1.0.0\n */\nexport interface NativeActionResult {\n /** Whether the action was successful */\n success: boolean;\n /** Optional message with additional information */\n message?: string;\n}\n\n/**\n * Returned info about current OS and capabilities.\n *\n * @since 1.0.0\n */\nexport interface OSInfo {\n /** Platform identifier: 'ios' | 'android' | 'web' */\n platform: string;\n /** OS version string */\n version: string;\n /** Whether the platform exposes a native alarm app integration */\n supportsNativeAlarms: boolean;\n /** Whether scheduling local notifications is supported */\n supportsScheduledNotifications: boolean;\n /** Android only: whether exact alarms are allowed */\n canScheduleExactAlarms?: boolean;\n}\n\n/**\n * Result of a permissions request.\n *\n * @since 1.0.0\n */\nexport interface PermissionResult {\n /** Overall grant for requested scope */\n granted: boolean;\n /** Optional details by permission key */\n details?: Record<string, boolean>;\n}\n\n/**\n * Capacitor Alarm Plugin interface for managing native OS alarms.\n *\n * @since 1.0.0\n */\nexport interface CapgoAlarmPlugin {\n /**\n * Create a native OS alarm using the platform clock app.\n * On Android this uses the Alarm Clock intent; on iOS this uses AlarmKit if available (iOS 16+).\n *\n * @param options - Options for creating the alarm\n * @returns Promise that resolves with the action result\n * @throws Error if alarm creation fails or permissions are not granted\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.createAlarm({\n * hour: 7,\n * minute: 30,\n * label: 'Wake up',\n * skipUi: false,\n * vibrate: true\n * });\n * console.log('Alarm created:', result.success);\n * ```\n */\n createAlarm(options: NativeAlarmCreateOptions): Promise<NativeActionResult>;\n\n /**\n * Open the platform's native alarm list UI, if available.\n *\n * @returns Promise that resolves with the action result\n * @throws Error if opening alarms UI fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.openAlarms();\n * if (result.success) {\n * console.log('Alarms UI opened');\n * }\n * ```\n */\n openAlarms(): Promise<NativeActionResult>;\n\n /**\n * Get information about the OS and capabilities.\n *\n * @returns Promise that resolves with OS information\n * @throws Error if getting OS info fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const info = await CapgoAlarm.getOSInfo();\n * console.log('Platform:', info.platform);\n * console.log('Supports native alarms:', info.supportsNativeAlarms);\n * if (info.platform === 'android') {\n * console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);\n * }\n * ```\n */\n getOSInfo(): Promise<OSInfo>;\n\n /**\n * Request relevant permissions for alarm usage on the platform.\n * On Android, may route to settings for exact alarms.\n *\n * @param options - Optional parameters for the permission request\n * @returns Promise that resolves with the permission result\n * @throws Error if permission request fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.requestPermissions({ exactAlarm: true });\n * if (result.granted) {\n * console.log('Permissions granted');\n * } else {\n * console.log('Permissions denied');\n * }\n * ```\n */\n requestPermissions(options?: { exactAlarm?: boolean }): Promise<PermissionResult>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const { version } = await CapgoAlarm.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for creating a native OS alarm via the platform clock app.\n *\n * @since 1.0.0\n */\nexport interface NativeAlarmCreateOptions {\n /** Hour of day in 24h format (0-23) */\n hour: number;\n /** Minute of hour (0-59) */\n minute: number;\n /** Optional label for the alarm */\n label?: string;\n /** Android only: attempt to skip UI if possible */\n skipUi?: boolean;\n /** Android only: set alarm to vibrate */\n vibrate?: boolean;\n}\n\n/**\n * Result of a native action.\n *\n * @since 1.0.0\n */\nexport interface NativeActionResult {\n /** Whether the action was successful */\n success: boolean;\n /** Optional message with additional information */\n message?: string;\n}\n\n/**\n * Information about a scheduled alarm.\n *\n * @since 1.1.0\n */\nexport interface AlarmInfo {\n /** Unique identifier for the alarm */\n id: string;\n /** Hour of day in 24h format (0-23) */\n hour: number;\n /** Minute of hour (0-59) */\n minute: number;\n /** Optional label for the alarm */\n label?: string;\n /** Whether the alarm is enabled */\n enabled?: boolean;\n}\n\n/**\n * Returned info about current OS and capabilities.\n *\n * @since 1.0.0\n */\nexport interface OSInfo {\n /** Platform identifier: 'ios' | 'android' | 'web' */\n platform: string;\n /** OS version string */\n version: string;\n /** Whether the platform exposes a native alarm app integration */\n supportsNativeAlarms: boolean;\n /** Whether scheduling local notifications is supported */\n supportsScheduledNotifications: boolean;\n /** Android only: whether exact alarms are allowed */\n canScheduleExactAlarms?: boolean;\n}\n\n/**\n * Result of a permissions request.\n *\n * @since 1.0.0\n */\nexport interface PermissionResult {\n /** Overall grant for requested scope */\n granted: boolean;\n /** Optional details by permission key */\n details?: Record<string, boolean>;\n /** Optional human readable diagnostic */\n message?: string;\n}\n\n/**\n * Capacitor Alarm Plugin interface for managing native OS alarms.\n *\n * @since 1.0.0\n */\nexport interface CapgoAlarmPlugin {\n /**\n * Create a native OS alarm using the platform clock app.\n * On Android this uses the Alarm Clock intent; on iOS this uses AlarmKit if available (iOS 16+).\n *\n * @param options - Options for creating the alarm\n * @returns Promise that resolves with the action result\n * @throws Error if alarm creation fails or permissions are not granted\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.createAlarm({\n * hour: 7,\n * minute: 30,\n * label: 'Wake up',\n * skipUi: false,\n * vibrate: true\n * });\n * console.log('Alarm created:', result.success);\n * ```\n */\n createAlarm(options: NativeAlarmCreateOptions): Promise<NativeActionResult>;\n\n /**\n * Open the platform's native alarm list UI, if available.\n *\n * @returns Promise that resolves with the action result\n * @throws Error if opening alarms UI fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.openAlarms();\n * if (result.success) {\n * console.log('Alarms UI opened');\n * }\n * ```\n */\n openAlarms(): Promise<NativeActionResult>;\n\n /**\n * Get information about the OS and capabilities.\n *\n * @returns Promise that resolves with OS information\n * @throws Error if getting OS info fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const info = await CapgoAlarm.getOSInfo();\n * console.log('Platform:', info.platform);\n * console.log('Supports native alarms:', info.supportsNativeAlarms);\n * if (info.platform === 'android') {\n * console.log('Can schedule exact alarms:', info.canScheduleExactAlarms);\n * }\n * ```\n */\n getOSInfo(): Promise<OSInfo>;\n\n /**\n * Request relevant permissions for alarm usage on the platform.\n * On Android, may route to settings for exact alarms.\n *\n * @param options - Optional parameters for the permission request\n * @returns Promise that resolves with the permission result\n * @throws Error if permission request fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const result = await CapgoAlarm.requestPermissions({ exactAlarm: true });\n * if (result.granted) {\n * console.log('Permissions granted');\n * } else {\n * console.log('Permissions denied');\n * }\n * ```\n */\n requestPermissions(options?: { exactAlarm?: boolean }): Promise<PermissionResult>;\n\n /**\n * Check the current permission state for native alarm access without triggering UI.\n * On iOS this reports AlarmKit readiness; on Android it reports capability details.\n *\n * @returns Promise that resolves with the permission result\n * @throws Error if the native layer fails to respond\n * @since 8.0.4\n * @example\n * ```typescript\n * const status = await CapgoAlarm.checkPermissions();\n * console.log('AlarmKit allowed?', status.details?.alarmKit);\n * ```\n */\n checkPermissions(): Promise<PermissionResult>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @throws Error if getting the version fails\n * @since 1.0.0\n * @example\n * ```typescript\n * const { version } = await CapgoAlarm.getPluginVersion();\n * console.log('Plugin version:', version);\n * ```\n */\n getPluginVersion(): Promise<{ version: string }>;\n\n /**\n * Get a list of alarms scheduled by this app.\n * On iOS 26+, returns alarms from AlarmKit. On Android, this is not supported\n * as the system does not provide an API to query alarms.\n *\n * @returns Promise that resolves with an array of alarm information\n * @since 1.1.0\n * @example\n * ```typescript\n * const { alarms } = await CapgoAlarm.getAlarms();\n * console.log('Scheduled alarms:', alarms);\n * alarms.forEach(alarm => {\n * console.log(`Alarm ${alarm.id}: ${alarm.hour}:${alarm.minute} - ${alarm.label}`);\n * });\n * ```\n */\n getAlarms(): Promise<{ alarms: AlarmInfo[]; message?: string }>;\n}\n"]}
package/dist/esm/index.js CHANGED
@@ -1,7 +1,38 @@
1
+ var _a;
1
2
  import { registerPlugin } from '@capacitor/core';
2
3
  const CapgoAlarm = registerPlugin('CapgoAlarm', {
3
4
  web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),
4
5
  });
6
+ const missingCheckPermissionsResult = {
7
+ granted: false,
8
+ message: 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',
9
+ };
10
+ const nativeCheckPermissions = (_a = CapgoAlarm.checkPermissions) === null || _a === void 0 ? void 0 : _a.bind(CapgoAlarm);
11
+ CapgoAlarm.checkPermissions = (async () => {
12
+ if (!nativeCheckPermissions) {
13
+ return missingCheckPermissionsResult;
14
+ }
15
+ try {
16
+ return await nativeCheckPermissions();
17
+ }
18
+ catch (error) {
19
+ if (isUnimplementedError(error)) {
20
+ return missingCheckPermissionsResult;
21
+ }
22
+ throw error;
23
+ }
24
+ });
25
+ function isUnimplementedError(error) {
26
+ if (!error || typeof error !== 'object') {
27
+ return false;
28
+ }
29
+ const code = error.code;
30
+ if (code === 'UNIMPLEMENTED') {
31
+ return true;
32
+ }
33
+ const message = error.message;
34
+ return typeof message === 'string' && message.toLowerCase().includes('not implemented');
35
+ }
5
36
  export * from './definitions';
6
37
  export { CapgoAlarm };
7
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,UAAU,GAAG,cAAc,CAAmB,YAAY,EAAE;IAChE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapgoAlarmPlugin } from './definitions';\n\nconst CapgoAlarm = registerPlugin<CapgoAlarmPlugin>('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\n\nexport * from './definitions';\nexport { CapgoAlarm };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,UAAU,GAAG,cAAc,CAAmB,YAAY,EAAE;IAChE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,MAAM,6BAA6B,GAAqB;IACtD,OAAO,EAAE,KAAK;IACd,OAAO,EACL,yIAAyI;CAC5I,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAA,UAAU,CAAC,gBAAgB,0CAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAE7E,UAAU,CAAC,gBAAgB,GAAG,CAAC,KAAK,IAA+B,EAAE;IACnE,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,OAAO,6BAA6B,CAAC;IACvC,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,sBAAsB,EAAE,CAAC;IACxC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,6BAA6B,CAAC;QACvC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAyC,CAAC;AAE3C,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAI,KAA2B,CAAC,IAAI,CAAC;IAC/C,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAI,KAA+B,CAAC,OAAO,CAAC;IACzD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC1F,CAAC;AAED,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapgoAlarmPlugin, PermissionResult } from './definitions';\n\nconst CapgoAlarm = registerPlugin<CapgoAlarmPlugin>('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\n\nconst missingCheckPermissionsResult: PermissionResult = {\n granted: false,\n message:\n 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',\n};\n\nconst nativeCheckPermissions = CapgoAlarm.checkPermissions?.bind(CapgoAlarm);\n\nCapgoAlarm.checkPermissions = (async (): Promise<PermissionResult> => {\n if (!nativeCheckPermissions) {\n return missingCheckPermissionsResult;\n }\n try {\n return await nativeCheckPermissions();\n } catch (error: unknown) {\n if (isUnimplementedError(error)) {\n return missingCheckPermissionsResult;\n }\n throw error;\n }\n}) as CapgoAlarmPlugin['checkPermissions'];\n\nfunction isUnimplementedError(error: unknown): boolean {\n if (!error || typeof error !== 'object') {\n return false;\n }\n const code = (error as { code?: string }).code;\n if (code === 'UNIMPLEMENTED') {\n return true;\n }\n const message = (error as { message?: unknown }).message;\n return typeof message === 'string' && message.toLowerCase().includes('not implemented');\n}\n\nexport * from './definitions';\nexport { CapgoAlarm };\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { CapgoAlarmPlugin, NativeAlarmCreateOptions, NativeActionResult, OSInfo, PermissionResult } from './definitions';
2
+ import type { CapgoAlarmPlugin, NativeAlarmCreateOptions, NativeActionResult, OSInfo, PermissionResult, AlarmInfo } from './definitions';
3
3
  export declare class CapgoAlarmWeb extends WebPlugin implements CapgoAlarmPlugin {
4
4
  createAlarm(_options: NativeAlarmCreateOptions): Promise<NativeActionResult>;
5
5
  openAlarms(): Promise<NativeActionResult>;
@@ -7,7 +7,11 @@ export declare class CapgoAlarmWeb extends WebPlugin implements CapgoAlarmPlugin
7
7
  requestPermissions(_options?: {
8
8
  exactAlarm?: boolean;
9
9
  }): Promise<PermissionResult>;
10
+ checkPermissions(): Promise<PermissionResult>;
10
11
  getPluginVersion(): Promise<{
11
12
  version: string;
12
13
  }>;
14
+ getAlarms(): Promise<{
15
+ alarms: AlarmInfo[];
16
+ }>;
13
17
  }
package/dist/esm/web.js CHANGED
@@ -17,8 +17,17 @@ export class CapgoAlarmWeb extends WebPlugin {
17
17
  async requestPermissions(_options) {
18
18
  return { granted: true };
19
19
  }
20
+ async checkPermissions() {
21
+ return {
22
+ granted: false,
23
+ message: 'Native alarm permissions are not available on web',
24
+ };
25
+ }
20
26
  async getPluginVersion() {
21
27
  return { version: 'web' };
22
28
  }
29
+ async getAlarms() {
30
+ return { alarms: [] };
31
+ }
23
32
  }
24
33
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C,KAAK,CAAC,WAAW,CAAC,QAAkC;QAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,SAAS,CAAC,SAAS;YAC5B,oBAAoB,EAAE,KAAK;YAC3B,8BAA8B,EAAE,KAAK;SACtC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAmC;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n CapgoAlarmPlugin,\n NativeAlarmCreateOptions,\n NativeActionResult,\n OSInfo,\n PermissionResult,\n} from './definitions';\n\nexport class CapgoAlarmWeb extends WebPlugin implements CapgoAlarmPlugin {\n async createAlarm(_options: NativeAlarmCreateOptions): Promise<NativeActionResult> {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n\n async openAlarms(): Promise<NativeActionResult> {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n\n async getOSInfo(): Promise<OSInfo> {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n\n async requestPermissions(_options?: { exactAlarm?: boolean }): Promise<PermissionResult> {\n return { granted: true };\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,aAAc,SAAQ,SAAS;IAC1C,KAAK,CAAC,WAAW,CAAC,QAAkC;QAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,SAAS,CAAC,SAAS;YAC5B,oBAAoB,EAAE,KAAK;YAC3B,8BAA8B,EAAE,KAAK;SACtC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAmC;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,mDAAmD;SAC7D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACxB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n CapgoAlarmPlugin,\n NativeAlarmCreateOptions,\n NativeActionResult,\n OSInfo,\n PermissionResult,\n AlarmInfo,\n} from './definitions';\n\nexport class CapgoAlarmWeb extends WebPlugin implements CapgoAlarmPlugin {\n async createAlarm(_options: NativeAlarmCreateOptions): Promise<NativeActionResult> {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n\n async openAlarms(): Promise<NativeActionResult> {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n\n async getOSInfo(): Promise<OSInfo> {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n\n async requestPermissions(_options?: { exactAlarm?: boolean }): Promise<PermissionResult> {\n return { granted: true };\n }\n\n async checkPermissions(): Promise<PermissionResult> {\n return {\n granted: false,\n message: 'Native alarm permissions are not available on web',\n };\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n\n async getAlarms(): Promise<{ alarms: AlarmInfo[] }> {\n return { alarms: [] };\n }\n}\n"]}
@@ -2,9 +2,40 @@
2
2
 
3
3
  var core = require('@capacitor/core');
4
4
 
5
+ var _a;
5
6
  const CapgoAlarm = core.registerPlugin('CapgoAlarm', {
6
7
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapgoAlarmWeb()),
7
8
  });
9
+ const missingCheckPermissionsResult = {
10
+ granted: false,
11
+ message: 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',
12
+ };
13
+ const nativeCheckPermissions = (_a = CapgoAlarm.checkPermissions) === null || _a === void 0 ? void 0 : _a.bind(CapgoAlarm);
14
+ CapgoAlarm.checkPermissions = (async () => {
15
+ if (!nativeCheckPermissions) {
16
+ return missingCheckPermissionsResult;
17
+ }
18
+ try {
19
+ return await nativeCheckPermissions();
20
+ }
21
+ catch (error) {
22
+ if (isUnimplementedError(error)) {
23
+ return missingCheckPermissionsResult;
24
+ }
25
+ throw error;
26
+ }
27
+ });
28
+ function isUnimplementedError(error) {
29
+ if (!error || typeof error !== 'object') {
30
+ return false;
31
+ }
32
+ const code = error.code;
33
+ if (code === 'UNIMPLEMENTED') {
34
+ return true;
35
+ }
36
+ const message = error.message;
37
+ return typeof message === 'string' && message.toLowerCase().includes('not implemented');
38
+ }
8
39
 
9
40
  class CapgoAlarmWeb extends core.WebPlugin {
10
41
  async createAlarm(_options) {
@@ -24,9 +55,18 @@ class CapgoAlarmWeb extends core.WebPlugin {
24
55
  async requestPermissions(_options) {
25
56
  return { granted: true };
26
57
  }
58
+ async checkPermissions() {
59
+ return {
60
+ granted: false,
61
+ message: 'Native alarm permissions are not available on web',
62
+ };
63
+ }
27
64
  async getPluginVersion() {
28
65
  return { version: 'web' };
29
66
  }
67
+ async getAlarms() {
68
+ return { alarms: [] };
69
+ }
30
70
  }
31
71
 
32
72
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoAlarm = registerPlugin('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\nexport * from './definitions';\nexport { CapgoAlarm };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoAlarmWeb extends WebPlugin {\n async createAlarm(_options) {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n async openAlarms() {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n async getOSInfo() {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n async requestPermissions(_options) {\n return { granted: true };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC;;ACFM,MAAM,aAAa,SAASC,cAAS,CAAC;AAC7C,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE;AAC/E,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE;AAClF,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,OAAO,EAAE,SAAS,CAAC,SAAS;AACxC,YAAY,oBAAoB,EAAE,KAAK;AACvC,YAAY,8BAA8B,EAAE,KAAK;AACjD,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChC,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["var _a;\nimport { registerPlugin } from '@capacitor/core';\nconst CapgoAlarm = registerPlugin('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\nconst missingCheckPermissionsResult = {\n granted: false,\n message: 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',\n};\nconst nativeCheckPermissions = (_a = CapgoAlarm.checkPermissions) === null || _a === void 0 ? void 0 : _a.bind(CapgoAlarm);\nCapgoAlarm.checkPermissions = (async () => {\n if (!nativeCheckPermissions) {\n return missingCheckPermissionsResult;\n }\n try {\n return await nativeCheckPermissions();\n }\n catch (error) {\n if (isUnimplementedError(error)) {\n return missingCheckPermissionsResult;\n }\n throw error;\n }\n});\nfunction isUnimplementedError(error) {\n if (!error || typeof error !== 'object') {\n return false;\n }\n const code = error.code;\n if (code === 'UNIMPLEMENTED') {\n return true;\n }\n const message = error.message;\n return typeof message === 'string' && message.toLowerCase().includes('not implemented');\n}\nexport * from './definitions';\nexport { CapgoAlarm };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoAlarmWeb extends WebPlugin {\n async createAlarm(_options) {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n async openAlarms() {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n async getOSInfo() {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n async requestPermissions(_options) {\n return { granted: true };\n }\n async checkPermissions() {\n return {\n granted: false,\n message: 'Native alarm permissions are not available on web',\n };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async getAlarms() {\n return { alarms: [] };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA,IAAI,EAAE;AAED,MAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;AAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;AACjE,CAAC;AACD,MAAM,6BAA6B,GAAG;AACtC,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,OAAO,EAAE,yIAAyI;AACtJ,CAAC;AACD,MAAM,sBAAsB,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,gBAAgB,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;AAC1H,UAAU,CAAC,gBAAgB,IAAI,YAAY;AAC3C,IAAI,IAAI,CAAC,sBAAsB,EAAE;AACjC,QAAQ,OAAO,6BAA6B;AAC5C,IAAI;AACJ,IAAI,IAAI;AACR,QAAQ,OAAO,MAAM,sBAAsB,EAAE;AAC7C,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;AACzC,YAAY,OAAO,6BAA6B;AAChD,QAAQ;AACR,QAAQ,MAAM,KAAK;AACnB,IAAI;AACJ,CAAC,CAAC;AACF,SAAS,oBAAoB,CAAC,KAAK,EAAE;AACrC,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7C,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI;AAC3B,IAAI,IAAI,IAAI,KAAK,eAAe,EAAE;AAClC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AACjC,IAAI,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;AAC3F;;ACjCO,MAAM,aAAa,SAASC,cAAS,CAAC;AAC7C,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE;AAC/E,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE;AAClF,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,OAAO,EAAE,SAAS,CAAC,SAAS;AACxC,YAAY,oBAAoB,EAAE,KAAK;AACvC,YAAY,8BAA8B,EAAE,KAAK;AACjD,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;AACvC,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAChC,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,YAAY,OAAO,EAAE,mDAAmD;AACxE,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;AAC7B,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,9 +1,40 @@
1
1
  var capacitorCapgoAlarm = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
+ var _a;
4
5
  const CapgoAlarm = core.registerPlugin('CapgoAlarm', {
5
6
  web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapgoAlarmWeb()),
6
7
  });
8
+ const missingCheckPermissionsResult = {
9
+ granted: false,
10
+ message: 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',
11
+ };
12
+ const nativeCheckPermissions = (_a = CapgoAlarm.checkPermissions) === null || _a === void 0 ? void 0 : _a.bind(CapgoAlarm);
13
+ CapgoAlarm.checkPermissions = (async () => {
14
+ if (!nativeCheckPermissions) {
15
+ return missingCheckPermissionsResult;
16
+ }
17
+ try {
18
+ return await nativeCheckPermissions();
19
+ }
20
+ catch (error) {
21
+ if (isUnimplementedError(error)) {
22
+ return missingCheckPermissionsResult;
23
+ }
24
+ throw error;
25
+ }
26
+ });
27
+ function isUnimplementedError(error) {
28
+ if (!error || typeof error !== 'object') {
29
+ return false;
30
+ }
31
+ const code = error.code;
32
+ if (code === 'UNIMPLEMENTED') {
33
+ return true;
34
+ }
35
+ const message = error.message;
36
+ return typeof message === 'string' && message.toLowerCase().includes('not implemented');
37
+ }
7
38
 
8
39
  class CapgoAlarmWeb extends core.WebPlugin {
9
40
  async createAlarm(_options) {
@@ -23,9 +54,18 @@ var capacitorCapgoAlarm = (function (exports, core) {
23
54
  async requestPermissions(_options) {
24
55
  return { granted: true };
25
56
  }
57
+ async checkPermissions() {
58
+ return {
59
+ granted: false,
60
+ message: 'Native alarm permissions are not available on web',
61
+ };
62
+ }
26
63
  async getPluginVersion() {
27
64
  return { version: 'web' };
28
65
  }
66
+ async getAlarms() {
67
+ return { alarms: [] };
68
+ }
29
69
  }
30
70
 
31
71
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapgoAlarm = registerPlugin('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\nexport * from './definitions';\nexport { CapgoAlarm };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoAlarmWeb extends WebPlugin {\n async createAlarm(_options) {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n async openAlarms() {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n async getOSInfo() {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n async requestPermissions(_options) {\n return { granted: true };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IACjE,CAAC;;ICFM,MAAM,aAAa,SAASC,cAAS,CAAC;IAC7C,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;IAChC,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE;IAC/E,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE;IAClF,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,KAAK;IAC3B,YAAY,OAAO,EAAE,SAAS,CAAC,SAAS;IACxC,YAAY,oBAAoB,EAAE,KAAK;IACvC,YAAY,8BAA8B,EAAE,KAAK;IACjD,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["var _a;\nimport { registerPlugin } from '@capacitor/core';\nconst CapgoAlarm = registerPlugin('CapgoAlarm', {\n web: () => import('./web').then((m) => new m.CapgoAlarmWeb()),\n});\nconst missingCheckPermissionsResult = {\n granted: false,\n message: 'CapgoAlarm.checkPermissions is not implemented on this platform or native plugin version. Update the native plugin to use this feature.',\n};\nconst nativeCheckPermissions = (_a = CapgoAlarm.checkPermissions) === null || _a === void 0 ? void 0 : _a.bind(CapgoAlarm);\nCapgoAlarm.checkPermissions = (async () => {\n if (!nativeCheckPermissions) {\n return missingCheckPermissionsResult;\n }\n try {\n return await nativeCheckPermissions();\n }\n catch (error) {\n if (isUnimplementedError(error)) {\n return missingCheckPermissionsResult;\n }\n throw error;\n }\n});\nfunction isUnimplementedError(error) {\n if (!error || typeof error !== 'object') {\n return false;\n }\n const code = error.code;\n if (code === 'UNIMPLEMENTED') {\n return true;\n }\n const message = error.message;\n return typeof message === 'string' && message.toLowerCase().includes('not implemented');\n}\nexport * from './definitions';\nexport { CapgoAlarm };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapgoAlarmWeb extends WebPlugin {\n async createAlarm(_options) {\n return { success: false, message: 'Native alarm not supported on web' };\n }\n async openAlarms() {\n return { success: false, message: 'Native alarm UI not available on web' };\n }\n async getOSInfo() {\n return {\n platform: 'web',\n version: navigator.userAgent,\n supportsNativeAlarms: false,\n supportsScheduledNotifications: false,\n };\n }\n async requestPermissions(_options) {\n return { granted: true };\n }\n async checkPermissions() {\n return {\n granted: false,\n message: 'Native alarm permissions are not available on web',\n };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async getAlarms() {\n return { alarms: [] };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA,IAAI,EAAE;AAED,UAAC,UAAU,GAAGA,mBAAc,CAAC,YAAY,EAAE;IAChD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;IACjE,CAAC;IACD,MAAM,6BAA6B,GAAG;IACtC,IAAI,OAAO,EAAE,KAAK;IAClB,IAAI,OAAO,EAAE,yIAAyI;IACtJ,CAAC;IACD,MAAM,sBAAsB,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,gBAAgB,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;IAC1H,UAAU,CAAC,gBAAgB,IAAI,YAAY;IAC3C,IAAI,IAAI,CAAC,sBAAsB,EAAE;IACjC,QAAQ,OAAO,6BAA6B;IAC5C,IAAI;IACJ,IAAI,IAAI;IACR,QAAQ,OAAO,MAAM,sBAAsB,EAAE;IAC7C,IAAI;IACJ,IAAI,OAAO,KAAK,EAAE;IAClB,QAAQ,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;IACzC,YAAY,OAAO,6BAA6B;IAChD,QAAQ;IACR,QAAQ,MAAM,KAAK;IACnB,IAAI;IACJ,CAAC,CAAC;IACF,SAAS,oBAAoB,CAAC,KAAK,EAAE;IACrC,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7C,QAAQ,OAAO,KAAK;IACpB,IAAI;IACJ,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI;IAC3B,IAAI,IAAI,IAAI,KAAK,eAAe,EAAE;IAClC,QAAQ,OAAO,IAAI;IACnB,IAAI;IACJ,IAAI,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;IACjC,IAAI,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAC3F;;ICjCO,MAAM,aAAa,SAASC,cAAS,CAAC;IAC7C,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;IAChC,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE;IAC/E,IAAI;IACJ,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE;IAClF,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,KAAK;IAC3B,YAAY,OAAO,EAAE,SAAS,CAAC,SAAS;IACxC,YAAY,oBAAoB,EAAE,KAAK;IACvC,YAAY,8BAA8B,EAAE,KAAK;IACjD,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,kBAAkB,CAAC,QAAQ,EAAE;IACvC,QAAQ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO;IACf,YAAY,OAAO,EAAE,KAAK;IAC1B,YAAY,OAAO,EAAE,mDAAmD;IACxE,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ,IAAI,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;IAC7B,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -42,6 +42,17 @@ class AlarmKitBridge {
42
42
  completion(false, "AlarmKit not available on this device/SDK")
43
43
  }
44
44
 
45
+ static func currentAuthorizationStatus(completion: @escaping (Bool, String?) -> Void) {
46
+ #if canImport(AlarmKit)
47
+ if #available(iOS 26.0, *) {
48
+ let status = AlarmManager.shared.authorizationState
49
+ completion(status == .authorized, String(describing: status))
50
+ return
51
+ }
52
+ #endif
53
+ completion(false, "AlarmKit not available on this device/SDK")
54
+ }
55
+
45
56
  static func createAlarm(hour: Int, minute: Int, label: String?, completion: @escaping (Bool, String?) -> Void) {
46
57
  #if canImport(AlarmKit)
47
58
  if #available(iOS 26.0, *) {
@@ -89,11 +100,75 @@ class AlarmKitBridge {
89
100
  completion(false, "Clock UI cannot be opened on this platform.")
90
101
  #endif
91
102
  }
103
+
104
+ static func getAlarms(completion: @escaping ([[String: Any]], String?) -> Void) {
105
+ #if canImport(AlarmKit)
106
+ if #available(iOS 26.0, *) {
107
+ Task {
108
+ do {
109
+ let alarmManager = AlarmManager.shared
110
+ let alarms = try alarmManager.alarms
111
+
112
+ var alarmsList: [[String: Any]] = []
113
+ for alarm in alarms {
114
+ if let alarmDict = convertAlarmToDict(alarm: alarm) {
115
+ alarmsList.append(alarmDict)
116
+ }
117
+ }
118
+
119
+ completion(alarmsList, nil)
120
+ } catch {
121
+ completion([], "Failed to retrieve alarms: \(error.localizedDescription)")
122
+ }
123
+ }
124
+ return
125
+ }
126
+ #endif
127
+ // Return empty list for consistency with Android/Web when not supported
128
+ completion([], nil)
129
+ }
92
130
  }
93
131
 
94
132
  #if canImport(AlarmKit)
95
133
  @available(iOS 26.0, *)
96
134
  private extension AlarmKitBridge {
135
+ static func convertAlarmToDict(alarm: Alarm) -> [String: Any]? {
136
+ // Get the trigger date from the schedule
137
+ var triggerDate: Date?
138
+ let schedule = alarm.configuration.schedule
139
+
140
+ // Extract date based on schedule type
141
+ if case .fixed(let date) = schedule {
142
+ triggerDate = date
143
+ } else if case .repeating(let dateComponents) = schedule {
144
+ // For repeating alarms, create a date from components
145
+ triggerDate = Calendar.current.date(from: dateComponents)
146
+ }
147
+
148
+ guard let date = triggerDate else {
149
+ return nil
150
+ }
151
+
152
+ let components = Calendar.current.dateComponents([.hour, .minute], from: date)
153
+ guard let hour = components.hour, let minute = components.minute else {
154
+ return nil
155
+ }
156
+
157
+ // Try to get label from metadata if available
158
+ var label: String?
159
+ if let metadata = alarm.configuration.attributes.metadata as? AlarmBridgeMetadata {
160
+ label = metadata.label
161
+ }
162
+
163
+ return [
164
+ "id": alarm.id.uuidString,
165
+ "hour": hour,
166
+ "minute": minute,
167
+ "label": label ?? NSNull(),
168
+ "enabled": alarm.state == .active
169
+ ]
170
+ }
171
+
97
172
  static func sanitizedLabel(_ label: String?) -> String {
98
173
  let trimmed = label?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
99
174
  return trimmed.isEmpty ? "Alarm" : trimmed
@@ -7,15 +7,17 @@ import Capacitor
7
7
  */
8
8
  @objc(CapgoAlarmPlugin)
9
9
  public class CapgoAlarmPlugin: CAPPlugin, CAPBridgedPlugin {
10
- private let pluginVersion: String = "8.0.5"
10
+ private let pluginVersion: String = "8.0.7"
11
11
  public let identifier = "CapgoAlarmPlugin"
12
12
  public let jsName = "CapgoAlarm"
13
13
  public let pluginMethods: [CAPPluginMethod] = [
14
14
  CAPPluginMethod(name: "createAlarm", returnType: CAPPluginReturnPromise),
15
15
  CAPPluginMethod(name: "openAlarms", returnType: CAPPluginReturnPromise),
16
16
  CAPPluginMethod(name: "getOSInfo", returnType: CAPPluginReturnPromise),
17
+ CAPPluginMethod(name: "checkPermissions", returnType: CAPPluginReturnPromise),
17
18
  CAPPluginMethod(name: "requestPermissions", returnType: CAPPluginReturnPromise),
18
- CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
19
+ CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise),
20
+ CAPPluginMethod(name: "getAlarms", returnType: CAPPluginReturnPromise)
19
21
  ]
20
22
 
21
23
  @objc func createAlarm(_ call: CAPPluginCall) {
@@ -48,8 +50,25 @@ public class CapgoAlarmPlugin: CAPPlugin, CAPBridgedPlugin {
48
50
 
49
51
  // Capacitor permission lifecycle
50
52
  override public func checkPermissions(_ call: CAPPluginCall) {
51
- // No explicit runtime permission needed for AlarmKit; always granted when available
52
- call.resolve(["granted": true])
53
+ guard AlarmKitBridge.isAvailable() else {
54
+ call.resolve([
55
+ "granted": false,
56
+ "details": ["alarmKit": false],
57
+ "message": "AlarmKit not available on this device/SDK"
58
+ ])
59
+ return
60
+ }
61
+
62
+ AlarmKitBridge.currentAuthorizationStatus { granted, statusDescription in
63
+ var result: [String: Any] = [
64
+ "granted": granted,
65
+ "details": ["alarmKit": granted]
66
+ ]
67
+ if !granted, let statusDescription = statusDescription {
68
+ result["message"] = "AlarmKit authorization status: \(statusDescription)"
69
+ }
70
+ call.resolve(result)
71
+ }
53
72
  }
54
73
 
55
74
  override public func requestPermissions(_ call: CAPPluginCall) {
@@ -71,4 +90,15 @@ public class CapgoAlarmPlugin: CAPPlugin, CAPBridgedPlugin {
71
90
  call.resolve(["version": self.pluginVersion])
72
91
  }
73
92
 
93
+ @objc func getAlarms(_ call: CAPPluginCall) {
94
+ AlarmKitBridge.getAlarms { alarms, error in
95
+ if let error = error {
96
+ // Return empty array with error message for consistency
97
+ call.resolve(["alarms": [], "message": error])
98
+ } else {
99
+ call.resolve(["alarms": alarms])
100
+ }
101
+ }
102
+ }
103
+
74
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-alarm",
3
- "version": "8.0.5",
3
+ "version": "8.0.7",
4
4
  "description": "Manage native alarm Capacitor plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,7 +44,8 @@
44
44
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
45
45
  "clean": "rimraf ./dist",
46
46
  "watch": "tsc --watch",
47
- "prepublishOnly": "npm run build"
47
+ "prepublishOnly": "npm run build",
48
+ "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@capacitor/android": "^8.0.0",