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
|
static FirebaseMessaging
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 |
|
||
Parameters |
|
||
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 |
|
||
Parameters |
|
||
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 |
|
||||
Parameters |
|
||||
Returns |
A BatchResponse containing details of the batch operation's outcome.
|
SendAllAsync
async Task< BatchResponse > SendAllAsync( IEnumerable< Message > messages, bool dryRun )
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 |
|
||||
Parameters |
|
||||
Returns |
A BatchResponse containing details of the batch operation's outcome.
|
SendAllAsync
async Task< BatchResponse > SendAllAsync( IEnumerable< Message > messages, bool dryRun, 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 |
|
||||||
Parameters |
|
||||||
Returns |
A BatchResponse containing details of the batch operation's outcome.
|
SendAsync
async Task< string > SendAsync( Message message )
Sends a message to the FCM service for delivery.
The message gets validated both by the Admin SDK, and the remote FCM service. A successful return value indicates that the message has been successfully sent to FCM, where it has been accepted by the FCM service.
De |
---|