The Local Notification plugin gives developers the ability to post notifications from their app that show up in the device’s notification area. The API for the local notification plugin follows the W3C Web Notifications specification: https://www.w3.org/TR/notifications/
import { PhonegapLocalNotification } from '@ionic-native/phonegap-local-notification';
constructor(private localNotification: PhonegapLocalNotification) { }
...
this.localNotification.requestPermission().then(
(permission) => {
if (permission === 'granted') {
// Create the notification
this.localNotification.create('My Title', {
tag: 'message1',
body: 'My body',
icon: 'assets/icon/favicon.ico'
});
}
}
);