Repeat every day on the given time
See original GitHub issueWARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Provide a general summary of the issue. The notification shows once I install the app but then on a swipe of notification it appears again also app won’t open on tap and then after a minute it crashes.
Your Environment
- Plugin version: “cordova-plugin-local-notification”: “^0.9.0-beta.2”,
- Platform: android
- OS version: Ubuntu 18.10
- Device manufacturer / model: Issue occurs in all device
- Cordova version (
cordova -v
): 9.0.0 - Cordova platform version (
cordova platform ls
): android 8.1.0 - Plugin config
- Ionic Version (if using Ionic) Not ionic
Expected Behavior
Tell us what should happen After installing the app, Array of given notification should appear every day at a given time. I should be able to remove the notification on swipe and should also be able to open the app on tap of the notification.
Actual Behavior
The notification doesn’t go when I clear the notification panel. My app doesn’t open on tap. App crashes after a minute.
Steps to Reproduce
Reproduce this issue; include code to reproduce, if relevant
- on cordova “deviceready” add the following code.
onDeviceReady() {
// Now safe to use device APIs
if (window.cordova) {
alert("device ready");
let cordovaPlugin = cordova.plugins;
cordovaPlugin.notification.local.schedule([
{
id: 0,
title: "Remind",
text: "Remind me to drink water.",
trigger: {
every: {
hour: 17,
minute: 36
}
}
},
{
id: 1,
title: "Remind",
text: "Buy Milk",
trigger: {
every: {
hour: 17,
minute: 34
}
}
}
]);
}
}
- Create and install the cordova “app-debug.apk” on any android phone.
- open the app and initiate the plugin and wait for the given time.
- notification appears on a given time but you can neither get rid of notification nor able to open the app. After a minute app will crash and notification will go away.
Context
I am trying to create a reminder for everyday but different timings. eg:
- Remind me to drink water everyday at morning 8 AM.
- Remind me to watch the movie every day at 9 PM.
Debug logs
no issue on logs compiles successfully.
Include iOS / Android logs No error logs observed.
- ios XCode logs
- Android: $ adb logcat
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top GitHub Comments
hi all, perhaps you can try this fork, it is more recent and still maintained: https://github.com/timkellypa/cordova-plugin-local-notifications
hope it helps. thanks.
Guys, I sat all day and came to the following conclusion. Cordova notifications work so-so and for reliability it is better to use the most typical simple designs. In my case, notifications need to be sent daily at 21:00. “Trigger every” does not work. It worked for me for ionic 3, but after switching to ionic 5 it began to get stuck like yours.
Solution: in a loop, create several “trigger at” notifications for the required dates, instead of one with “trigger every”. For me, it’s enough to create notifications 10 days in advance and update these notifications every time the application is launched. To update, it is enough with these 10 notifications to put down the same ID every time.