Skip to content

hessius/cordova-ios10-simple-notification

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova iOS10 Simple Notifications npm version

This plugin was created to implement a simple and light-weight local notification system for cordova on iOS 10+.

Supported Features:

  • Contents: ID/Title/Subtitle/Body
  • Trigger time (Seconds)
  • Actions (Up to 4)
  • Foreground notification support
  • Body + Action click handling
  • Notification payload in click handler

Sample

These notifications will be triggered in 10 seconds.

//No actions
cordova.plugins.ios10.simpleNotification.schedule("1", "Title", "Subtitle", "New Notification!", 10.0, "Payload");

//Two actions
cordova.plugins.ios10.simpleNotification.schedule("1", "Title", "Subtitle", "New Notification!", 10.0, "Payload", "Action 1", "Action 2");

//...

//Four actions max
cordova.plugins.ios10.simpleNotification.schedule("1", "Title", "Subtitle", "New Notification!", 10.0, "Payload", "Action 1", "Action 2", "Action 3", "Action 4");

Handle Payload

Notifications will now use a custom payload handling function

cordova.plugins.ios10.simpleNotification.setHandler((action, payload) =>
				handlePayload(payload)
			);

Remove notifications

Specify ID of notification to remove

cordova.plugins.ios10.simpleNotification.remove("ID")

Supported Platforms:

  • iOS 10.0+

Installation:

This plugin can be installed from CLI with either of the following:

# Latest npm release
cordova plugins add cordova-ios10-simple-notification

# or

# Github master
cordova plugins add https://github.com/DavidBriglio/cordova-ios10-simple-notification

Questions?

Please see the wiki for how to use the plugin.

Feel free to send me a message, open an issue, or make pull requests!

License

This software is released under the MIT License.

David Briglio 2017.

About

Add simple local notifications to your cordova iOS 10 application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 73.2%
  • JavaScript 26.8%