Table of Contents

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

cancellationToken CancellationToken

Returns

Task<string[]>

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

request SendNotificationRequest

The notification to send.

cancellationToken CancellationToken

Cancels 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

category string

What kind of notification this is. Required, at most 100 characters.

message string

The text to show. Required, at most 4000 characters.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<NotificationResponse>

The notification as the server stored it.

Exceptions

NotificationClientException

The server refused or failed the call.