Detailed Struct Reference
Namespace: Canley.Utility.Notifications
Struct: CanleyNotificationRecord
Overview
public struct CanleyNotificationRecord
{
public string ID { get; }
public string Title { get; }
public string Body { get; }
public bool Repeats { get; }
}-
Description: A clean, read-only data structure that provides a snapshot of a notification currently registered within the native notification center.
-
Workflow:
- Querying: Returned by service methods such as
GetNotification(string id)orGetAllNotifications(). - Inspection: Use the fields to read active properties like unique handles, text content, and repetition cycles without needing to interface directly with raw platform objects.
- Querying: Returned by service methods such as
-
Type:
struct(Value Type) -
Access: Read-only fields for external consumers
-
Example:
using Canley.Utility.Notifications;
using UnityEngine;
public class NotificationInspector : MonoBehaviour
{
public void CheckStatus(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
CanleyNotificationRecordis a lightweightstruct, it is ideal for iterating through collections returned byGetAllNotifications()without incurring heavy garbage collection overhead.