question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Local notifications not trigger or click when app is closed or killed

See original GitHub issue

Your Environment

  • Plugin version:
  • Platform: ios
  • OS version:13.0
  • Device manufacturer / model: Apple
  • Cordova version :9.0.0
  • Cordova platform version : ios 5.0.1, android 8.1.0
  • Ionic Version :5.4.1

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

(<any>window).skipLocalNotificationReady = true;
  this.platform.ready().then(() => {
  this.backgroundMode.enable();
  this.localNotifications.on('click').subscribe(res => {
      alert("click notification")
    });
    this.localNotifications.on('trigger').subscribe(res => {
      alert("trigger notification")
    });
    this.localNotifications.fireQueuedEvents();
  })

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
StefanReincommented, Jul 16, 2020

@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.

0reactions
StefanReincommented, Oct 1, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

cordova-plugin-local-notifications click event after app is killed
To make sure, the event listener will fire, you have to place it inside deviceready e.g.: document.addEventListener('deviceready' ...
Read more >
Notifications - Expo Documentation
Notifications. The expo-notifications provides an API to fetch push notification tokens and to present, schedule, receive and respond to notifications.
Read more >
awesome_notifications | Flutter Package - Pub.dev
Create Local Notifications on Android, iOS and Web using Flutter. Send Push Notifications using add-on plugins, as awesome_notifications_fcm; Add images, sounds ...
Read more >
Notifications Not Shown - Mobile Push
"Delivered" notifications in OneSignal means we have successfully sent the notification to the push servers (FCM/APNS/WNS etc..). These push servers then ...
Read more >
Will iOS awake my app when i receive silent push notification ...
Hey awesome people, I'm doing emergency location based app and my flow is : 1) User install app. 2) Upload device details to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found