# Notifications

{% hint style="success" %}
verified: 2025-11-20 version: v39
{% endhint %}

<figure><img src="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-bb7df6413941c104250927b05b15bae854a7ea81%2Fimage.png?alt=media" alt=""><figcaption><p>The Notification feature billboard in the Example Map demonstrates this features when you click on the megaphones.</p></figcaption></figure>

The notifications system queues and displays notifications passed to clients as packed structs. You can specify the parameters that you want to pass to these structs.

## Sending Notifications

You can either send a notification to the local client as a local notification, or to send a global notification to all clients.

#### Local Notification Example

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/40f78996-0379-4e24-b37a-f6aad666d1b2>" %}

#### Global Notification Example

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/761735f8-73e1-41b3-9196-3e870ed58be1>" %}

#### Notification Data

A notification requires three variables to be sent:

* **Notification Type:** An identifier for the notification system to store the notification. This does not have to be unique.
* **Notification Time:** The notification's display duration.
* **Notification Payload:** A morpheus packed struct that wraps any struct you want to pass.

## Displaying Notifications

To display notifications in the user interface you need to hook a widget blueprint up to events sent by the notifications singleton. `WBP_M2Example_NotificationsDisplay` is one such widget blueprint, it binds to the delegates as follows:

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/0dc44196-37ad-424e-9837-f3f3336337db>" %}

#### All Notifications System Functions

* **Send Local Notification:** Send a notification to the local client
* **Send Global Notification:** Send a notification to all clients
* **Remove Notifications by Type:** Remove notifications of type
* **Remove Notifications by Id:** Remove notification with Id
* **Remove All Notifications:** Removes all notifications

## Changing the queueing order

If the you want to change the way notifications are ordered in the queue, create a blueprint with parent `M2M_NotificationsSingleton` and override the GetNextNotificationIndex function. Here's an example of last in first out (LIFO) ordering:

<figure><img src="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-42557be64732dda55f3e7b1f877c06d1429b76b0%2Fimage.png?alt=media" alt=""><figcaption><p>Example Get Next Notification Index override</p></figcaption></figure>

After creating this blueprint class, you need to assign it as the notifications system singleton class under: **World Settings -> Notifications Singleton Class**.

<figure><img src="https://1456550285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoWTlPaoHd1McSakqMigu%2Fuploads%2Fgit-blob-d24b925ccf98bc3b596de47cc02d0550fa39b081%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
