SeliseBlocks.NotificationDriver
9.0.0-preview.1
dotnet add package SeliseBlocks.NotificationDriver --version 9.0.0-preview.1
NuGet\Install-Package SeliseBlocks.NotificationDriver -Version 9.0.0-preview.1
<PackageReference Include="SeliseBlocks.NotificationDriver" Version="9.0.0-preview.1" />
<PackageVersion Include="SeliseBlocks.NotificationDriver" Version="9.0.0-preview.1" />
<PackageReference Include="SeliseBlocks.NotificationDriver" />
paket add SeliseBlocks.NotificationDriver --version 9.0.0-preview.1
#r "nuget: SeliseBlocks.NotificationDriver, 9.0.0-preview.1"
#:package SeliseBlocks.NotificationDriver@9.0.0-preview.1
#addin nuget:?package=SeliseBlocks.NotificationDriver&version=9.0.0-preview.1&prerelease
#tool nuget:?package=SeliseBlocks.NotificationDriver&version=9.0.0-preview.1&prerelease
SeliseBlocks.NotificationDriver
Overview
SeliseBlocks.NotificationDriver
is a powerful, socket-compatible notification driver designed to deliver messages to users based on roles, user IDs, or filters. It supports broadcasting, user-specific, and filter-specific notifications with optional payload persistence for offline storage and later retrieval.
Installation
Install the NuGet package via CLI:
dotnet add package SeliseBlocks.NotificationDriver
Usage
Register Dependencies
In your Program.cs
:
using Blocks.Extension.DependencyInjection;
builder.Services.RegisterNotificationService();
Features
✅ Notify via Socket or Persisted Channel
To send a notification, construct a NotifyRequest
and use the NotifyAsync
method:
var notifyRequest = new NotifyRequest
{
ConnectionId = "connection-123", // Optional socket connection ID
UserIds = new List<string> { "user1", "user2" },
Roles = new List<string> { "admin", "moderator" },
SubscriptionFilters = new List<SubscriptionFilter>
{
new SubscriptionFilter { Key = "Department", Value = "HR" }
},
DenormalizedPayload = JsonSerializer.Serialize(new { Message = "Welcome to SeliseBlocks!" }),
SaveDenormalizedPayloadAsAnObject = true,
ConfiguratoinName = "default",
ContentAvailable = true,
ResponseKey = "status",
ResponseValue = "sent"
};
var response = await notificationDriverService.NotifyAsync(notifyRequest);
NotifyRequest Structure
NotifyRequest
inherits from NotifierPayload
and contains all required fields to send notifications.
🔹 NotifierPayload Fields
Property | Description |
---|---|
ConnectionId |
Optional; socket connection ID for direct delivery |
UserIds |
List of user IDs for user-specific notifications |
Roles |
Roles for role-based delivery |
SubscriptionFilters |
Filter-based delivery (key-value) |
DenormalizedPayload |
Offline payload as JSON string |
SaveDenormalizedPayloadAsAnObject |
If true, stores JSON as an object in DB |
🔹 NotifyRequest Additional Fields
Property | Description |
---|---|
ConfiguratoinName |
The configuration name or channel profile |
ContentAvailable |
Used for push notification availability hints |
ResponseKey |
Custom response key |
ResponseValue |
Custom response value |
Example Configuration
Ensure you have the appropriate socket or offline handling logic in place to consume and store messages as needed.
Summary
SeliseBlocks.NotificationDriver
provides an elegant and flexible way to send structured notifications across different targeting mechanisms. It is socket-ready and supports role-based, user-based, and filter-based delivery patterns with optional payload persistence.
🚀 Ideal for modern, event-driven applications requiring real-time or offline user notifications.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. 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. |
-
net9.0
- No dependencies.
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 |
---|---|---|
9.0.0-preview.1 | 352 | 6/24/2025 |