Detailed Member Reference
Namespace: Canley.Utility.Notifications
Class: CanleyNotificationService
GetNotification
public static CanleyNotificationRecord? GetNotification(string id)-
Description: Retrieves a specific notification record by its unique ID. Returns
nullif no matching record is found. -
Parameters:
id(string): The unique GUID of the notification to query.
-
Workflow:
- Queue Search: Scans the active local notification registry using the supplied string identifier.
- Snapshot Return: If found, wraps the data into a read-only
CanleyNotificationRecordstruct; otherwise, returnsnull.
-
Return Type:
CanleyNotificationRecord?(Nullable value type) -
Access: Public Static
-
Example:
using Canley.Utility.Notifications;
using UnityEngine;
public class NotificationInspector : MonoBehaviour
{
public void InspectNotification(string noteId)
{
// Retrieve a specific notification record by its unique ID
var record = CanleyNotificationService.GetNotification(noteId);
if (record.HasValue)
{
Debug.Log($"Found notification: {record.Value.Title} | Repeats: {record.Value.Repeats}");
}
else
{
Debug.Log("Notification not found or already fired.");
}
}
}TIP
Because
GetNotificationreturns a nullable struct (CanleyNotificationRecord?), always check the.HasValueproperty before attempting to read properties likeTitleorRepeatsto avoid null-reference handling issues.