Interface INotificationClient
- Namespace
- Quilt4Net.Toolkit.Features.Notification
- Assembly
- Quilt4Net.Toolkit.dll
Sends notifications to Quilt4Net, where subscribers such as the Quilt4Net app pick them up.
public interface INotificationClient
Methods
GetCategoriesAsync(CancellationToken)
The team's notification categories, to pick from (#147). Null when the server cannot list them: one
from before #147, or a key without notification:read. Any category can still be sent; one the
team does not have is added. A default implementation keeps implementers building.
Task<string[]> GetCategoriesAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SendAsync(SendNotificationRequest, CancellationToken)
Sends a notification with every field spelled out. Application, environment and instance left unset are filled in from the options, the entry assembly, the host environment and the machine name.
Task<NotificationResponse> SendAsync(SendNotificationRequest request, CancellationToken cancellationToken = default)
Parameters
requestSendNotificationRequestThe notification to send.
cancellationTokenCancellationTokenCancels the call.
Returns
- Task<NotificationResponse>
The notification as the server stored it.
Exceptions
- NotificationClientException
The server refused or failed the call.
SendAsync(string, string, CancellationToken)
Sends a notification. The receiving app decides from category how loudly to
alert, so pick categories the team has agreed on, such as alarm or info.
Task<NotificationResponse> SendAsync(string category, string message, CancellationToken cancellationToken = default)
Parameters
categorystringWhat kind of notification this is. Required, at most 100 characters.
messagestringThe text to show. Required, at most 4000 characters.
cancellationTokenCancellationTokenCancels the call.
Returns
- Task<NotificationResponse>
The notification as the server stored it.
Exceptions
- NotificationClientException
The server refused or failed the call.