Interface IPushService
Push messages through a UnifiedPush distributor, which keeps one connection for all its apps: registering gives an endpoint URL, which the homeserver's pusher posts to through the distributor's gateway, and messages wake the app.
Namespace: Uniform.Chat.Avalonia.Services
Assembly: Uniform.Chat.Avalonia.dll
Syntax
public interface IPushService
Properties
| Edit this page View SourceDistributor
The distributor chosen, or null for none.
Declaration
string? Distributor { get; }
Property Value
| Type | Description |
|---|---|
| string |
Endpoint
The endpoint the distributor gave, or null while not registered.
Declaration
string? Endpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
MessageHandler
Handles a push message: wakes the app to sync. While none is set, the platform shows a plain notification itself.
Declaration
Func<byte[], Task>? MessageHandler { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<byte[], Task> |
Methods
| Edit this page View SourceGetDistributors()
The distributors installed now.
Declaration
IReadOnlyList<PushDistributor> GetDistributors()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<PushDistributor> |
Register(string)
Register with distributor; Changed tells when the endpoint comes.
Declaration
void Register(string distributor)
Parameters
| Type | Name | Description |
|---|---|---|
| string | distributor |
Unregister()
Unregister, and use no distributor.
Declaration
void Unregister()
Events
| Edit this page View SourceChanged
Raised when Distributor or Endpoint changes, possibly off the UI thread.
Declaration
event Action? Changed
Event Type
| Type | Description |
|---|---|
| Action |