getHistory
Resolves with an array of Notification objects representing all delivered notifications still present in Notification Center.
Each returned Notification is a live object connected to the corresponding delivered notification. Interaction events (click, reply, action, close) will fire on these objects when the user interacts with the notification in Notification Center. This is useful after an app restart to re-attach event handlers to notifications from a previous session.
The returned notifications have their id, groupId, title, subtitle, and body properties populated from information available in the Notification Center. Other properties (e.g., actions, silent, icon) are not available from delivered notifications and will have default values.
!NOTE Like all macOS notification APIs, this method requires the application to be code-signed. In unsigned development builds, notifications are not delivered to Notification Center and this method will resolve with an empty array.
!NOTE Unlike notifications created with
new Notification(), notifications returned bygetHistory()will remain visible in Notification Center when the object is garbage collected. Callingshow()on a restored notification will remove the original from Notification Center and post a new one with the same properties.