Pass userInfo in subscribeNotification

This commit is contained in:
Cheng Zhao 2016-05-18 14:40:19 +09:00
parent 242508e22f
commit 97250b53e8
5 changed files with 38 additions and 9 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`