LocalNotifications 3.0.0.2

dotnet add package LocalNotifications --version 3.0.0.2
                    
NuGet\Install-Package LocalNotifications -Version 3.0.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LocalNotifications" Version="3.0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LocalNotifications" Version="3.0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="LocalNotifications" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LocalNotifications --version 3.0.0.2
                    
#r "nuget: LocalNotifications, 3.0.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LocalNotifications@3.0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LocalNotifications&version=3.0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=LocalNotifications&version=3.0.0.2
                    
Install as a Cake Tool

LocalNotifications for .NET MAUI

NuGet License: MIT

A cross-platform local notifications plugin for .NET MAUI — supports Android and iOS with scheduling, repeating, and Firebase push notification integration.


Table of Contents


Features

  • 🔔 Show notifications immediately
  • Schedule notifications at a specific date/time
  • 🔁 Repeating notifications — hourly, daily, or weekly
  • 📋 Manage pending notifications (list, cancel one, cancel all)
  • 🔑 Permission handling for Android 13+ (POST_NOTIFICATIONS)
  • 🔥 Firebase Cloud Messaging integration (Android & iOS)

Installation

Install via NuGet Package Manager:

dotnet add package LocalNotifications

Or search for LocalNotifications in the NuGet Package Manager in Visual Studio.


Getting Started

1. Register in MauiProgram.cs

Add .UseLocalNotifications() in your CreateMauiApp() method:

public static MauiApp CreateMauiApp()
{
    var builder = MauiApp.CreateBuilder();
    builder
        .UseMauiApp<App>()
        .ConfigureFonts(fonts =>
        {
            fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
            fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
        })
        .UseLocalNotifications(isFirebase: false, autoRegistration: true);

    return builder.Build();
}
Parameter Description
isFirebase Set to true to enable Firebase Cloud Messaging
autoRegistration Set to true to automatically register lifecycle events

2. (Alternative) Manual Lifecycle Registration

If you need more control, you can manually configure platform lifecycle events instead of using autoRegistration:

builder.ConfigureLifecycleEvents(events =>
{
#if ANDROID
    events.AddAndroid(android => android
        .OnCreate((activity, bundle) => OnNotificationTapped(activity.Intent))
        .OnNewIntent((activity, intent) => OnNotificationTapped(intent)));

    static void OnNotificationTapped(Android.Content.Intent intent)
    {
        LocalNotifications.Platform.NotificationService.NotificationTapped(intent);
    }
#elif IOS
    events.AddiOS(iOS => iOS.FinishedLaunching((app, options) =>
    {
        LocalNotifications.Platform.NotificationService.Initialize(
            options: options,
            isFirebase: false,
            autoRegistration: true);
        return true;
    }));
#endif
});

Usage

Show a Notification Immediately

LocalNotificationCenter.Current.Show(
    notificationId: 1,
    title: "Hello!",
    description: "This notification shows immediately.",
    payload: "my_payload",
    androidOptions: new AndroidOptions { IconName = "notification_icon" },
    iOSOptions: new iOSOptions { Sound = "default" });

Schedule a Notification

LocalNotificationCenter.Current.Schedule(
    notificationId: 2,
    title: "Reminder",
    description: "This fires in 30 seconds.",
    dateTime: DateTime.Now.AddSeconds(30),
    payload: "scheduled_payload",
    androidOptions: new AndroidOptions(),
    iOSOptions: new iOSOptions());

Repeating Notifications

var time = new Time(hour: 9, minute: 0);

// Every hour at :00
LocalNotificationCenter.Current.ShowHourly(
    notificationId: 3, title: "Hourly", description: "Every hour",
    time: time, payload: "hourly");

// Every day at 09:00
LocalNotificationCenter.Current.ShowDaily(
    notificationId: 4, title: "Daily", description: "Every day at 9 AM",
    time: time, payload: "daily");

// Every Monday at 09:00
LocalNotificationCenter.Current.ShowWeekly(
    notificationId: 5, title: "Weekly", description: "Every Monday at 9 AM",
    weekDay: Day.Monday, time: time, payload: "weekly");

Cancel Notifications

// Cancel a specific notification
LocalNotificationCenter.Current.Cancel(notificationId: 1);

// Cancel all notifications
LocalNotificationCenter.Current.CancelAll();

Get Pending Notifications

var pending = LocalNotificationCenter.Current.GetPendingNotificationRequests();
foreach (var n in pending)
{
    Debug.WriteLine($"Pending: ID={n.NotificationId}, Title={n.Title}");
}

Request Permission

bool granted = await LocalNotificationCenter.Current.RequestNotificationPermission(
    new NotificationPermission { AskPermission = true });

Check if Notifications Are Enabled

bool enabled = await LocalNotificationCenter.Current.IsNotificationsEnabled();

Events

// Fired when a notification is received while the app is in the foreground
LocalNotificationCenter.Current.OnNotificationReceived += (e) =>
{
    Debug.WriteLine($"Received: ID={e.NotificationId}");
};

// Fired when the user taps a notification
LocalNotificationCenter.Current.OnNotificationTapped += (e) =>
{
    Debug.WriteLine($"Tapped: ID={e.NotificationId}, Payload={e.Payload}");
};

// Fired when Firebase token is refreshed
LocalNotificationCenter.Current.OnTokenRefresh += (source, e) =>
{
    Debug.WriteLine($"Firebase Token: {e.Token}");
};

Firebase Push Notifications

To enable Firebase Cloud Messaging, pass isFirebase: true when registering:

.UseLocalNotifications(isFirebase: true, autoRegistration: true);

Android Setup

  1. Add google-services.json to your Android project
  2. Set its Build Action to GoogleServicesJson
  3. Add the following permission to AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />

iOS Setup

  1. Add GoogleService-Info.plist to your iOS project (Build Action: BundleResource)
  2. In Info.plist, enable Background ModesRemote Notifications
  3. Add FirebaseAppDelegateProxyEnabled = NO in Info.plist
  4. In Entitlements.plist, enable Push Notifications
  5. Configure the required Apple Push Notification certificates and provisioning profile

Get Firebase Token

string token = await LocalNotificationCenter.Current.GetTokenAsync();

Platform Notes

iOS

⚠️ iOS imposes a limit of 64 pending notifications. Only the 64 soonest-firing notifications are kept.

Android

⚠️ Some Android OEMs customize the OS in ways that may prevent background scheduling from working reliably. See Don't Kill My App for details.


Sample App

Check out the sample app for a complete working example.

Platform Screenshots
Android <img width="300" alt="Android screenshot 1" src="https://user-images.githubusercontent.com/22674537/199664085-a547575f-1506-4249-bfaf-5417df8dcbad.png"> <img width="300" alt="Android screenshot 2" src="https://user-images.githubusercontent.com/22674537/199664456-dd9e8b62-c9c3-42c2-a91b-51e716861f57.png">
iOS <img width="300" alt="iOS screenshot 1" src="https://user-images.githubusercontent.com/22674537/200498405-03ebc105-2728-4bb4-bccf-573266f12ed7.png"> <img width="300" alt="iOS screenshot 2" src="https://user-images.githubusercontent.com/22674537/200498521-88d915ac-bc30-4e6b-b90a-7126248f73a8.png">

License

This project is licensed under the MIT License.

For more information, visit the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0.2 29 3/4/2026
3.0.0.1 309 11/25/2025
3.0.0 451 11/25/2024
2.0.5.6 394 10/21/2024
2.0.5.5 324 10/21/2024
2.0.5.4 518 3/21/2024
2.0.5.3 322 3/21/2024
2.0.5.2 602 5/1/2023
2.0.5.1 696 11/25/2022
2.0.5 610 11/11/2022
2.0.4 620 11/7/2022