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

feat: getBadgeCount and setBadgeCount methods for notifications #228

Open
2 of 4 tasks
rossholdway opened this issue Nov 19, 2019 · 8 comments
Open
2 of 4 tasks

feat: getBadgeCount and setBadgeCount methods for notifications #228

rossholdway opened this issue Nov 19, 2019 · 8 comments

Comments

@rossholdway
Copy link

Feature Request

Describe the Feature Request

iOS (and some Android) notification payloads often contain the number of unread notifications, however currently this value can't be used. Support setting and getting the notification badge count by implementing getBadgeCount and setBadgeCount methods.

I notice this feature has been mentioned in other issues too (#1301 ionic-team/capacitor#837 etc). It is also currently a supported feature of the phonegap push plugin. See push.setApplicationIconBadgeNumber and push.getApplicationIconBadgeNumber at https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/API.md

Platform Support Requested

  • Android
  • iOS
  • Electron
  • Web

Describe Preferred Solution

Add getBadgeCount and setBadgeCount methods

@scriptPilot
Copy link

Is there any workaround with the current LocalNotifications plugin?

@rossholdway
Copy link
Author

Unfortunately not that I can see from the Capacitor local notifications docs

@scriptPilot
Copy link

scriptPilot commented Nov 20, 2019

@rossholdway - Did you find another solution? I did not find proper documentation how to use the Cordova plugins unfortunately ... (see ionic-team/capacitor#2195).

@rossholdway
Copy link
Author

rossholdway commented Nov 20, 2019

@scriptPilot No, sorry haven't found another way to do this currently.

@dminkovsky
Copy link

This looks promising: https://github.com/katzer/cordova-plugin-badge

Haven't tried it yet, but intend to.

@nelsonjimartinez
Copy link

Los problemas etiquetados con solicitud de función se cierran, pero se realiza un seguimiento de las reacciones para medir el interés.

Tenga en cuenta que esto no es compatible oficialmente con Android. Solo es posible en unos pocos proveedores. Hay una biblioteca de terceros para manejar los llamados shortcutBadger y no planeamos agregar esa dependencia solo para esta función, así que creo que encaja mejor en un complemento de terceros

https://developer.android.com/training/notify-user/badges

@christian-forgacs
Copy link

Any update for this feature request..? Because if anybody remove a notification from notification center the badge count will not update with Badge.set from Badge plugin because it isn't in foreground and a background task for this is not optimal.

Alternatively please add a new event for Local Notification Plugin if an notification is removed so we can listen on it on an background task.

@pivko420
Copy link

pivko420 commented Aug 4, 2023

If anyone is still looking for solution, take a look at this plugin: https://github.com/capawesome-team/capacitor-plugins/tree/main/packages/badge

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

No branches or pull requests

9 participants