| java.lang.Object | |
| ↳ | com.google.firebase.messaging.FirebaseMessaging |
This class is the entry point for all server-side Firebase Cloud Messaging actions.
You can get an instance of FirebaseMessaging via getInstance(FirebaseApp), and
then use it to send messages or manage FCM topic subscriptions.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static FirebaseMessaging |
getInstance()
Gets the
FirebaseMessaging instance for the default FirebaseApp. | ||||||||||
| synchronized static FirebaseMessaging |
getInstance(FirebaseApp app)
Gets the
FirebaseMessaging instance for the specified FirebaseApp. | ||||||||||
| String |
send(Message message, boolean dryRun)
Sends the given
Message via Firebase Cloud Messaging. | ||||||||||
| String |
send(Message message)
Sends the given
Message via Firebase Cloud Messaging. | ||||||||||
| ApiFuture<String> |
sendAsync(Message message, boolean dryRun)
Similar to
send(Message, boolean) but performs the operation asynchronously. | ||||||||||
| ApiFuture<String> |
sendAsync(Message message)
Similar to
send(Message) but performs the operation asynchronously. | ||||||||||
| TopicManagementResponse |
subscribeToTopic(List<String> registrationTokens, String topic)
Subscribes a list of registration tokens to a topic.
| ||||||||||
| ApiFuture<TopicManagementResponse> |
subscribeToTopicAsync(List<String> registrationTokens, String topic)
Similar to
subscribeToTopic(List, String) but performs the operation asynchronously. | ||||||||||
| TopicManagementResponse |
unsubscribeFromTopic(List<String> registrationTokens, String topic)
Unubscribes a list of registration tokens from a topic.
| ||||||||||
| ApiFuture<TopicManagementResponse> |
unsubscribeFromTopicAsync(List<String> registrationTokens, String topic)
Similar to
unsubscribeFromTopic(List, String) but performs the operation
asynchronously. | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Gets the FirebaseMessaging instance for the default FirebaseApp.
FirebaseMessaging instance for the default FirebaseApp.
Gets the FirebaseMessaging instance for the specified FirebaseApp.
FirebaseMessaging instance for the specified FirebaseApp.
Sends the given Message via Firebase Cloud Messaging.
If the dryRun option is set to true, the message will not be actually sent. Instead
FCM performs all the necessary validations, and emulates the send operation.
| message | A non-null Message to be sent. |
|---|---|
| dryRun | a boolean indicating whether to perform a dry run (validation only) of the send. |
| FirebaseMessagingException |
|---|
Sends the given Message via Firebase Cloud Messaging.
| message | A non-null Message to be sent. |
|---|
| FirebaseMessagingException |
|---|
Similar to send(Message, boolean) but performs the operation asynchronously.
| message | A non-null Message to be sent. |
|---|---|
| dryRun | a boolean indicating whether to perform a dry run (validation only) of the send. |
ApiFuture that will complete with a message ID string when the message
has been sent, or when the emulation has finished.
Similar to send(Message) but performs the operation asynchronously.
| message | A non-null Message to be sent. |
|---|
ApiFuture that will complete with a message ID string when the message
has been sent.
Subscribes a list of registration tokens to a topic.
| registrationTokens | A non-null, non-empty list of device registration tokens, with at most 1000 entries. |
|---|---|
| topic | Name of the topic to subscribe to. May contain the /topics/ prefix. |
| FirebaseMessagingException |
|---|
Similar to subscribeToTopic(List, String) but performs the operation asynchronously.
| registrationTokens | A non-null, non-empty list of device registration tokens, with at most 1000 entries. |
|---|---|
| topic | Name of the topic to subscribe to. May contain the /topics/ prefix. |
ApiFuture that will complete with a TopicManagementResponse.
Unubscribes a list of registration tokens from a topic.
| registrationTokens | A non-null, non-empty list of device registration tokens, with at most 1000 entries. |
|---|---|
| topic | Name of the topic to unsubscribe from. May contain the /topics/ prefix. |
| FirebaseMessagingException |
|---|
Similar to unsubscribeFromTopic(List, String) but performs the operation
asynchronously.
| registrationTokens | A non-null, non-empty list of device registration tokens, with at most 1000 entries. |
|---|---|
| topic | Name of the topic to unsubscribe from. May contain the /topics/ prefix. |
ApiFuture that will complete with a TopicManagementResponse.