feat: add support for UNNotificationResponse in app 'ready' event (#25950)

This commit is contained in:
Milan Burda 2020-10-28 02:25:10 +01:00 committed by GitHub
parent bf89237f60
commit d2727f5aba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 9 deletions

View file

@ -33,10 +33,11 @@ In most cases, you should do everything in the `ready` event handler.
Returns:
* `event` Event
* `launchInfo` Record<string, any> _macOS_
* `launchInfo` Record<string, any> | [NotificationResponse](structures/notification-response.md) _macOS_
Emitted once, when Electron has finished initializing. On macOS, `launchInfo`
holds the `userInfo` of the `NSUserNotification` that was used to open the
holds the `userInfo` of the `NSUserNotification` or information from
[`UNNotificationResponse`](structures/notification-response.md) that was used to open the
application, if it was launched from Notification Center. You can also call
`app.isReady()` to check if this event has already fired and `app.whenReady()`
to get a Promise that is fulfilled when Electron is initialized.

View file

@ -0,0 +1,7 @@
# NotificationResponse Object
* `actionIdentifier` String - The identifier string of the action that the user selected.
* `date` Number - The delivery date of the notification.
* `identifier` String - The unique identifier for this notification request.
* `userInfo` Record<String, any> - A dictionary of custom information associated with the notification.
* `userText` String (optional) - The text entered or chosen by the user.