0.1.1 • Published 29 days ago

capacitor-notifications-alarm v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
29 days ago

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

ParamType
optionsNotificationScheduleType

Returns: Promise<any>


removeScheduledNotification(...)

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

Remove scheduled notification by id

ParamType
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

ParamType
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

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

Returns: Promise<PluginListenerHandle>


Interfaces

permissionStatus

PropType
statusPermissionState

NotificationScheduleType

PropType
titlestring
bodystring
hournumber
minutesnumber
frequencynumber
rescheduleboolean
idnumber
totalnumber

PluginListenerHandle

PropType
remove() => Promise<void>

ActionPerformed

PropType
actionIdstring
notification{ treatment_id: number; content: string; }

Type Aliases

PermissionState

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

0.1.0

29 days ago

0.1.1

29 days ago

0.0.9

29 days ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.3

2 months ago

0.0.4

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago