FireForNet.Firebase.Messaging.Browser
1.0.1-preview.22
Prefix Reserved
dotnet add package FireForNet.Firebase.Messaging.Browser --version 1.0.1-preview.22
NuGet\Install-Package FireForNet.Firebase.Messaging.Browser -Version 1.0.1-preview.22
<PackageReference Include="FireForNet.Firebase.Messaging.Browser" Version="1.0.1-preview.22" />
<PackageVersion Include="FireForNet.Firebase.Messaging.Browser" Version="1.0.1-preview.22" />
<PackageReference Include="FireForNet.Firebase.Messaging.Browser" />
paket add FireForNet.Firebase.Messaging.Browser --version 1.0.1-preview.22
#r "nuget: FireForNet.Firebase.Messaging.Browser, 1.0.1-preview.22"
#:package FireForNet.Firebase.Messaging.Browser@1.0.1-preview.22
#addin nuget:?package=FireForNet.Firebase.Messaging.Browser&version=1.0.1-preview.22&prerelease
#tool nuget:?package=FireForNet.Firebase.Messaging.Browser&version=1.0.1-preview.22&prerelease
FireForNet.Firebase.Messaging.Browser
Framework-independent WASM integration for FireForNet Firebase Cloud Messaging.
About FireForNet
FireForNet is a platform-agnostic, .NET-native Firebase Client SDK developed as part of the Circuids ecosystem. It provides a consistent Firebase client development experience across .NET application environments, while allowing platform-specific implementations where Firebase requires them.
About This Package
This package provides [JSImport]-based Firebase Cloud Messaging implementations for Uno Platform, Avalonia WASM, and pure .NET WASM — no Blazor dependency required.
It ships a config-free service worker relay (fireForNet-messaging-sw.js), byte-identical to the Blazor package's. It does not embed Firebase configuration or construct FCM tokens; the .NET layer owns the FCM protocol.
Package Boundary
This package uses [JSImport] for direct WASM-to-JS interop. It is framework-independent and does not reference the Blazor packages.
For Blazor applications (WASM, Server, Hybrid, Auto), use FireForNet.Firebase.Messaging.Blazor instead — it uses IJSRuntime.
Installation
dotnet add package FireForNet.Firebase.Messaging.Browser
Targets net10.0. References FireForNet.Firebase.Messaging transitively.
Usage
services.AddFirebaseMessaging()
.UseBrowser(options =>
{
options.VapidKey = "your-vapid-public-key";
});
Service Worker
The service worker is registered at ServiceWorkerPath (default /firebase-messaging-sw.js). Your app must serve the shipped module at that stable path.
AutoRegisterServiceWorker defaults to true, so the package registers its service worker automatically during readiness — the zero-config path.
If your app is a PWA that already registers its own service worker at the same scope, a browser allows only one service worker per scope, so the two registrations would replace each other. Instead, compose the relay into your existing service worker and disable auto-registration:
// In your existing service-worker.js, at the top:
importScripts('/_content/FireForNet.Firebase.Messaging.Browser/fireForNet-messaging-sw.js');
services.AddFirebaseMessaging()
.UseBrowser(options =>
{
options.VapidKey = "your-vapid-public-key";
options.AutoRegisterServiceWorker = false; // you own the service worker
});
importScripts attaches the relay's push, notificationclick, pushsubscriptionchange, and message handlers to your worker alongside your own handlers.
Notification Icon
The service worker renders background notifications via showNotification, which requires icon/image/badge to be absolute URLs. The service worker resolves relative values to absolute URLs against the app origin automatically. To give notifications a default app icon when the payload supplies none, set DefaultNotificationIcon:
options.DefaultNotificationIcon = "/icon-192.png";
Options
| Option | Default | Description |
|---|---|---|
ServiceWorkerPath |
/firebase-messaging-sw.js |
Path to register the service worker |
ServiceWorkerScope |
/ |
Registration scope |
AutoRegisterServiceWorker |
true |
Whether readiness registers the service worker |
VapidKey |
official SDK default | Web Push VAPID public key |
DefaultNotificationIcon |
null |
Default notification icon path (resolved to an absolute URL by the service worker) |
Notification Tap (Deep Links)
When the sender supplies a same-origin link (webpush.fcmOptions.link), the service worker opens the app at that URL (cold start) or focuses the existing window, then relays the click to the page (OnNotificationOpened / GetInitialMessageAsync). The received RemoteMessage exposes the target as Notification.Link / Link. Without a link the click is still relayed so the app can route itself. Console-sent notifications fall back to the app origin, mirroring the official Web JS SDK.
Platform / Framework Support
| Platform / Framework | Status |
|---|---|
| Browser / WASM (Uno Platform, Avalonia WASM, pure .NET WASM) | Preview |
Documentation
Comprehensive FireForNet documentation is being prepared for the Release Candidate stage.
Project Status
FireForNet is currently available as a Preview release and is approaching its Release Candidate milestone. APIs, package structure, and implementation details may continue to evolve before RC and GA.
The RC milestone will be followed by an extensive cross-platform validation and testing phase before the first GA release.
All FireForNet packages are part of a coordinated release train and share the same version number.
Source Availability
FireForNet is currently being developed in a private source repository during the Preview development phase. The source will be made publicly available as the project approaches its open-source phase, with the public repository established from the appropriate release milestone.
Until then, NuGet Preview packages provide the public distribution channel for evaluating and using FireForNet.
License
This package is licensed under the Apache-2.0 license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- FireForNet.Firebase.Installations.Browser (>= 1.0.1-preview.22)
- FireForNet.Firebase.Messaging (>= 1.0.1-preview.22)
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 |
|---|---|---|
| 1.0.1-preview.22 | 46 | 9/27/2026 |
| 1.0.1-preview.21 | 51 | 9/22/2026 |
| 1.0.1-preview.20 | 56 | 9/18/2026 |
| 1.0.1-preview.19 | 62 | 9/12/2026 |
| 1.0.1-preview.18 | 73 | 8/24/2026 |
| 1.0.1-preview.17 | 87 | 8/9/2026 |
| 1.0.1-preview.16 | 75 | 8/9/2026 |
| 1.0.1-preview.15 | 79 | 8/8/2026 |
| 1.0.1-preview.14 | 78 | 8/8/2026 |
v1.0.1-preview.22
- Web registration omits applicationPubKey when unset (declared per property on the request DTO); null values are otherwise written by default (STJ default shape).
v1.0.1-preview.21
- No functional changes; synchronized with the framework-free MAUI integration sweep.
v1.0.1-preview.20
- Synchronized package version with the preview.20 release.
v1.0.1-preview.19
- Synchronized package version with the preview.19 release.
- Fixed tapping a background notification with a link when the app was not open (cold start). The service worker now persists the click payload in IndexedDB — surviving service-worker termination while a slow WASM boot completes — and delivers it when the freshly opened page signals its relay listener is ready, instead of posting into the void after a fixed 3-second wait. Held payloads expire after 5 minutes.
- The service worker's notification-click link resolution now falls back to the app origin for Firebase Console notifications (google.c.a.c_id data key), matching the official Web JS SDK.
- The payload mapper now surfaces the notification deep link (RemoteNotification.Link / RemoteMessage.Link).
v1.0.1-preview.18
- Synchronized package version with the preview.18 release.
v1.0.1-preview.17
- Fixed FCM registration failing with HTTP 401 UNAUTHENTICATED. The x-goog-firebase-installations-auth header now uses the official `FIS {token}` scheme (matching the Web JS SDK) instead of `FIS_v2 {token}`. The service worker's cold-start re-registration was updated to match.
- Added a configurable default notification icon. The service worker now resolves relative notification icon/image/badge values to absolute URLs against the app origin, and the new MessagingBrowserOptions.DefaultNotificationIcon is provisioned to the worker as the fallback icon when the payload supplies none.
v1.0.1-preview.16
- Fixed RegisterAsync throwing ArgumentNullException when called without RegisterOptions. Registration with a null options now uses the configured MessagingBrowserOptions.VapidKey as documented (null = defaults), instead of crashing.
v1.0.1-preview.15
- Fixed ServiceWorkerPath and ServiceWorkerScope being ignored. The page JS module now accepts (path, scope), and the interop/adapter/lifecycle coordinator forward the configured values to navigator.serviceWorker.register. Consuming apps can now point registration at the package's shipped service worker (e.g. /_content/FireForNet.Firebase.Messaging.Browser/fireForNet-messaging-sw.js) without vendoring a copy into their own wwwroot.
v1.0.1-preview.14
- Initial browser Firebase Messaging integration: FID-based registration, foreground/notification event relay, permission management, config-free service worker, capability detection.
- Uses IFirebaseInstallations directly for the FIS auth token and persistent FID.