0
从服务人员调用self.registration.getNotifications({ tag: tag })
时,返回的数组始终包含已被替换的旧通知。例如:从通知列表中删除持久通知(通知API)
showNotification('A', { tag: 'abc' }) // Displays the first notification
getNotifications({ tag: 'abc' }) // Returns [ NotificationA ]
showNotification('B', { tag: 'abc' }) // Replaces the previous notification
getNotifications({ tag: 'abc' }) // Returns [ NotificationB, NotificationA ]
showNotification('C', { tag: 'abc' }) // Replaces the previous notification
getNotifications({ tag: 'abc' }) // Returns [ NotificationC, NotificationB, NotificationA ]