Hello,
Any indication on the config file variables would be helpful.
Many thanks.
I have added documentation for push notifications:
Thanks a lot !
Any way to send single notifications to each account ? (by token or else ?)
Do you mean send it manually? What kind of notification?
For example, to send a mail notification to a user, we type its email address in the email address field. When an event occurs , a mail is sent to this user in his mailbox.
To send notifications using firebase, we need to specify the user token so we can send him the notification to his own device.
BTW, we have are using our own custom app to communicate with traccar.
Thanks again for your help.
App token is automatically register when you use Traccar Manager app.
What if we use a custom app ? Anyway to communicate the device token to traccar ?
It's stored in user attributes. Just check Traccar Manager and web app source code.
Is it possible to have push notifications on a my own custom application coming from my traccar server, using my own FCM server?
The mobile app stores the phone token in the user attributes (Check DB). You can make your custom app register tokens in the same field and have notifications sent to each user of you base. That's how we got it working.
If anyone has a better solutions please share :)
Thank you so much Belami and Anton for your help, that technique is working great for me! I'm using cordova-plugin-firebase and Traccar api to insert a new token into the user attributes when a new token is created, similarly to the Traccar Web App.
window.FirebasePlugin.onTokenRefresh(function(token) {
console.log("My new firebase token: " + token);
if(!user['attributes']['notificationTokens'] || user['attributes']['notificationTokens'].indexOf(token) < 0){
if(!user['attributes']['notificationTokens']){
UpdateAppToken(token);
} else {
let tokens = user['attribute']['notificationTokens'] += ',' + token;
UpdateAppToken(tokens);
}
}
}, function(error) {
console.error("New Firebase token error: " + error);
}
);
Hi
What can I do if I want to only update notificationTokens?
Currently, I manage from http://IP:PORT/api/users/id
.
In this API we must to share name, email.
Without using this there is any API which only update notificationTokens.
Check what official web app does. It uses same API.
Hello Anton, good afternoon, I would like to ask if there are any approximations for the publication of the documentation for the Push notifications?