capacitor-notifications-alarm
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

capacitor-notifications-alarm

Alarm notifications plugin for ionic capacitor

Install

npm install capacitor-notifications-alarm
npx cap sync

API

checkNotificationsPermissions()

checkNotificationsPermissions() => Promise<permissionStatus>

Check notifications permission

Returns: Promise<permissionStatus>


requestNotificationsPermissions()

requestNotificationsPermissions() => Promise<permissionStatus>

Request notificationPermission

Returns: Promise<permissionStatus>


getScheduledNotifications()

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

Get scheduled notifications

Returns: Promise<{ scheduledNotifications: any[]; }>


scheduleNotification(...)

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

Schedule notifications

Param Type
options NotificationScheduleType

Returns: Promise<any>


removeScheduledNotification(...)

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

Remove scheduled notification by id

Param Type
options { id: number; }

Returns: Promise<{ status: 'error' | 'removed'; }>


removeAllScheduledNotifications()

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

Remove all scheduled notifications

Returns: Promise<{ status: 'error' | 'removed'; }>


addListener('notificationReceived', ...)

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

Listener fired when user receive foreground notification

Param Type
eventName 'notificationReceived'
listenerFunc (notification: { treatment_id: number; content: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('notificationActionPerformed', ...)

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

Listener fired when user receive background or killed app notification

Param Type
eventName 'notificationActionPerformed'
listenerFunc (notificationAction: ActionPerformed) => void

Returns: Promise<PluginListenerHandle>


Interfaces

permissionStatus

Prop Type
status PermissionState

NotificationScheduleType

Prop Type
title string
body string
hour number
minutes number
frequency number
reschedule boolean
id number
total number

PluginListenerHandle

Prop Type
remove () => Promise<void>

ActionPerformed

Prop Type
actionId string
notification { treatment_id: number; content: string; }

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Readme

Keywords

Package Sidebar

Install

npm i capacitor-notifications-alarm

Weekly Downloads

28

Version

0.1.4

License

MIT

Unpacked Size

67 kB

Total Files

31

Last publish

Collaborators

  • santyst0302