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 OAuth 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, 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 auth token.

[ExcludeFromCodeCoverage]
public Task<string> RegisterWithRustPlusAsync(Credentials credentials, CancellationToken cancellationToken = default)

Parameters

credentials Credentials

Credentials obtained from AcquireCredentialsAsync(CancellationToken).

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<string>

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.