Quick Start: Notifications Lite for iOS

Welcome to Canley Notifications Lite for iOS. This guide will get you up and running with platform-native local notifications in your Unity project in just a few minutes.


Prerequisites

Ensure you have installed the official Unity Mobile Notifications package via the Unity Package Manager before proceeding.


Integration Guide

1. Initialise on Startup

During your game or application’s boot sequence, call the initialisation method to request the necessary user permissions (Alert, Badge, and Sound) from iOS:

using Canley.Utility.Notifications;
 
public class Bootstrapper : MonoBehaviour
{
    private void Start()
    {
        // Requests permissions immediately on startup
        CanleyNotificationService.Initialise();
    }
}

2. Schedule a Notification

You can schedule alerts using relative time delays or specific calendar timestamps. Every scheduled notification returns a unique GUID string, which acts as your handle for updates or cancellations.

// Schedule a re-engagement reminder to fire in 1 day
string myID = CanleyNotificationService.ScheduleTimed(
    "We miss you!", 
    "Come back and claim your daily reward.", 
    CanleyNotificationService.ToSeconds(days: 1)
);

3. Manage and Cancel

If a user completes an action early or you need to clear an alert, use the unique ID to remove it, or purge the queue entirely.

// Cancel a specific notification by its GUID
CanleyNotificationService.RemoveNotification(myID);
 
// Or purge all pending and delivered notifications
// CanleyNotificationService.ClearAll();

Editor-Safe Development

Developing on a PC or Mac? The service automatically intercepts native iOS calls in the Unity Editor and provides clear console logs instead, allowing you to test and debug your entire scheduling logic without pushing a build to a physical device.