Developer
UDP Notifications (Legacy)

UDP Notifications

⚠️

This API is kept for existing apps. New apps should use SendNotification over the WebSocket API.

Send a notification object as UTF-8 JSON in a UDP datagram to 127.0.0.1:42069.

The port is set by UdpPort in [XSOverlay install]/XSOverlay_Data/StreamingAssets/Plugins/Config/ExternalMessageAPIConfig.json.

Notification object

Notification

The fields are the same as the WebSocket notification object, except the type field is called messageType and must be 1.

FieldTypeDefaultDescription
messageTypeint0Must be 1, or the message is ignored.
titlestring""Supports Unity rich text (opens in a new tab).
contentstring""Supports rich text. When empty, the notification is shown in its small form.
timeoutfloat0.5Seconds on screen.
heightfloat175Height when the notification has content.
opacityfloat10 is treated as 1.
volumefloat0.7Sound volume.
audioPathstring""Path to an .ogg file, or "default", "error" or "warning". Silent when empty.
iconstring"default"Image path, base64 image, or "default", "error" or "warning".
useBase64IconboolfalseSet to true when icon is base64.
sourceAppstring""Your app's name, shown in logs.

Examples

XSNotifications (opens in a new tab) (GitHub (opens in a new tab)) is a NuGet package that wraps this API.

Program.cs
using XSNotifications;
 
new XSNotifier().SendNotification(new XSNotification { Title = "Notification" });