class documentation
The application-wide configuration for a notification.
| Method | add |
Add a new category (represented by a plain Python class, which may have some methods that were decorated with response(...), response.text(...)). |
def add(self, category:
type[ NotifT], translator: NotificationTranslator[ NotifT], allowInCarPlay: bool = False, hiddenPreviewsShowTitle: bool = False, hiddenPreviewsShowSubtitle: bool = False) -> Notifier[ NotifT]:
(source)
ΒΆ
Add a new category (represented by a plain Python class, which may have some methods that were decorated with response(...), response.text(...)).
| Parameters | |
category:type[ | A Python type that contains the internal state for the notifications that will be emitted, that will be relayed back to its responses (e.g. the response methods on the category). |
translator:NotificationTranslator[ | a translator that can serialize and deserialize python objects to UNUserNotificationCenter values. |
allowbool | Should the notification be allowed to show in CarPlay? |
hiddenbool | Should lock-screen previews for this notification show the unredacted title? |
hiddenbool | Should lock-screen previews for this notification show the unredacted subtitle? |
| Returns | |
Notifier[ | A Notifier that can deliver notifications to macOS. |
| Note | |
| This method can only be called within the with statement for the context manager beneath configureNotifications, and can only do this once per process. Otherwise it will raise an exception. | |