MobileNomad.MAUI.PushNotifications.Core 1.0.0

dotnet add package MobileNomad.MAUI.PushNotifications.Core --version 1.0.0
                    
NuGet\Install-Package MobileNomad.MAUI.PushNotifications.Core -Version 1.0.0
                    
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="MobileNomad.MAUI.PushNotifications.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MobileNomad.MAUI.PushNotifications.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MobileNomad.MAUI.PushNotifications.Core" />
                    
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 MobileNomad.MAUI.PushNotifications.Core --version 1.0.0
                    
#r "nuget: MobileNomad.MAUI.PushNotifications.Core, 1.0.0"
                    
#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 MobileNomad.MAUI.PushNotifications.Core@1.0.0
                    
#: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=MobileNomad.MAUI.PushNotifications.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MobileNomad.MAUI.PushNotifications.Core&version=1.0.0
                    
Install as a Cake Tool

MobileNomad MAUI Push Notifications

A comprehensive .NET MAUI library for implementing cross-platform push notifications using Azure Notification Hubs. This solution supports multiple push notification services including APNS (Apple Push Notification Service), FCM (Firebase Cloud Messaging), and WNS (Windows Notification Service).

Purpose

This library provides a unified, platform-specific implementation for push notifications in .NET MAUI applications, leveraging Azure Notification Hubs as the central messaging service. It abstracts the complexity of platform-specific push notification implementations while maintaining full control over notification handling.

Projects Overview

Core Projects

MobileNomad.MAUI.PushNotifications.Core
  • Purpose: Provides the foundational interfaces, base classes, and shared functionality for push notifications
  • Key Components:
    • INotificationRegistrationService - Core registration interface
    • NotificationRegistrationServiceBase - Base implementation for platform-specific services
    • PushMessages - Static event system for notification handling
    • RegisterDeviceMessage - Data structure for device registration
    • Azure Notification Hub client configuration

Platform-Specific Projects

MobileNomad.MAUI.PushNotifications.APNS
  • Purpose: Apple Push Notification Service implementation for iOS and Mac Catalyst
  • Platforms: iOS 15.0+, Mac Catalyst 15.0+
  • Key Components:
    • Platform-specific NotificationRegistrationService implementations
    • UserNotificationDelegate for handling notification events
    • AppDelegateHelpers for easy integration into AppDelegate
MobileNomad.MAUI.PushNotifications.FCM
  • Purpose: Firebase Cloud Messaging implementation for Android
  • Platforms: Android API 21+
  • Dependencies: Xamarin.Firebase.Messaging
MobileNomad.MAUI.PushNotifications.WNS
  • Note: This project is in progress.
  • Purpose: Windows Notification Service implementation for Windows
  • Platforms: Windows 10.0.17763.0+

Sample Project

MobileNomad.MAUI.PushNotifications.Sample
  • Purpose: Demonstrates how to integrate and use the push notification libraries
  • Platforms: All supported platforms (Android, iOS, Mac Catalyst, Windows)

Getting Started

1. Installation

Add references to the required projects in your MAUI application: <ProjectReference Include="path\to\MobileNomad.MAUI.PushNotifications.Core.csproj" /> <ProjectReference Include="path\to\MobileNomad.MAUI.PushNotifications.APNS.csproj" /> <ProjectReference Include="path\to\MobileNomad.MAUI.PushNotifications.FCM.csproj" />

2. Setup in MauiProgram.cs

Configure the notification services in your MauiProgram.cs: public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .SetupNotificationsCore(azureConnectionString, hubName) .SetupNotificationsFCM() // For Android .SetupNotificationsAPNS(); // For iOS/Mac Catalyst

    return builder.Build();
}

}

3. Azure Notification Hub Configuration

You'll need:

  • Azure Notification Hub connection string
  • Hub name
  • Platform-specific credentials (APNS certificates, FCM server key, etc.)

4. Platform-Specific Setup

iOS/Mac Catalyst

Add notification setup to your AppDelegate: using MobileNomad.MAUI.PushNotifications.APNS;

public class AppDelegate : MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() ⇒ MauiProgram.CreateMauiApp();

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    AppDelegateHelpers.NotificationFinishedLaunching(this);
    return base.FinishedLaunching(application, launchOptions);
}

}

Android

Ensure your google-services.json file is included in the Android platform folder.

Architecture

Key Features

  • Cross-Platform: Single API for all supported platforms
  • Azure Integration: Built specifically for Azure Notification Hubs
  • Event-Driven: Uses static event system for notification handling
  • Modular: Platform-specific implementations can be included as needed
  • Type-Safe: Strongly-typed message and response objects

Notification Flow

  1. App initializes with Azure Notification Hub credentials
  2. Platform-specific services register device tokens
  3. Azure Notification Hub manages device registrations
  4. Incoming notifications are handled by platform delegates
  5. Events are raised through the PushMessages static class

Requirements

  • .NET 9.0
  • .NET MAUI
  • Azure Notification Hub service
  • Platform-specific push notification credentials

Supported Platforms

  • Android: API 21+ (via FCM)
  • iOS: 15.0+ (via APNS)
  • Mac Catalyst: 15.0+ (via APNS)
  • Windows: 10.0.17763.0+ (via WNS - implementation status may vary)

Dependencies

  • Microsoft.Maui.Controls 9.0.50
  • Microsoft.Azure.NotificationHubs 4.2.0
  • Xamarin.Firebase.Messaging 124.1.0.1 (Android only)

Sample Application

The included sample application demonstrates:

  • Proper service configuration
  • Device registration
  • Notification handling
  • Cross-platform compatibility

Run the sample to see the push notification system in action across different platforms.

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst 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 (2)

Showing the top 2 NuGet packages that depend on MobileNomad.MAUI.PushNotifications.Core:

Package Downloads
MobileNomad.MAUI.PushNotifications.FCM

Core components to assist with consuming Azure Notification Hubs push notifications for Firebase

MobileNomad.MAUI.PushNotifications.APNS

Components to assist with consuming Azure Notification Hubs push notifications for Apple Push Notification Service

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 138 7/4/2025