feat: add support for UNNotificationResponse in app 'ready' event (#25950)
This commit is contained in:
parent
bf89237f60
commit
d2727f5aba
5 changed files with 50 additions and 9 deletions
|
@ -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.
|
||||
|
|
7
docs/api/structures/notification-response.md
Normal file
7
docs/api/structures/notification-response.md
Normal 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.
|
Loading…
Add table
Add a link
Reference in a new issue