Detailed Member Reference

Namespace: Canley.Utility.Notifications
Class: CanleyNotificationService

ClearAll

public static void ClearAll()
  • Description: Performs a hard purge of the notification center, immediately clearing all currently scheduled and delivered alerts from the system queue.

  • Workflow:

    1. Registry Sweep: Traverses the platform’s active and delivered notification registers.
    2. Total Purge: Cancels every pending local alert and clears visible badges or notifications from the device tray.
  • Return Type: void

  • Access: Public Static

  • Example:

using Canley.Utility.Notifications;
using UnityEngine;
 
public class PlayerAccountManager : MonoBehaviour 
{
    public void OnPlayerLogOut() 
    {
        // Wipe all pending game notifications when the user logs out of their account
        CanleyNotificationService.ClearAll();
        Debug.Log("Cleared all scheduled notifications due to user logout.");
    }
}

TIP

ClearAll is your best mate when implementing a “Reset Game Data” or “Wipe Save” feature, ensuring players don’t receive stale reminders for a character or campaign they’ve completely restarted.