cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Not working if app killed

Open CompRider opened this issue 4 years ago • 2 comments

trigger: { every: { hour: 10, minute: 0 }, count: 1 }

I am using ionic 3 and found Notification is not working if app killed.

CompRider avatar Jun 07 '20 08:06 CompRider

I'm running into the same issue.

I'm running Cordova v9.0.0 Android v 8.1.0 Device OPPO AX5

The below is working when app is open or in background but not when it's been closed. Any ideas appreciated!

I have tried changing app settings to "allow auto start up" and "allow background running".

Have added skipLocalNotificationReady to index.htm

`var app = { initialize: function() { "use strict"; document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); },

onDeviceReady: function() { "use strict"; this.receivedEvent('deviceready'); },

receivedEvent: function(id) {
	"use strict";
	$(".listening").css("display","none");
	$(".received").css("display","block");
   
	cordova.plugins.notification.local.requestPermission(function (granted) {
        var soon = new Date();
        soon.addSeconds(10);

        cordova.plugins.notification.local.schedule({
                id: 1,
                title: 'My first notification',
                text: 'Thats pretty easy...',
                //smallIcon: 'res://logo.png',
                vibrate:true,
                lockscreen:true,
                foreground: true,
                badge:1,
                trigger: {at: soon}
            });
    });
}

}; Date.prototype.addSeconds = function(d) {"use strict"; this.setTime(this.getTime() + (d*1000)); return this; };`

sarahbock avatar Aug 04 '20 01:08 sarahbock

This repository obviously is abandoned. :-(

Marcophono2 avatar Sep 22 '20 23:09 Marcophono2