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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="rustore.push.maui.server" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="rustore.push.maui.server" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="rustore.push.maui.server" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add rustore.push.maui.server --version 1.0.0
                    
#r "nuget: rustore.push.maui.server, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package rustore.push.maui.server@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=rustore.push.maui.server&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=rustore.push.maui.server&version=1.0.0
                    
Install as a Cake Tool

Rustore.Push.Server

Russian version

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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