ISL.NetFramework.Notification.Driver
2.5.2
dotnet add package ISL.NetFramework.Notification.Driver --version 2.5.2
NuGet\Install-Package ISL.NetFramework.Notification.Driver -Version 2.5.2
<PackageReference Include="ISL.NetFramework.Notification.Driver" Version="2.5.2" />
<PackageVersion Include="ISL.NetFramework.Notification.Driver" Version="2.5.2" />
<PackageReference Include="ISL.NetFramework.Notification.Driver" />
paket add ISL.NetFramework.Notification.Driver --version 2.5.2
#r "nuget: ISL.NetFramework.Notification.Driver, 2.5.2"
#:package ISL.NetFramework.Notification.Driver@2.5.2
#addin nuget:?package=ISL.NetFramework.Notification.Driver&version=2.5.2
#tool nuget:?package=ISL.NetFramework.Notification.Driver&version=2.5.2
ISL.NetFramework.Notification.Driver
Single-package notification driver for ISL services. It delivers notifications over two channels from one call:
- Web — SignalR (WebSocket), with an optional Redis backplane for horizontally scaled deployments.
- Mobile / iOS — Firebase Cloud Messaging (FCM), which fans a single token list out to both Android and Apple (APNs) devices.
Notification history is persisted to SQL through the framework repositories, and the same capabilities are exposed both as an injectable driver (for internal services such as content or booking) and as HTTP endpoints.
Registration
builder.Services.AddIslNotificationDriver(builder.Configuration);
// Map the SignalR hub and, optionally, the REST endpoints.
app.MapHub<NotificationHub>("/hubs/notifications");
app.MapIslNotificationEndpoints();
Configuration
{
"Framework": {
"Notification": {
"Driver": {
"Enabled": true,
"Firebase": {
"ServiceAccountKeyPath": "secrets/serviceAccountKey.json"
},
"Redis": {
"Enabled": true,
"ConnectionString": "",
"ChannelPrefix": "ISL.Notification"
},
"Endpoint": {
"Enabled": true,
"RoutePrefix": "/api/notifications"
},
"Auth": {
"RequireAuthentication": true
},
"Delivery": {
"TrackDeliveryStatus": false
}
}
}
}
}
- When
Firebase.ServiceAccountKeyPathis empty, mobile push is disabled and only web delivery runs. - When
Redis.Enabledis true andRedis.ConnectionStringis empty, the connection string falls back toFramework:Redis:ConnectionString. Delivery.TrackDeliveryStatus(defaultfalse): receiver rows keep their initialQueuedstatus. Set totrueto write the post-publish outcome (Sentfor web,Sent/InvalidTokenfor push) and aDeliveredAttimestamp — one extraUPDATEper send.
Injecting the driver
public sealed class BookingConfirmationNotifier(INotificationDriver notifications)
{
public Task NotifyAsync(long userId, CancellationToken ct) =>
notifications.SendAsync(
new NotificationDriverSendRequest(
Title: "Booking confirmed",
Body: "Your appointment is booked.",
Channel: NotificationChannel.All,
Recipients: [new NotificationRecipient(UserId: userId)],
Data: new Dictionary<string, string> { ["bookingId"] = "1234" }),
ct);
}
Endpoints
All read and mutate endpoints act on the authenticated caller's own notifications; the owning user is resolved from the principal.
| Method | Route | Purpose |
|---|---|---|
| POST | / |
Send a notification to one or more recipients. |
| POST | /tokens |
Register or refresh the caller's device token. |
| DELETE | /tokens/{deviceId} |
Unregister a device. |
| GET | / |
List the caller's notifications. |
| GET | /unseen-count |
Return the caller's unseen count. |
| POST | /{notificationId}/seen |
Mark a notification as seen. |
| DELETE | /{notificationId} |
Delete a notification. |
Database
The driver persists to three tables. Notifications holds immutable content, and
NotificationReceivers holds one row per recipient with that user's own seen/checked flags and
web/push delivery outcome, so a single notification can fan out to many users while each tracks an
independent history. FcmTokens stores device tokens for mobile push. Idempotent creation SQL ships
in sql/notification-schema.sql.
DELETE /{notificationId} is a per-user dismiss: it removes only the caller's NotificationReceivers
row, leaving the shared content and other recipients untouched.
erDiagram
NOTIFICATIONS ||--o{ NOTIFICATION_RECEIVERS : "fans out to"
NOTIFICATIONS {
uniqueidentifier Id PK
nvarchar Message
nvarchar MessageJsonValue "arbitrary JSON payload"
nvarchar Topic
nvarchar GeneratorIdentifier "nullable"
int GeneratorModule
int MessageType
int NotificationType
int NotifierMethod "1=Direct 2=Topic"
datetimeoffset CreatedAt
}
NOTIFICATION_RECEIVERS {
uniqueidentifier Id PK
uniqueidentifier NotificationId FK
bigint ReceiverId "indexed"
int Seen "1=Unseen 2=Seen"
datetimeoffset SeenAt "nullable"
int Checked "1=Unchecked 2=Checked"
datetimeoffset CheckedAt "nullable"
int NotifierType "which channel targeted"
int WebDeliveryStatus "1=N/A 2=Queued 3=Sent 4=Failed 5=InvalidToken"
int PushDeliveryStatus "1=N/A 2=Queued 3=Sent 4=Failed 5=InvalidToken"
datetimeoffset DeliveredAt "nullable"
bit IsDeleted "per-user dismiss"
}
FCM_TOKENS {
uniqueidentifier Id PK
nvarchar DeviceId "unique"
nvarchar Email "indexed"
bigint UserId "indexed"
nvarchar Token
}
| 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
- FirebaseAdmin (>= 3.1.0)
- FluentValidation (>= 12.0.0)
- ISL.NetFramework.Application (>= 2.5.0)
- ISL.NetFramework.Infrastructure (>= 2.5.0)
- ISL.NetFramework.Realtime (>= 2.6.1)
- ISL.NetFramework.Repositories (>= 2.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.