Jarbox using the Firebase console can not customize the click event in the notification. To do this you have to do the following:
You have to make a method in the firebaseService class that when you get the token, send it to a database on a dedicated server for that.
You have to create your own console, that is, make a small web app, where you have all the fields you want to send in your message eg title, content, etc.
Once you have your html, when you submit a button, you have to call a php file, in that file you have to put your WebKey that you get from the FireBase console. that file php will receive the data sent from the html form, it will connect to your database, it will get the tokens one by one, it will communicate with the FireBase servers and will send the data to each of the devices.
In your class FireBaseMessagingService
, you implement the method onMessageReceived
which receives a parameter of type RemoteMessage
. to know if everything went well enough with if(remoteMessage.getNotification()!=null)
if that is true you get the data as follows:
String titulo = remoteMessage.getNotification().getTitle();
String contenido= remoteMessage.getNotification().getBody();
In case you have some other type of data and it does not appear in getters , you get it that way
descuento = remoteMessage.getData().get("discount");
this is a summary explanation, I leave the link on how to do it. Good luck
FireBase, Android, php