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:

    1. Querying: Returned by service methods such as GetNotification(string id) or GetAllNotifications().
    2. 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.
  • 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 CanleyNotificationRecord is a lightweight struct, it is ideal for iterating through collections returned by GetAllNotifications() without incurring heavy garbage collection overhead.

0 items under this folder.