universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

After a restart on android a lot of old notifications are pushed #48

Closed ThatAblaze closed 7 years ago

ThatAblaze commented 7 years ago

screenshot_2017-01-24-23-24-18

We're using the restore notifications on reboot option. It appears to have restored the current notifications, but it also seems to have restored a bunch of notifications that expired a long time ago (possibly from when my phone ran out of batteries) and pushed those immediately. This resulted in a bunch of notifications about events that happened a long time ago.

yuriy-universal-ivanov commented 7 years ago

Hi @ThatAblaze ,

First of all, thank you for using UTNotifications! It behaves as designed: the restoring of the local notifications is based on the idea, that the notifications scheduled are too important to be lost. Note, that it's done so only for non-repeating notifications (as repeating notifications will not be lost - the user will see them on a next repeating iteration). If you don't like that behaviour you can always change it as you like, as the complete source code is provided: see ScheduledNotificationsRestorer.java, private static void restoreScheduledNotification(Context context, String packedScheduledNotification, int id).

Best regards, Yuriy, Universal Tools team.

ThatAblaze commented 7 years ago

Yuriy,

I think there should be an option in the settings to not restore expired notifications on startup. In our case we would never want to annoy users by telling them that something just happened when it actually happened a long time ago.

My team bought this plugin because we don't like to touch native java code if we can help it.

yuriy-universal-ivanov commented 7 years ago

Hi @ThatAblaze ,

Please drop us a message to universal.tools.contact@gmail.com, and I'll send you a patched version of the native plugin, which works as you want.

Best regards, Yuriy, Universal Tools team.