danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.41k stars 2.42k forks source link

Subscription to events in background-mode and local-notifications plugin does not work #3723

Closed Sitronik closed 2 years ago

Sitronik commented 3 years ago

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior: If you subscribe to the event


document.addEventListener('deviceready',  () => {
  BackgroundMode.on('activate', (data) => {
   console.log('on activate');
  });
});

as a result, you get nothing in the callback function For other events, the situation will be the same.

If you create notification with actions, for example:

LocalNotifications.schedule({
id: 1,
title: 'Sync in progress',
text: 'Copied 1 of 10 files',
progressBar: {value: num},
sticky: true,
actions: [
  {id: 'prev',  title: 'PREVIOS'},
  {id: 'resume',  title: 'RESUME'},
  {id: 'next',  title: 'NEXT'}
  ]
});

LocalNotifications.on('prev', () => {
  console.log('clicked prev');
});

When you click on prev action, nothing happens

Expected behavior: Event listeners should work

Steps to reproduce: Subscribe to events background-mode and local-notifications

I fixed this issue, I will add PR soon

github-actions[bot] commented 2 years ago

There has been no recent activity and this issue has been marked inactive.