Push Notification API key changed. Updated traccar.xml, but Push Notification still not working.

C5roki 21 days ago

API key is completely unrelated. It did change, but both old and new are valid.

That is good to know for next time.

Sounds like the only issue was that you were using wrong user?

Mainly yes. But the 'notification tokens' for my user were messed up (by an update of the app?). Logging out and in of the Traccar Manager app fixed it.

Anton Tananaev 21 days ago

What do you mean by messed up?

mojiwunefela 21 days ago

Same problem here.

Push notifications had been working on my Traccar 4.15 server for the last 4 years, until they suddenly stopped working in 21/22 October 2026.

I noticed that my push notifications API key in traccar.org/my-account had changed, which had never happened before. I updated notificator.traccar.key in conf/traccar.xml and restarted the server. I then deleted notificationTokens from my user attributes, logged out and logged back in, and checked that a new notificationTokens value had been generated. Email and web popup notifications work, but I no longer receive push notifications.

To rule out the age of my version, I tested the push endpoint manually with both request formats: the one sent by 4.15, and the one sent by the current master (which adds "type":"manager" and "priority"). In both cases I used POST https://www.traccar.org/push/ with the header "Authorization: key=<key>".

Format used by 4.15:

curl -s -m 20 -w '\nHTTP %{http_code}\n' -X POST https://www.traccar.org/push/ \
  -H "Authorization: key=$KEY" -H 'Content-Type: application/json' \
  -d "{\"registration_ids\":[\"$TOK\"],\"notification\":{\"title\":\"test old\",\"body\":\"4.15 format\",\"sound\":\"default\"}}"

{"successCount":0,"failureCount":1,"responses":[{"success":false,"error":{"code":"messaging/registration-token-not-registered","message":"NotRegistered"}}]}
HTTP 200

Format used by current master:

curl -s -m 20 -w '\nHTTP %{http_code}\n' -X POST https://www.traccar.org/push/ \
  -H "Authorization: key=$KEY" -H 'Content-Type: application/json' \
  -d "{\"type\":\"manager\",\"registration_ids\":[\"$TOK\"],\"notification\":{\"title\":\"test new\",\"body\":\"master format\",\"sound\":\"default\"},\"priority\":true}"

{"successCount":0,"failureCount":1,"responses":[{"success":false,"error":{"code":"messaging/registration-token-not-registered","message":"NotRegistered"}}]}
HTTP 200

Both formats give exactly the same response, so upgrading Traccar would not change anything: the request is accepted (HTTP 200, no 401, so the API key is valid), but the freshly generated device token is rejected. This points to a problem on the traccar.org push service side, not to my configuration or to the age of my version.

Can anyone confirm, and can the Traccar team check the push service?

Anton Tananaev 20 days ago

The messaging/registration-token-not-registered error is coming directly from Firebase. I just tested same requests with my own token and everything worked as expected.

C5roki 20 days ago

What do you mean by messed up?
Messed up as in vanished from the user's attributes. Saw the same thing with another user (using another Traccar instance). After he logged out and in on the Traccar Manager app, the 'notification tokens' reappeared in his attributes. (He didn't confirm yet whether his app reports 'push notifications' again.)

C5roki 20 days ago

Follow up: the user confirms that his 'push notifications' work again after logging out and in of the Traccar Manager app.
Might be interesting to investigate why the 'notification tokens' disappeared, at least I know now what to look for if it should happen again.

Anton Tananaev 20 days ago

Server removes old tokens when they expire. It's possible that it's a corner case where new token wasn't registered yet. We are releasing an update to Traccar Manager to fix that corner case.

mojiwunefela 20 days ago

Thanks Anton. Some more data, all with the official Traccar Manager from the Play Store:

  • On demo.traccar.org the app registers a short 22-character value in notificationTokens. Sending it to https://www.traccar.org/push/ with my API key works and the notification arrives.
  • On my server (Traccar 4.15) the same app on the same phone registers a long FCM registration token (142 characters). That is the one rejected with "messaging/registration-token-not-registered". I got the same on a second phone with a clean install, after clearing the attribute and logging in again.
  • The API key is accepted (HTTP 200, never 401), and the 4.15 and master request formats give the same result.
  • In my database (4 users) all notificationTokens values on 4.15 are 142 or 163 characters, many with several tokens concatenated (4.15 never removes old ones). There is no 22-character value anywhere.

So it looks like the app registers a different kind of token depending on the server, and the push service only accepts the short one. How does the app decide which one to send, and is there a way to get the short one with a 4.15 web UI? Or is upgrading the server the only option?

mojiwunefela 20 days ago

Follow-up after reading the code. Both traccar-web and traccar got a "Support Firebase registration ids" commit on Oct 18, 2026, three days before my push notifications stopped:

  • traccar-web (NativeInterface.js): when the app passes a 22-character value, all non-22-character tokens are dropped from notificationTokens.
  • traccar: NotificatorFirebase now sends 22-character values as Firebase registration IDs (addFid) and everything else as classic tokens (addToken).
  • The 4.15 web UI (Application.js, updateNotificationToken) just appends whatever the app passes to the comma-separated list. It cannot produce or convert either kind, so the type is decided by the app.

So the Manager app seems to send the short ID to servers that support it and the classic FCM token to older ones, which is what I see on 4.15. Please note that your test with your own token most likely used a short ID, which works for me too. What fails is the classic long token that the app still registers for older servers (142 characters, freshly generated).

Could you test the push service with a long FCM registration token, not a short ID? If it is rejected, then 4.15 and other older servers lost push notifications on Oct 18-21, and I'd like to know whether that is intended.

mojiwunefela 20 days ago

Follow-up: I solved it without upgrading the server.

I patched the Traccar Web 4.15 UI so that it talks to the Manager app and handles notification tokens the same way the current master does. After that, the updated Manager app registers the new Firebase registration ID, and push notifications work again on my 4.15 server.

So the problem is not the API key. The current Manager app together with the new push service update no longer work with the old 4.x web UI as it is.

Anton Tananaev 20 days ago

Old tokens should still work, so it has nothing to do with the web logic.

mojiwunefela 20 days ago

Thanks, but my tests say otherwise.

  • On my 4.15 server, every token the Manager registered was a long FCM token (142/163 characters), including a freshly generated one on a second phone with a clean install. Every one of them gets messaging/registration-token-not-registered from /push/, with a valid key (HTTP 200, neverĀ 401).
  • The same up-to-date Manager app on the same phone, connected to demo.traccar.org, registers a 22-character Firebase registration ID, and that one works.
  • I changed only the web UI, so that it talks to the app the same way the current master does. I didn't touch the server, the key or the configuration. Right after that, the app started registering the 22-character ID and push notifications work again.

So in practice the web logic is exactly what decides which token the app registers.

I see that 3117f977a still sends non-22-character values through addToken, so on paper old tokens are supported. In practice Firebase rejects them, even one freshly generated by the current Manager connected to a 4.x server. Also, 28ec741e drops all long tokens as soon as a 22-character ID arrives, which suggests they're considered superseded.

If old tokens are supposed to keep working, then something is wrong on the push service or app side. Could you try a long token (142/163 characters) from the current app connected to a 4.x server, rather than a 22-character ID?

Just for reference.

With old long notificationstoken generated with official Traccar Manager before patching the server 4.15 web logic:

curl -s -m 20 -w '\nHTTP %{http_code}\n' -X POST https://www.traccar.org/push/ \
  -H "Authorization: key=$KEY" -H 'Content-Type: application/json' \
  -d "{\"registration_ids\":[\"$TOK\"],\"notification\":{\"title\":\"test old\",\"body\":\"4.15 format\",\"sound\":\"default\"}}"

{"successCount":0,"failureCount":1,"responses":[{"success":false,"error":{"code":"messaging/registration-token-not-registered","message":"NotRegistered"}}]}
HTTP 200

With new short notificationstoken generated with official Traccar Manager after patching the server 4.15 web logic:

curl -s -m 20 -w '\nHTTP %{http_code}\n' -X POST https://www.traccar.org/push/ \
  -H "Authorization: key=$KEY" -H 'Content-Type: application/json' \
  -d "{\"registration_ids\":[\"$TOK\"],\"notification\":{\"title\":\"test old\",\"body\":\"4.15 format\",\"sound\":\"default\"}}"

{"successCount":1,"failureCount":0,"responses":[{"success":true,"messageId":"projects/traccar-manager-app/messages/0:1792653045674501%5efg29695eeb2969"}]}
HTTP 200
Anton Tananaev 20 days ago

How do you get a long token with the current manager app?

mojiwunefela 19 days ago

It is enough to login with Traccar Manager 6.2.3 in a Traccar server 4.15, it will be generated a long token that is discarded by firebase.

Anton Tananaev 19 days ago

That doesn't make sense. Token is generated by the app and it should be a short one.