Fuse Community

delete local Notifications

Dear Fuse community,

I wonder wether there is a way to remove local notifications from the system which were created by my FuseApp.

For example, I want a notification for an event in 5 hours. I set it to sendLater with a 5 hours offset in seconds. Fine.

But when I decide to delete the event in the app, the notification is redundant and can be removed.

How do I access this notification?
Can I at least clear all notifications created by the FuseApp?

Thanks!

Hi,

A lot of the information you need is here: https://www.fusetools.com/docs/fuse/localnotifications/localnotify

To clear all notifications:

var LocalNotify = require("FuseJS/LocalNotifications");
LocalNotify.clearAllNotifications();

Hi,

sorry to bring this old thread back to life but I think that the question is still not answered.
clearAllNotifications() only deletes/clears notifications that are already delivered but not the ones that are still in the queue.
Is there any way to delete all notifications in a queue?

Would appreciate an answer.
Thanks!

@Jonas: which target platform are you referring to, Android or iOS?

I’m asking because I just checked the iOS implementation and it seems to me that this method does indeed cancel the delivery of all scheduled local notifications.

If we’re talking Android, however, then it seems to me that there simply isn’t a way to “clear all not-yet-delivered notifications”. See NotificationManager and you’re welcome to point out if I’m missing something.

cancelAllLocalNotifications() worked for me until I linked the iOS 10’s UserNotification’s framework. With that linked I can post local notifications with the old API but the cancel all stopped working. – shelll

Ugh I hope this isn’t correct. These platforms certainly make us dance to keep things working.

I’m also annoyed that we have this difference in behaviour between the platforms, we will need to see if that issue is resolvable.

Thank you for the quick answer.

I only tested it on Android so far and it does not seem to cancel it there. Thanks for pointing out that it is implemented for iOS, gonna test that tonight.

Seems indeed from the documentation that it is not possible in the same way as it is on iOS. Do you know of any workaround, for example by using the areNotificationsEnabled() function to block notifications? Seems like a weird constraint to me.

Someone have a soluction for this tópic.

Sorry for picking up this old thread, but is there any workaround yet to delete an (or even all) scheduled Notifications which were set with LocalNotify.later ?