Closed Matsuo32 closed 2 weeks ago
I have the same problem, please anyone who could help us?
I dont use Ionic, not sure if this is the reason. I tested it with latest versions and it works.
I am using ionic and capacitor and having the same issue
I was misusing skipLocalNotificationReady. It's working now
@arnaud-zad
Have you tested this on Android as well? If so, are you able to access data in cordova.plugins.notification.local.on("trigger", (res) => {console.log(res); localStorage.setItem("notification","--notification trigger in kill state--")}
if you kill app?
If notifications are working fine for you, it would be really helpful if you could provide a sample code or public repo.
@ravi-pandit14 Yes I tried on Android. I didn't try to access data
it works on ios 13 and android 9 , i used this way to repeating notifications. let notification = { id: 1, data: {}, launch: true, title: "Test", text: "Test...", silent: false, trigger: { every: { hour: 0, minute: 0 } }, foreground: true, wakeup: true };
and please careful with conflict plugins such as cordova-plugin-fcm, cordova-plugin-background-geolocation, ... just remove them
@LuanNg
if you kill/swipe the app from background then are you able to access data of on("trigger"
function?
If notifications are working fine for you, it would be really helpful if you could provide a sample code (with description) or public repo.
When the app is killed the notification gets trigger but onclick method doesn't work. Please suggest some solution
@StefanRein @katzer
Just making sure that I'm not missing anything... 'trigger' event will not fire when app is killed, no matter what. The only solutions are workarounds, not getting it to work somehow.
(Using Cordova and building for Android at the moment)
@Guy-Sela I tested on iOS. But to answer simply your question: Yes the trigger event
(the click will if correctly setup) will NOT fire afterwards by launching or anything - only if you had the app in foreground.
At least in my test application where I thought I could depend on this. I could not. Also wrote in my answer how you could do this yourself. For me I had to schedule notifications for 3 days and also needed to have 2 queues. The ones which are to be fired and the ones which should be fired. There is a limit of 64 local notifications which can be scheduled.
I was misusing skipLocalNotificationReady. It's working now
Exactly what did you change? Did you make it false?
@vvsatpute read my post about this / how to use this: https://github.com/katzer/cordova-plugin-local-notifications/issues/1798#issuecomment-656962391
The notifications will not trigger when app is closed(killed) and will be triggered after opening the app #1895
Hi Stefan just a follow up does the event onTrigger works if the app is in the background or when device is locked?
Your Environment
Expected Behavior
Local notifications trigger or click when app is closed or killed
Actual Behavior
Local notifications showed but it's not trigger or click when app is closed or killed, it just work only app open or run background
Context