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

Removing notifications on iOS #567

Closed
jozsefsallai opened this issue Jun 9, 2022 · 3 comments
Closed

Removing notifications on iOS #567

jozsefsallai opened this issue Jun 9, 2022 · 3 comments
Labels
Enhancement / Feature New feature or request

Comments

@jozsefsallai
Copy link

jozsefsallai commented Jun 9, 2022

Hello!

Currently, it is possible to remove individual notifications on Android by calling the .removeNotification(int) method and there's also a method called .clearOneSignalNotifications() which will remove all app notifications (however this also only works on Android).

A few years ago it was mentioned that there will be a major version which will add this functionality to both the Android and iOS SDKs (OneSignal/OneSignal-iOS-SDK#646 (comment)), however, currently I can't seem to find any methods I can use for iOS.

Is this still planned or am I missing something obvious? Searching for removeDeliveredNotifications in the iOS SDK doesn't yield any results, which makes me assume this functionality wasn't implemented yet.

Are there any workarounds?

@jkasten2
Copy link
Member

@jozsefsallai Thanks for digging in, there isn't a method in the current OneSignal SDK to clear notifications on iOS. However this can be worked around by setting the app's badge value to something like 1 then back to 0, iOS has a side effect with this where it will clear all notifications for the app. I don't believe Flutter has a way to set the iOS badge value, however a 3rd party library could be used to do so. As an example flutter_app_badger, but I have not used this to confirm it will work.

@lifenautjoe
Copy link

Hi @jkasten2 , is there a plan to add it?

Our users are hyper-annoyed that their push notifications never go away.

@emawby emawby added the Enhancement / Feature New feature or request label Jun 24, 2022
@jennantilla
Copy link
Contributor

Hello everyone!

Just wanted to share that the ability to clear all notifications on iOS is now supported in our User Model SDKs!

Please upgrade to our latest release to use the Notifications.clearAll method. Please refer to our migration guide for full details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement / Feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants