# capacitor-notifications-alarm

> Alarm notifications plugin for ionic capacitor

Latest version **0.1.4** (published 2024-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install capacitor-notifications-alarm
pnpm add capacitor-notifications-alarm
yarn add capacitor-notifications-alarm
bun add capacitor-notifications-alarm
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2024-07-15 |
| First published | 2024-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 65.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Drazamed |
| Maintainers | santyst0302 |
| Keywords | capacitor, plugin, ionic |

## Links

- npm: https://www.npmjs.com/package/capacitor-notifications-alarm
- Repository: https://github.com/santyst/alarm-notifications-plugin
- Homepage: https://github.com/santyst/alarm-notifications-plugin#readme
- Issues: https://github.com/santyst/alarm-notifications-plugin/issues
- npm.io page: https://npm.io/package/capacitor-notifications-alarm

## Recent versions

- 0.1.4 (latest) — 2024-07-15
- 0.1.3 — 2024-07-15
- 0.1.2 — 2024-07-15
- 0.1.1 — 2024-04-05
- 0.1.0 — 2024-04-05
- 0.0.9 — 2024-04-05
- 0.0.8 — 2024-03-08
- 0.0.7 — 2024-03-08
- 0.0.6 — 2024-03-08
- 0.0.5 — 2024-03-07
- 0.0.4 — 2024-03-06
- 0.0.3 — 2024-03-06
- 0.0.2 — 2024-03-03
- 0.0.1 — 2024-03-03

## README

# capacitor-notifications-alarm

Alarm notifications plugin for ionic capacitor

## Install

```bash
npm install capacitor-notifications-alarm
npx cap sync
```

## API

<docgen-index>

* [`checkNotificationsPermissions()`](#checknotificationspermissions)
* [`requestNotificationsPermissions()`](#requestnotificationspermissions)
* [`getScheduledNotifications()`](#getschedulednotifications)
* [`scheduleNotification(...)`](#schedulenotification)
* [`removeScheduledNotification(...)`](#removeschedulednotification)
* [`removeAllScheduledNotifications()`](#removeallschedulednotifications)
* [`addListener('notificationReceived', ...)`](#addlistenernotificationreceived)
* [`addListener('notificationActionPerformed', ...)`](#addlistenernotificationactionperformed)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### checkNotificationsPermissions()

```typescript
checkNotificationsPermissions() => Promise<permissionStatus>
```

Check notifications permission

**Returns:** <code>Promise&lt;<a href="#permissionstatus">permissionStatus</a>&gt;</code>

--------------------


### requestNotificationsPermissions()

```typescript
requestNotificationsPermissions() => Promise<permissionStatus>
```

Request notificationPermission

**Returns:** <code>Promise&lt;<a href="#permissionstatus">permissionStatus</a>&gt;</code>

--------------------


### getScheduledNotifications()

```typescript
getScheduledNotifications() => Promise<{ scheduledNotifications: any[]; }>
```

Get scheduled notifications

**Returns:** <code>Promise&lt;{ scheduledNotifications: any[]; }&gt;</code>

--------------------


### scheduleNotification(...)

```typescript
scheduleNotification(options: NotificationScheduleType) => Promise<any>
```

Schedule notifications

| Param         | Type                                                                          |
| ------------- | ----------------------------------------------------------------------------- |
| **`options`** | <code><a href="#notificationscheduletype">NotificationScheduleType</a></code> |

**Returns:** <code>Promise&lt;any&gt;</code>

--------------------


### removeScheduledNotification(...)

```typescript
removeScheduledNotification(options: { id: number; }) => Promise<{ status: 'removed' | 'error'; }>
```

Remove scheduled notification by id

| Param         | Type                         |
| ------------- | ---------------------------- |
| **`options`** | <code>{ id: number; }</code> |

**Returns:** <code>Promise&lt;{ status: 'error' | 'removed'; }&gt;</code>

--------------------


### removeAllScheduledNotifications()

```typescript
removeAllScheduledNotifications() => Promise<{ status: 'removed' | 'error'; }>
```

Remove all scheduled notifications

**Returns:** <code>Promise&lt;{ status: 'error' | 'removed'; }&gt;</code>

--------------------


### addListener('notificationReceived', ...)

```typescript
addListener(eventName: 'notificationReceived', listenerFunc: (notification: { treatment_id: number; content: string; }) => void) => Promise<PluginListenerHandle>
```

Listener fired when user receive foreground notification

| Param              | Type                                                                               |
| ------------------ | ---------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'notificationReceived'</code>                                                |
| **`listenerFunc`** | <code>(notification: { treatment_id: number; content: string; }) =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### addListener('notificationActionPerformed', ...)

```typescript
addListener(eventName: 'notificationActionPerformed', listenerFunc: (notificationAction: ActionPerformed) => void) => Promise<PluginListenerHandle>
```

Listener fired when user receive background or killed app notification

| Param              | Type                                                                                         |
| ------------------ | -------------------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'notificationActionPerformed'</code>                                                   |
| **`listenerFunc`** | <code>(notificationAction: <a href="#actionperformed">ActionPerformed</a>) =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### Interfaces


#### permissionStatus

| Prop         | Type                                                        |
| ------------ | ----------------------------------------------------------- |
| **`status`** | <code><a href="#permissionstate">PermissionState</a></code> |


#### NotificationScheduleType

| Prop             | Type                 |
| ---------------- | -------------------- |
| **`title`**      | <code>string</code>  |
| **`body`**       | <code>string</code>  |
| **`hour`**       | <code>number</code>  |
| **`minutes`**    | <code>number</code>  |
| **`frequency`**  | <code>number</code>  |
| **`reschedule`** | <code>boolean</code> |
| **`id`**         | <code>number</code>  |
| **`total`**      | <code>number</code>  |


#### PluginListenerHandle

| Prop         | Type                                      |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


#### ActionPerformed

| Prop               | Type                                                    |
| ------------------ | ------------------------------------------------------- |
| **`actionId`**     | <code>string</code>                                     |
| **`notification`** | <code>{ treatment_id: number; content: string; }</code> |


### Type Aliases


#### PermissionState

<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>

</docgen-api>

---
_Source: https://npm.io/package/capacitor-notifications-alarm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
