Table of Contents

Class FcmRegistration

Namespace
RustPlusApi.Fcm.Registration
Assembly
RustPlusApi.Fcm.Registration.dll

Orchestrates the native credential acquisition flow, replacing the Node CLI.

public sealed class FcmRegistration
Inheritance
FcmRegistration
Inherited Members

Remarks

Every network step hits live Google / Expo / Facepunch services and is upstream-fragile; it cannot be validated offline. See RegistrationConstants.

Constructors

FcmRegistration(HttpClient?, int)

Orchestrates the native credential acquisition flow, replacing the Node CLI.

public FcmRegistration(HttpClient? httpClient = null, int steamLoginPort = 3000)

Parameters

httpClient HttpClient

Optional HttpClient to use for all HTTP requests; a new instance is created if null.

steamLoginPort int

The loopback port the Steam login callback listener binds to.

Remarks

Every network step hits live Google / Expo / Facepunch services and is upstream-fragile; it cannot be validated offline. See RegistrationConstants.

Methods

AcquireCredentialsAsync(CancellationToken)

Steps 1–4: GCM check-in, Firebase install, FCM register and Expo token. Returns the Credentials the FCM listener needs (GCM identity + FCM + Expo tokens).

public Task<Credentials> AcquireCredentialsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<Credentials>

RegisterWithRustPlusAsync(Credentials, Action<string>?, CancellationToken)

Steps 5–6: interactive Steam login, then register the device's Expo token with Rust Companion so it receives pairing pushes. Returns the captured Steam identity.

[ExcludeFromCodeCoverage]
public Task<SteamLoginResult> RegisterWithRustPlusAsync(Credentials credentials, Action<string>? onLoginUrl = null, CancellationToken cancellationToken = default)

Parameters

credentials Credentials

Credentials obtained from AcquireCredentialsAsync(CancellationToken).

onLoginUrl Action<string>

Invoked with the Steam login URL before the browser is opened, so callers can print it — the flow still completes on a headless host if the user opens it by hand.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<SteamLoginResult>

Remarks

Excluded from coverage: post-guard flow drives live Steam login and Companion registration; the guard (missing ExpoPushToken) is unit-tested, the remainder is only validatable by a real run against the live endpoints.

Exceptions

InvalidOperationException

Thrown when credentials is missing the Expo push token.