push-plugin icon indicating copy to clipboard operation
push-plugin copied to clipboard

Update, group or remove notifications

Open GuntarsLuta opened this issue 7 years ago • 1 comments

Hi, when app is working in background mode each received notification is displayed separately. Is there any way to group them, update or remove old notifications from status bar?

GuntarsLuta avatar May 23 '18 13:05 GuntarsLuta

Hi @GuntarsLuta, with the current setup, this plugin does not offer this functionality. I am not sure if grouping client-side is possible at all. If you want to achieve that, maybe you should think of accumulating notifications server-side and only push a single "grouped" notification to the devices? As for the old notifications - they disappear automatically when the app is opened. Additionally, if you want to remove them before opening the app, the following APIs may help (iOS):

A possible usage in {N}:

import * as utils from "tns-core-modules/utils/utils";

const center = utils.ios.getter(UNUserNotificationCenter, UNUserNotificationCenter.currentNotificationCenter);
center.removeAllDeliveredNotifications();
center.removeAllPendingNotificationRequests();

tbozhikov avatar Jun 04 '18 11:06 tbozhikov