Then FCMPlugin has different functions to retrieve tokens for users, later use for target that users, that you can save where you want, and functions for upcoming notifications.
Finally you build and send a notification like this:
let headers = new Headers({ 'Authorization': 'key=YOUR_API_KEY', 'Content-Type': 'application/json' });
let options = new RequestOptions({ headers: headers });
let notification = {
"notification": {
"title": NOTIFICATION_TITLE,
"body": NOTIFICATION_BODY,
"click_action": "FCM_PLUGIN_ACTIVITY",
"sound": "default"
}, "data": {
//OPTIONAL PARAMS
},
"to": USER_TOKEN,
"priority": "high"
}
let url = 'https://fcm.googleapis.com/fcm/send';
this.http.post(url, notification, options)
Hope this will help you, i am not the best explaining things
I can not do it … I try to do the steps but it does not work … I can not finalize my application without notifications … I use the command to install FCM, after I connected my application android a firebase and I put a method … I’m not even what it serves I do not understand the system of notifications … It’s so difficult?
I tried, all that I put in place, the problem is to send a notification from the application, for example when a person puts a comment to another person it sends him a notification
Yeah in the method i use the player id ! Now i need too implement a new method who send a notifications, so i open a page i call the method on a click (for test) and i put the code from the documentation in node JS and that’s not work …