rustore.push.maui.server
1.0.0
dotnet add package rustore.push.maui.server --version 1.0.0
NuGet\Install-Package rustore.push.maui.server -Version 1.0.0
<PackageReference Include="rustore.push.maui.server" Version="1.0.0" />
<PackageVersion Include="rustore.push.maui.server" Version="1.0.0" />
<PackageReference Include="rustore.push.maui.server" />
paket add rustore.push.maui.server --version 1.0.0
#r "nuget: rustore.push.maui.server, 1.0.0"
#:package rustore.push.maui.server@1.0.0
#addin nuget:?package=rustore.push.maui.server&version=1.0.0
#tool nuget:?package=rustore.push.maui.server&version=1.0.0
Rustore.Push.Server
Server-side .NET library (NuGet package) for sending push notifications via the RuStore Universal Push API. Supports all four providers in a single request: RuStore, FCM, APNS, HMS.
- Idiomatic DI registration on top of
IHttpClientFactory. - Multi-provider fan-out in one call.
- Low-level "raw" API + ergonomic high-level overloads.
- Replaceable
IRustoreCredentialsProvider(Vault, Secrets Manager, multi-tenant). - Mandatory client-side 4 KB payload check.
- Typed exception hierarchy (
VALIDATION_ERROR/PROVIDER_ERROR/ network / 5xx). IOptionsMonitor-based hot-reload of options.
Install
dotnet add package Rustore.Push.Server
Quick Start
using Rustore.Push.Server.Abstractions;
using Rustore.Push.Server.Configuration;
using Rustore.Push.Server.DependencyInjection;
using Rustore.Push.Server.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRustorePush(o =>
{
o.Rustore = new RustoreProviderOptions
{
AuthToken = "AAAbbbCC123",
ProjectId = "aabbcc",
};
});
var app = builder.Build();
app.MapPost("/notify", async (IRustorePushClient push, CancellationToken ct) =>
{
await push.SendAsync(
RustoreProvider.Rustore,
new[] { "device-token-1" },
new RustoreNotification("Title", "Body"),
ct);
return Results.Ok();
});
app.Run();
Multi-provider send
var tokens = new Dictionary<RustoreProvider, IReadOnlyCollection<string>>
{
[RustoreProvider.Rustore] = new[] { "rustore-token-1" },
[RustoreProvider.Fcm] = new[] { "fcm-token-1", "fcm-token-2" },
};
await push.SendAsync(
new[] { RustoreProvider.Rustore, RustoreProvider.Fcm },
tokens,
new RustoreMessage(
new RustoreNotification("Hi", "Hello from RuStore"),
Data: new Dictionary<string, string> { ["deep_link"] = "/orders/42" }));
Or use SendToAllAsync to take the provider set straight from the tokens dictionary:
await push.SendToAllAsync(tokens, new RustoreMessage(new RustoreNotification("Hi", "Hello")));
Custom credentials provider
If your secrets live in Vault / AWS Secrets Manager / a tenant database,
implement IRustoreCredentialsProvider:
public sealed class VaultCredentialsProvider : IRustoreCredentialsProvider
{
private readonly IVaultClient _vault;
public VaultCredentialsProvider(IVaultClient vault) => _vault = vault;
public async Task<RustoreProviderCredentials?> GetCredentialsAsync(
RustoreProvider provider, CancellationToken ct = default)
{
var secret = await _vault.ReadAsync($"push/{provider}", ct);
return secret is null
? null
: new RustoreProviderCredentials(secret.AuthToken, secret.ProjectId);
}
}
builder.Services
.AddRustorePush(_ => { })
.AddCredentialsProvider<VaultCredentialsProvider>();
The default OptionsRustoreCredentialsProvider reads from RustorePushOptions
via IOptionsMonitor, so changes to appsettings.json are picked up without
restart.
Low-level API
For full control over the request (e.g. multi-tenant with credentials computed
on the fly), use the overload that accepts RustoreUniversalPushRequest. In
this mode IRustoreCredentialsProvider is not consulted:
var request = new RustoreUniversalPushRequest(
new RustoreProviders(Rustore: new RustoreProviderAuth("AUTH", "PROJ")),
new RustoreTokens(Rustore: new[] { "token" }),
new RustoreMessage(new RustoreNotification("t", "b")));
await push.SendAsync(request);
Message models
| Type | Purpose |
|---|---|
RustoreNotification |
title, body, optional image. |
RustoreMessage.Data |
Arbitrary IReadOnlyDictionary<string, string>. |
RustoreAndroidConfig |
HMS-targeted ttl (seconds) plus Android notification overrides. |
RustoreAndroidNotification |
channel_id, sound, click_action, image, and so on. |
RustoreApnsConfig |
APNS aps block as IReadOnlyDictionary<string, object>. |
Error handling
| Exception | When |
|---|---|
RustoreValidationException |
Response body has status == "VALIDATION_ERROR". |
RustoreProviderException |
Response body has status == "PROVIDER_ERROR". |
RustoreInternalException |
status == "INTERNAL_ERROR", any 5xx, unrecognized response, or invalid JSON. |
RustoreMessageTooLargeException |
Serialized payload > 4096 bytes (client-side check). |
RustoreCredentialsNotFoundException |
IRustoreCredentialsProvider returned null. |
RustoreTransportException |
Network failure or RustorePushOptions.Timeout exceeded. |
All inherit from RustorePushException and carry HttpStatus, Status,
Code, Errors[], and RawResponse.
4 KB limit
The API rejects payloads larger than 4096 bytes. The client serializes JSON
and verifies the size before the network call — if the limit is exceeded,
RustoreMessageTooLargeException is thrown and no request is sent.
Retry
There is no built-in retry/backoff — wire
Microsoft.Extensions.Http.Resilience
or Polly into the named HttpClient registered by AddRustorePush.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 99 | 4/29/2026 |