class documentation

class NotificationTranslator(Protocol): (source)

View In Hierarchy

Translate notifications from the notification ID and some user data,

Method fromNotification A user interacted with a notification with the given parameters; deserialize them into a Python object that can process that action.
Method toNotification The application has requested to send a notification to the operating system, serialize the Python object represneting this category of notification into a 2-tuple of notificatcionID, userData that can be encapsulated in a ...
def fromNotification(self, notificationID: str, userData: dict[str, Any]) -> T: (source)

A user interacted with a notification with the given parameters; deserialize them into a Python object that can process that action.

def toNotification(self, notification: T) -> tuple[str, dict[str, Any]]: (source)

The application has requested to send a notification to the operating system, serialize the Python object represneting this category of notification into a 2-tuple of notificatcionID, userData that can be encapsulated in a UNNotificationRequest.