Firebase push configuration model - Help

smsoousa2 years ago

Hello, everyone! Can anyone share their usage setting for push notifications through firebase? The new documentation of the modern version 5.3 does not help much. I don't know where to get the information i need. Really, do not know why it was changed, it was much simpler in previous versions configure : (

Anton Tananaev2 years ago

It was changed because Google deprecated the old API keys, so you can't generate them anymore for new Firebase projects. Basically they are forcing people to migrate to the new APIs. Eventually they will completely remove it.

To generate a private key file for your Firebase service account:

  1. In the Firebase console, open Settings > Service Accounts.
  2. Click Generate New Private Key, then confirm by clicking Generate Key.
  3. Copy the JSON file containing the key into your Traccar config.
smsoousa2 years ago

Thank you, that was the explanation I needed. I did as directed, however, I still do not receive the notification. I went into account, and already generated the notification token for me. If you can see if anything's missing, I'd appreciate it.

<entry key='notificator.types'>web,mail,firebase,telegram</entry>
<entry key='notificator.firebase.serviceAccount'>
  {
  "type": "service_account",
  "project_id": "my_project",
  "private_key_id": "........",
  "private_key": "-----BEGIN PRIVATE KEY-----\-------------=\n-----END PRIVATE KEY-----\n",
  "client_email": "--------",
  "client_id": "----------",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "-----"
}
</entry>
<entry key='notificator.telegram.key'>-------</entry>
<entry key='notificator.telegram.chatId'>----</entry>  
<entry key='web.sanitize'>false</entry>
<entry key='filter.skipAttributes.enable'>true</entry>
<entry key='filter.skipAttributes'>ignition,alarm,status,result,event</entry>
<entry key='event.motion.speedThreshold'>0.45</entry>
<entry key='filter.distance'>1</entry>
Anton Tananaev2 years ago

Everything looks correct.

smsoousa2 years ago

I'm analyzing what it might be. I can receive the push when I request the test message from the notifications menu, but the notification itself is not enough for me normally when generated.

Anton Tananaev2 years ago

notification itself is not enough for me

What do you mean by this?

smsoousa2 years ago

Forgive my English. Ya say that the message does not reach me when the notification is generated. It only appears when I do it manually in the notifications menu.

Anton Tananaev2 years ago

If test works, it means that Firebase configuration is correct, so there must be some other unrelated issue with not receiving event notifications. You should probably take a bit more time, do thorough testing and come back with details if you still can't figure it out.

smsoousa2 years ago

Perfect. Thank you very much for your attention until then, I will investigate further.

M Kareem2 years ago

Hello Anton and Smasoousa,

I hope both of you are well.

I have the same exact issue with the push notifications Manager App Android version.

When I test the notification manually from the Notifiacts tab it works perfectly for both the web and firebase. But the event notifications that are being generated automatically only work for the web and don't work for firebase.

Can you please help me?

Regards,

Anton Tananaev2 years ago

Have you checked logs for errors?

Marco Paul Timbi2 years ago

Hi, when try to test firebase notification I have this error.

com.google.gson.stream.JsonReader - ClassNotFoundException (... < NotificatorFirebase:60 < <gener:-1 < *:-1 < ... < NotificatorManager:73 < ...)
Anton Tananaev2 years ago

Are you sure you downloaded the official release?

Marco Paul Timbi2 years ago

Hello Yes I download from git the lasted released

Anton Tananaev2 years ago

The latest code or the latest official release?