- Platform enhancements
- Android 8-10 device support
- Android 10 SDK support (using androidx libraries rather than support libraries)
- Note: If you are not building with API 29 on Android, you can use https://www.npmjs.com/package/cordova-plugin-androidx for backwards compatibility.
- Enhancements (Android)
- Adjusted high priority notifications to fire at more exact time.
- use setAlarmClock() rather than setExactAndAllowWhileIdle().
- New
autoLaunch
attribute.- Notification launches application if closed (Android <= 9).
- App has the option to run some logic and schedule (or not schedule) an immediate alarm.
- Note, this will be overridden if fullScreenIntent is true. Doing that will use the fullScreenIntent behavior and not always autoLaunch.
- Also note, this feature can cause alarms to not always fire on time.
- New
alarmVolume
attribute. Can force application to increase device notification volume prior to playing sound. - New
resetDelay
attribute. Delay to reset alarmVolume on the device back to its original settings - New
wakeLockTimeout
attribute. Can be used to extend the wakelock to keep the device awake longer (in case an autoLaunch application trigger takes a while). - New
triggerInApp
attribute.-
If set to true, notification will not fire. Instead it will fire a trigger event that can be listened to in the app.
-
This allows you to evaluate the notification in the application, and if you decide to fire it, you can remove the trigger, remove triggerInApp, and schedule it. (It should fire immediately).
-
This was previously coupled with autoLaunch, but I split it out for more flexibility.
-
Listening to the event can be done as follows:
window.cordova.plugins.notification.local.on('trigger', (notification) => { // do something with notification });
-
Note: this functionality will be skipped (alarms will fire immediately with no trigger method) if any of the following are true:
- Android 8+ is asleep and the app is not running (even if autoLaunch is true). As a timely execution of the app code can't be guaranteed in this state, the notification will fire immediately.
- The app is not running and autoLaunch is false (any Android version). If the app is not running, we can't execute its code, so fire immediately.
-
- New
fullScreenIntent
attribute.- If set to true, will use fullScreenIntent in AlarmManager to launch application.
- Setting this to true will negate autoLaunch, and is the only way to automatically launch the app on Android 10+.
- Note: OS/manufacturer has some options for how to deal with this configuration. It will not always launch the activity, but typically will launch it if the device is asleep and show a heads-up notification if it is not.
- Adjusted high priority notifications to fire at more exact time.
- Android Channel Support
- New
channelName
attribute for the name of the notification channel to use - New
channelId
attribute. If passed in, a notification channel will be created (using volume and vibration settings to determine importance) - Android: Support for excluding an application from battery optimization settings.
- Android: Support for allowing an application permissions to override Do Not Disturb.
- iOS: No longer remove notification from notification bar when alarms are rescheduled. Call cancel() explicitly to retain this behavior.
Please also read the Upgrade Guide for more information.
- iOS 10
- Bug fixes
- SyntaxError: missing ) after argument list
- Platform enhancements
- Support for the
Crosswalk Engine
- Support for
cordova-ios@4
and theWKWebView Engine
- Support for
cordova-windows@4
andWindows 10
without using hooks - Enhancements
- New
color
attribute for Android (Thanks to @Eusebius1920) - New
quarter
intervall for iOS & Android smallIcon
is optional (Android)update
checks for permission like schedule- Decreased time-frame for trigger event (iOS)
- Force
every:
to be a string on iOS - Bug fixes
- Fixed #634 option to skip permission check
- Fixed #588 crash when basename & extension can't be extracted (Android)
- Fixed #732 loop between update and trigger (Android)
- Fixed #710 crash due to >500 notifications (Android)
- Fixed #682 crash while resuming app from notification (Android 6)
- Fixed #612 cannot update icon or sound (Android)
- Fixed crashing get(ID) if notification doesn't exist
- Fixed #569 getScheduled returns two items per notification
- Fixed #700 notifications appears on bootup
- Submitted to npm
- Initial support for the
windows
platform - Re-add autoCancel option on Android
- Warn about unknown properties
- Fix crash on iOS 9
- Fixed webView-Problems with cordova-android 4.0
- Fix get* with single id
- Fix issue when passing data in milliseconds
- Update device plugin id
- Several other fixes
- Fix incompatibility with cordova version 3.5-3.0
- Fire
clear
instead ofcancel
event when clicked on repeating notifications - Do not fire
clear
orcancel
event when clicked on persistent notifications
- Support for iOS 8, Android 2 (SDK >= 7) and Android 5
- Windows Phone 8.1 will be added soon
- New interfaces to ask for / register permissions required to schedule local notifications
hasPermission()
andregisterPermission()
- schedule() will register the permission automatically and schedule the notification if granted.
- New interface to update already scheduled|triggered local notifications
update()
- New interfaces to clear the notification center
clear()
andclearAll()
- New interfaces to query for local notifications, their properties, their IDs and their existence depend on their state
isPresent()
,isScheduled()
,isTriggered()
getIds()
,getAllIds()
,getScheduledIds()
,getTriggeredIds()
get()
,getAll()
,getScheduled()
,getTriggered()
- Schedule multiple local notifications at once
schedule( [{...},{...}] )
- Update multiple local notifications at once
update( [{...},{...}] )
- Clear multiple local notifications at once
clear( [1, 2] )
- Cancel multiple local notifications at once
cancel( [1, 2] )
- New URI format to specify sound and image resources
http(s):
for remote resources (Android)file:
for local resources relative to the www folderres:
for native resources- New events
schedule
,update
,clear
,clearall
andcancelall
- Enhanced event informations
- Listener will get called with the local notification object instead of only the ID
- Multiple listener for one event
on(event, callback, scope)
- Unregister event listener
un(event, callback)
- New Android specific properties
led
propertiessound
andimage
accepts remote resources- Callback function and scope for all interface methods
schedule( notification, callback, scope )
- Renamed
add()
toschedule()
autoCancel
property has been removed- Use
ongoing: true
for persistent local notifications on Android - Renamed repeat intervals
second
,minute
,hour
,day
,week
,month
andyear
- Renamed some local notification properties
date
,json
,message
andrepeat
- Scheduling local notifications with the deprecated properties is still possible
- Kitchen Sink sample app
- Wiki