OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
606 stars 204 forks source link

[question]: Is there any possible way to clear iOS badge count manually? #867

Closed devmuaz closed 2 months ago

devmuaz commented 3 months ago

How can we help?

Hello,

I am inquiring about the possibility of manually setting/clearing the badge count on iOS because we wanted only to clear the badge count when the user taps the notifications icon button inside the app, but this is not doable at the moment.

I know that setting this OneSignal_disable_badge_clearing to YES will disable the OneSignal SDK from clearing the badge automatically when the app starts/resumes, but how to trigger it manually?

So is it possible to achieve that?

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.4 23E214 darwin-arm64, locale en-IQ)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.87.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

OneSignal Flutter:

onesignal_flutter: ^5.0.4

Code of Conduct

jennantilla commented 2 months ago

Hello @devmuaz thank you for your patience! You can clear/reset the badge count on your iOS app, you can send a notification with the badge count set to 0. More information here.

Let us know if you have any additional questions or concerns!