There's logging for errors, so you can try changing the key to see if you get an error.
okay im trying that now!
I haven't tried it myself, so I'm not sure it will actually trigger an error in the code.
It did trigger an error and i saw it in the logs, that means it is sends push notifications using firebase.
However im not receiving the notifications in my custom IOS app, even though im able to send a receive push notifications from the firebase console to my custom app.
I am digging into why my custom app is not receiving notifications from traccar.
Have you checked user attributes? You have the Firebase token there?
i checked the user attributes and i see a field notificationTokens see image link below;
But i don't remember creating that attributes and the key in there does not even much the server notification key i got from firebase.
Can you elaborate more about that key , may be thats the cause.
It's a device token. It shouldn't match the server key. You need to make sure it's a valid token for your firebase account. Try sending notification with it manually.
i updated the user attributes notification token with the iOS app device token, and beautifully i got my first push notification from traccer.
i was wondering if there is an API to register the device token , i see a field in the create user endpoint named "token" , is that where i can update the notificationToken ?
You should use standard user endpoint to set notificationToken
attribute.
okay so you mean in the standard user endpoint , i can set notificationToken attribute as
attributes": {
notificationToken : "sometoken"
}
Yes, something like that. Note that the key is actually notificationTokens
not notificationToken
. Because each user can have multiple devices.
okay.
Does it also mean i can pass more than one token to the notificationTokens attribute , like the example below ?
attributes": {
notificationTokens : "sometoken1 ", "sometoken2"
}
Obviously it has to be a valid JSON. You can pass tokens separated by a space or a comma.
Are there any possible ways i can check if the traccar server is really sending me push notifications using the firebase key.
Ive specified in the config in the traccar.xml with the firebase server keys , and ive also set up firebase push on the iOS app.
config
is there any possible way i can verify if push notifications are been sent by watching the logs or anywhere?