cordova-plugin-local-notifications send Android local messages

Original: cordova-plugin-local-notifications send Android local messages

1. GitHub source code address:

2. Parameter description:

3. Event description:

4. Example of use:

1. Html code:

<ion-pane ng-app="notiTest" ng-controller="NotiCtrl">
    <ion-header-bar class="bar-positive" align-title="center">
        <h1 class="title">Simple Message Example</h1>
            <ion-item ng-click="sendOne()">
                send a single message
            <ion-item ng-click="sendTwo()">
                send multiple messages
            <ion-item ng-click="sendThree()">
                Repeat reminder
            <ion-item ng-click="sendFourth()">
                method with parameters

<!-- Cordova reference, which is added to it when the application is built. -->
<script src="cordova.js"></script>
<script src="scripts/platformOverrides.js"></script>
<script src="scripts/ionic/js/ionic.bundle.min.js"></script>
<script src="scripts/index.js"></script>
2. js code

1. Send a single message

    id: 1,
    title: 'App Reminder',
    text: 'Apply new news, let's take a look',
    at: new Date().getTime(),
    badge: 2
//The new version uses add to replace schedule
    id: 1,
    title: 'App Reminder',
    text: 'Apply new news, let's take a look',
    at: new Date().getTime(),
    badge: 2,
    autoClear: true,//default value
    sound: 'res://platform_default',//default value
    icon: 'res://ic_popup_reminder', //default
    ongoing: false //default
//Use Uri to define icon and sound failed, the reason has not been found
    id: 1,
    title: 'App reminder~~~1',
    text: 'Apply new news, let's take a look',
    at: new Date().getTime(),
    badge: 2,
    // Failed to use local audio
    sound: 'file://permission.mp3',
    //kick in
    //icon: 'ic_media_play',
    // Failed to use the body image
    icon: 'file://images/g.jpg',
    // Failed to use external network image
    //icon: "",

2. Send multiple messages

    id: 1,
    title: 'App reminder 1',
    text: 'Apply reminder content 1',
    at: new Date()
}, {
    id: 2,
    title: 'App reminder 2',
    text: 'Apply reminder content 2',
    //The current time is delayed by 2 seconds
    at: new Date(new Date().getTime() + 1000 * 3)

3. Send duplicate messages

    title: 'Duplicate message title',
    text: 'Duplicate message content',
    at: new Date(),
    every: 'minute'

4. Send a message with parameters

    id: 1,
    title: 'with parameters',
    text: 'Content',
    firstAt: new Date(new Date().getTime() + 2 * 1000),
    every: 'minute',
    data: { meetingID: '1324', time: new Date() }

5. Event monitoring

//shedule event fires every time it is called
cordova.plugins.notification.local.on('schedule', function (notification) {
    alert('scheduled:' +;
//Notify trigger event
cordova.plugins.notification.local.on('trigger', function (notification) {
    //alert('triggered:' +;
//listen for click event
cordova.plugins.notification.local.on('click', function (notification) {
    document.getElementById('title').innerHTML = JSON.stringify(;
notification object content

Screenshot of the page

test operating system

Guess you like