Class PushRegistration
Keeps the homeserver's pusher of this device in step with IPushService: a pusher to the endpoint while registered, none otherwise; and syncs at once when a push message comes.
Implements
Inherited Members
Namespace: Uniform.Chat.Avalonia.Services
Assembly: Uniform.Chat.Avalonia.dll
Syntax
public sealed class PushRegistration : IDisposable
Remarks
The pusher asks for event_id_only, so neither the gateway nor the distributor sees what was written or by whom; the app syncs to show it.
Constructors
| Edit this page View SourcePushRegistration(ClientConnection, IPushService, string, HttpMessageHandler?)
Follow push for connection.
Declaration
public PushRegistration(ClientConnection connection, IPushService push, string deviceName, HttpMessageHandler? handler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ClientConnection | connection | The signed-in engine. |
| IPushService | push | The platform's push service. |
| string | deviceName | Device name the pusher shows in other clients. |
| HttpMessageHandler | handler | HTTP handler for finding the gateway; the default when null. |
Fields
| Edit this page View SourceAppId
The pusher's application ID, the Android package name.
Declaration
public const string AppId = "rip.uniform.chat"
Field Value
| Type | Description |
|---|---|
| string |
FallbackGateway
The gateway of UnifiedPush, used when the endpoint's server has no Matrix gateway of its own.
Declaration
public const string FallbackGateway = "https://matrix.gateway.unifiedpush.org/_matrix/push/v1/notify"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceIsActive
Whether push messages wake the app, so it needs no connection of its own in the background.
Declaration
public bool IsActive { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceDispose()
Stop following the push service.
Declaration
public void Dispose()
UpdateAsync(CancellationToken)
Set or remove the pusher as the push service now stands, e.g. after signing in.
Declaration
public Task UpdateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Events
| Edit this page View SourceActiveChanged
Raised when IsActive may have changed.
Declaration
public event Action? ActiveChanged
Event Type
| Type | Description |
|---|---|
| Action |