After I tested the push notifications are working with Postman I'd like to send a push request to FCM when I am sending a message in my app. The function called is going to my Java server and call a function like :
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response sendMsg(Message m) throws ExceptionFacade {
...
}
So each time I call this function I'd like to send a POST request to https://fcm.googleapis.com/fcm/send with a json.
I want to know if there is already a code ready for a java server ? and also some help how to implement it.
Also I don't understand if I can use a php file to do it (I find things like this https://github.com/Paragraph1/php-fcm ). I am using angularjs.
Thank you guys !
Here is the final code working well ! It is sending a json like this :
//Don't forget to add common-codec and common-login jar for build success.