Class RustPlusFcm
- Namespace
- RustPlusApi.Fcm
- Assembly
- RustPlusApi.Fcm.dll
Represents a RustPlus FCM listener, which processes FCM notifications for RustPlus. Inherits from RustPlusFcmSocket.
public class RustPlusFcm : RustPlusFcmSocket, IRustPlusFcm, IRustPlusFcmSocket, IDisposable, IAsyncDisposable
- Inheritance
-
RustPlusFcm
- Implements
- Inherited Members
Constructors
RustPlusFcm(Credentials, ICollection<string>?, RustPlusFcmSocketOptions?, ILoggerFactory?)
Represents a RustPlus FCM listener, which processes FCM notifications for RustPlus. Inherits from RustPlusFcmSocket.
public RustPlusFcm(Credentials credentials, ICollection<string>? persistentIds = null, RustPlusFcmSocketOptions? options = null, ILoggerFactory? loggerFactory = null)
Parameters
credentialsCredentialsThe Credentials used for authentication.
persistentIdsICollection<string>The collection of persistent IDs as ICollection<T> of string.
optionsRustPlusFcmSocketOptionsTuning options (heartbeat interval, inactivity timeout); defaults are used when null.
loggerFactoryILoggerFactoryRoutes the client's diagnostics into your logging stack; logging is disabled (a no-op
NullLogger) when null.
Methods
ParseNotification(FcmMessage)
Parses an incoming FcmMessage and dispatches events based on its channel.
protected override void ParseNotification(FcmMessage message)
Parameters
messageFcmMessageThe FcmMessage to parse.
Remarks
Invokes OnPairing, OnAlarmTriggered, and calls ParsePairing(Body) as appropriate.
Events
OnAlarmTriggered
Occurs when an alarm event is triggered.
public event EventHandler<AlarmEvent?>? OnAlarmTriggered
Event Type
Remarks
The event data is an AlarmEvent.
OnEntityPairing
Occurs when an entity pairing notification is received.
public event EventHandler<Notification<EntityEvent?>>? OnEntityPairing
Event Type
Remarks
The event data is a Notification<T> containing an EntityEvent.
OnPairing
Occurs when a pairing FcmMessage is received.
public event EventHandler<FcmMessage>? OnPairing
Event Type
OnServerPairing
Occurs when a server pairing notification is received.
public event EventHandler<Notification<ServerEvent?>>? OnServerPairing
Event Type
Remarks
The event data is a Notification<T> containing a ServerEvent.
OnSmartAlarmPairing
Occurs when a smart alarm pairing notification is received.
public event EventHandler<Notification<int?>>? OnSmartAlarmPairing
Event Type
Remarks
The event data is a Notification<T> containing an int entity ID.
OnSmartSwitchPairing
Occurs when a smart switch pairing notification is received.
public event EventHandler<Notification<int?>>? OnSmartSwitchPairing
Event Type
Remarks
The event data is a Notification<T> containing an int entity ID.
OnStorageMonitorPairing
Occurs when a storage monitor pairing notification is received.
public event EventHandler<Notification<int?>>? OnStorageMonitorPairing
Event Type
Remarks
The event data is a Notification<T> containing an int entity ID.