Class PusherService
Users' pushers: where push notifications go, set by apps that want them, such as phone apps with a push gateway.
Inherited Members
Namespace: Uniform.Matrix.Server.Accounts
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class PusherService
Remarks
A pusher belongs to the device that set it, and goes when that device logs out. PushNotifier sends to them.
Constructors
| Edit this page View SourcePusherService(IDbContextFactory<ServerDbContext>, TimeProvider)
Create the service.
Declaration
public PusherService(IDbContextFactory<ServerDbContext> contexts, TimeProvider time)
Parameters
| Type | Name | Description |
|---|---|---|
| IDbContextFactory<ServerDbContext> | contexts | |
| TimeProvider | time |
Fields
| Edit this page View SourceGatewayPath
Path that gateway URLs end with, as the spec requires.
Declaration
public const string GatewayPath = "/_matrix/push/v1/notify"
Field Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceDeleteAsync(string, string, IReadOnlyCollection<string>, CancellationToken)
Delete pushers by key, e.g. those a gateway rejected.
Declaration
public Task DeleteAsync(string userId, string appId, IReadOnlyCollection<string> pushKeys, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | |
| string | appId | |
| IReadOnlyCollection<string> | pushKeys | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
GetAsync(string, CancellationToken)
Return the user's pushers as the spec lists them.
Declaration
public Task<JsonArray> GetAsync(string userId, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<JsonArray> |
IsGatewayUrl(string?)
Return whether url is an absolute http or https URL of the gateway path.
Declaration
public static bool IsGatewayUrl(string? url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url |
Returns
| Type | Description |
|---|---|
| bool |
SetAsync(string, string, JsonObject, CancellationToken)
Add, replace or, with a null kind, delete a pusher of the user, from the body of POST /pushers/set.
Declaration
public Task SetAsync(string userId, string deviceId, JsonObject body, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | Owner. |
| string | deviceId | Device setting it, which owns it. |
| JsonObject | body | The pusher, with |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task |