Konsola git

FirebaseAdmin.Messaging.FirebaseMessaging

This is the entry point to all server-side Firebase Cloud Messaging (FCM) operations.

Summary

You can get an instance of this class via FirebaseMessaging.DefaultInstance.

Inheritance

Inherits from: FirebaseAdmin.IFirebaseService

Properties

DefaultInstance
Gets the messaging instance associated with the default Firebase app.

Public static functions

GetMessaging(FirebaseApp app)
Returns the messaging instance for the specified app.

Public functions

SendAllAsync(IEnumerable< Message > messages)
async Task< BatchResponse >
Sends all the messages in the given list via Firebase Cloud Messaging.
SendAllAsync(IEnumerable< Message > messages, CancellationToken cancellationToken)
async Task< BatchResponse >
Sends all the messages in the given list via Firebase Cloud Messaging.
SendAllAsync(IEnumerable< Message > messages, bool dryRun)
async Task< BatchResponse >
Sends all the messages in the given list via Firebase Cloud Messaging.
SendAllAsync(IEnumerable< Message > messages, bool dryRun, CancellationToken cancellationToken)
async Task< BatchResponse >
Sends all the messages in the given list via Firebase Cloud Messaging.
SendAsync(Message message)
async Task< string >
Sends a message to the FCM service for delivery.
SendAsync(Message message, CancellationToken cancellationToken)
async Task< string >
Sends a message to the FCM service for delivery.
SendAsync(Message message, bool dryRun)
async Task< string >
Sends a message to the FCM service for delivery.
SendAsync(Message message, bool dryRun, CancellationToken cancellationToken)
async Task< string >
Sends a message to the FCM service for delivery.
SendMulticastAsync(MulticastMessage message)
async Task< BatchResponse >
Sends the given multicast message to all the FCM registration tokens specified in it.
SendMulticastAsync(MulticastMessage message, CancellationToken cancellationToken)
async Task< BatchResponse >
Sends the given multicast message to all the FCM registration tokens specified in it.
SendMulticastAsync(MulticastMessage message, bool dryRun)
async Task< BatchResponse >
Sends the given multicast message to all the FCM registration tokens specified in it.
SendMulticastAsync(MulticastMessage message, bool dryRun, CancellationToken cancellationToken)
async Task< BatchResponse >
Sends the given multicast message to all the FCM registration tokens specified in it.
SubscribeToTopicAsync(IReadOnlyList< string > registrationTokens, string topic)
async Task< TopicManagementResponse >
Subscribes a list of registration tokens to a topic.
UnsubscribeFromTopicAsync(IReadOnlyList< string > registrationTokens, string topic)
async Task< TopicManagementResponse >
Unsubscribes a list of registration tokens from a topic.

Properties

DefaultInstance

static FirebaseMessaging DefaultInstance

Gets the messaging instance associated with the default Firebase app.

This property is null if the default app doesn't yet exist.

Public static functions

GetMessaging

FirebaseMessaging GetMessaging(
  FirebaseApp app
)

Returns the messaging instance for the specified app.

Details
Exceptions
System.ArgumentNullException
If the app argument is null.
Parameters
app
An app instance.
Returns
The FirebaseMessaging instance associated with the specified app.

Public functions

SendAllAsync

async Task< BatchResponse > SendAllAsync(
  IEnumerable< Message > messages
)

Sends all the messages in the given list via Firebase Cloud Messaging.

Employs batching to send the entire list as a single RPC call. Compared to the SendAsync(Message) method, this is a significantly more efficient way to send multiple messages.

Details
Exceptions
FirebaseMessagingException
If an error occurs while sending the messages.
Parameters
messages
Up to 100 messages to send in the batch. Cannot be null.
Returns
A BatchResponse containing details of the batch operation's outcome.

SendAllAsync

async Task< BatchResponse > SendAllAsync(
  IEnumerable< Message > messages,
  CancellationToken cancellationToken
)

Sends all the messages in the given list via Firebase Cloud Messaging.

Employs batching to send the entire list as a single RPC call. Compared to the SendAsync(Message) method, this is a significantly more efficient way to send multiple messages.

Details
Exceptions
FirebaseMessagingException
If an error occurs while sending the messages.
Parameters
messages
Up to 100 messages to send in the batch. Cannot be null.
cancellationToken
A cancellation token to monitor the asynchronous operation.
Returns