Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working if app killed #30

Open
CompRider opened this issue Jun 7, 2020 · 2 comments
Open

Not working if app killed #30

CompRider opened this issue Jun 7, 2020 · 2 comments

Comments

@CompRider
Copy link

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

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

@sarahbock
Copy link

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 <script>window.skipLocalNotificationReady = true;</script>

`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; };`

@Marcophono2
Copy link

This repository obviously is abandoned. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants