@Component public class PuiFcmClient extends Object
Access to this website configure the firebase project
This other website contains an example about configuring a new project with Spring and Firebase
| Modifier and Type | Method and Description |
|---|---|
void |
sendToTokens(List<String> tokens,
String title,
String body,
Map<String,String> data)
Send a message to the given tokens with the given title, body and data.
|
void |
sendToTopic(String topic,
String title,
String body,
Map<String,String> data)
Send a message to a topic with the given given title, body and data.
|
void |
sendToUser(String user,
String title,
String body,
Map<String,String> data)
Send a message to the given user with the given title, body and data.
|
void |
subscribeUserToTopic(String usr,
String token,
String topic)
Subscribe the user to the given topic
|
void |
unsubscribeUserFromTopic(String usr,
String token,
String topic)
Unsubscribe the user from the given topic
|
public void subscribeUserToTopic(String usr, String token, String topic)
usr - The user to be subscribedtoken - The token to be subscribed (if null, subscribe user to all its
registered tokens)topic - The topic to be subscribedpublic void unsubscribeUserFromTopic(String usr, String token, String topic)
usr - The user to be unsubscribetoken - The token to be unsubscribe (if null, unsubscribe user from all
its registered tokens)topic - The topic to be unsubscribepublic void sendToTopic(String topic, String title, String body, Map<String,String> data)
topic - The topic to send the messagetitle - The title of the notificationbody - The bodyof the notificationdata - the data to be sentpublic void sendToUser(String user, String title, String body, Map<String,String> data)
user - The list of tokens to send the messagetitle - The title of the notificationbody - The bodyof the notificationdata - the data to be sentpublic void sendToTokens(List<String> tokens, String title, String body, Map<String,String> data)
tokens - The list of tokens to send the messagetitle - The title of the notificationbody - The bodyof the notificationdata - the data to be sentCopyright © 2021. All rights reserved.