angular-notice
Native Notifications
Development
- Updated for angular 7
- npm module now created via the angular CLI, this will result in faster and easier updates
- Fixed security vulnerabilities within dependencies
- Simplified import. No longer do you need to import a module - it is now a pure service that gets added to your main app module's providers array. This forces the notifications service to be a singleton. If you need seperate instances for all your components, then simply import the service into that particular component's providers array.
Setup
- Install angular-notice
npm i angular-notice
- Import Module
import NotificationsModule and add it to the imports array within your app's module
; ; ;
- Import NativeNotificationService and inject
import the NativeNotificationService in your app's component and inject it into your app's constructor
; ; // import within component
- Call notify
call the .notify() method off of the service.
someMethodThatGetsCalledWithinComponent
Notes
Chrome requires that a domain must have an SSL certificate for the notification to display. Mobile version of chrome seems to ignore notifications - this is an issue that i'm looking into.