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
httpClientHttpClientOptional HttpClient to use for all HTTP requests; a new instance is created if null.
steamLoginPortintThe 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
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
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
credentialsCredentialsCredentials obtained from AcquireCredentialsAsync(CancellationToken).
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
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
credentialsis missing the Expo push token.