Show a system notification.
Defined in <SDL3/SDL_notification.h>
SDL_NotificationID SDL_ShowNotificationWithProperties(SDL_PropertiesID props);| SDL_PropertiesID | props | the properties to be used when creating this notification. |
(SDL_NotificationID) Returns A non-zero SDL_NotificationID on success or 0 on failure; call SDL_GetError() for more information.
System notifications are small, asynchronous popup windows that notify the user of some information. How they are displayed is system dependent.
These are the supported properties:
SDL_PROP_NOTIFICATION_TITLE_STRING: the title of the notification, in UTF-8 encoding. This property is required.SDL_PROP_NOTIFICATION_ACTIONS_POINTER: An array of pointers to SDL_NotificationAction structs that will add actions to the notification, usually in the form of buttons or menu items. Note that systems may have a limit on the maximum number of actions that a notification can have.SDL_PROP_NOTIFICATIONS_ACTION_COUNT_NUMBER: the number of actions in the array of actions, if it exists.SDL_PROP_NOTIFICATION_IMAGE_POINTER: a pointer to an SDL_Surface containing an image that will be attached to the notification. In most cases, the image is displayed in the form of a large icon or thumbnail alongside the message body. Notifications on Apple platforms can be expanded to show a larger format image.SDL_PROP_NOTIFICATION_MESSAGE_STRING: the message body of the notification, in UTF-8 encoding.SDL_PROP_NOTIFICATION_PRIORITY_NUMBER: an SDL_NotificationPriority value representing the notification priority.SDL_PROP_NOTIFICATION_REPLACES_NUMBER: the SDL_NotificationID of a previously shown notification that this notification should replace.SDL_PROP_NOTIFICATION_SOUND_STRING: sets a sound to play when the notification is shown. This can have the value "default", to play the system default notification sound, "silent", to play no sound, or contain the path to a file with a custom sound. The paths and formats that can be used for custom sounds are system-specific, and can have some restrictions, depending on the platform:SDL_PROP_NOTIFICATION_TRANSIENT_BOOLEAN: true if the notification should not persist in the system notification center after initially being shown.Not all properties are supported by all platforms.
Notifications are available on: - Windows 10 or higher - macOS 10.14 or higher - iOS 11 or higher - *nix platforms that support the org.freedesktop.Notifications, or org.freedesktop.portal.Notification interfaces
This function is available since SDL 3.6.0.