Skip to main content
Version: v5

Phonegap Local Notification

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/

https://github.com/phonegap/phonegap-plugin-local-notification

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Installation

$ npm install phonegap-plugin-local-notification 
$ npm install @awesome-cordova-plugins/phonegap-local-notification
$ ionic cap sync

Supported Platforms

  • Android
  • Browser
  • iOS
  • Windows

Usage

React

Learn more about using Ionic Native components in React

Angular

import { PhonegapLocalNotification } from '@awesome-cordova-plugins/phonegap-local-notification/ngx';


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'
});

}
}
);