Merge pull request #5582 from electron/notification-user-info

Pass userInfo in systemPreferences.subscribeNotification
This commit is contained in:
Cheng Zhao 2016-05-18 07:36:31 +00:00
commit d2a567d6ab
5 changed files with 122 additions and 20 deletions

View file

@ -13,12 +13,16 @@ This method returns `true` if the system is in Dark Mode, and `false` otherwise.
* `event` String
* `callback` Function
Subscribes to native notifications of OS X, `callback` will be called when the
corresponding `event` happens. The `id` of the subscriber is returned, which can
be used to unsubscribe the `event`.
Subscribes to native notifications of OS X, `callback` will be called with
`callback(event, userInfo)` when the corresponding `event` happens. The
`userInfo` is an Object that contains the user information dictionary sent
along with the notification.
The `id` of the subscriber is returned, which can be used to unsubscribe the
`event`.
Under the hood this API subscribes to `NSDistributedNotificationCenter`,
possible values of `event` are:
example values of `event` are:
* `AppleInterfaceThemeChangedNotification`
* `AppleAquaColorVariantChanged`