Trouble getting push notifications to work

Andrew Cumming3 years ago

I have logged in to the traccar.com web site and copied the Push notifications API key into my traccar.xml file with these 2 lines

<entry key='notificator.types'>web,traccar,mail</entry>
 <entry key='notificator.traccar.key'>*********************</entry>

mail works, web doesnt seem to (not too concerned about that) but traccar doesnt get push notifications to my iphone. The traccar server is on a linux docker container. Traccar is otherwise working.

I have tried removing and reinstalling the traccar manager and traccar client on the iphone but push notifications still dont work.

Any suggestions on what I'm doing wrong ?

Anton Tananaev3 years ago

Check user attributes to see if the device token was assigned.

Andrew Cumming3 years ago

Theres an attribute named notificationTokens with a 164 character string as the value in the users attributes. Is that correct ? should that attribute be the same as the traccar key (which is quite a bit shorter) ?

Anton Tananaev3 years ago

It should NOT be the same the key. That's a Firebase device token. Based on the information provided everything seems correct, so not sure why it's not working.

Andrew Cumming3 years ago

I finally got it working. I reinstalled a lot (pretty easy with docker) but I think the part that fixed it was terminating the traccar manager on iPhone and restarting it.

I was having a think on how the token was going to get the the iPhone and came to the conclusion it must poll the traccar server and ask for it but probably only during startup. As I dont think I had shut down the traccar manager after multiple server re-installs, I suspect it either hadnt picked up the token, or the token is also hashed against the server and had the wrong server matched to it.

Anyway, all good now. Working perfectly !

Thanks Anton for such a great program. Been using it for a few years now and it never misses a beat.