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 ]