Failing to implement firebase to android app

Ronalda year ago

Good day

I am failing to implement firebase to Traccar Manager (Android).
After adding google-services.json and building the app in Android Studio, i can see Notification Tokens being generated under the account attributes, however if i trigger a test notification (Firebase only) i am getting the following error

Cannot invoke "String.getBytes()" because the return value of "org.traccar.config.Config.getString(org.traccar.config.ConfigKey)" is null - NullPointerException (NotificatorFirebase:57 < <gener:-1 < *:-1 < ... < NotificatorManager:73 < ...)

I am assuming i'm using the wrong firebase key as i am attempting to use API V1 but i am not 100% sure.

I have tried to use the Legacy server key and getting the same effect.

I'd kindly appreciate any pointers as to what i may have done wrong.

Thanks

Anton Tananaeva year ago

You have to provide service account in the config (see notificator.firebase.serviceAccount parameter).

Ronalda year ago

Thank you Anton. It worked.

gmartineza year ago

Hi every one! Where I can see the notificatior.firebase.service Account? How I can provide service account? I am lost.. thanks for your support.

gmartineza year ago

Hi every one! Sorry for the last post, I have Two questions..

  1. Where I can see the notificatior.firebase.serviceAccount?
  2. How I can provide service account?

I am lost.. I see a notificatior.firebase.serviceAccount in root: src>main>java>org>traccar>config>keys.java but Wath i need to do? copy and pase all .json firebasefile in firebase section inside of keys.java?

Thanks for your support.

Anton Tananaeva year ago

Please don't duplicate your questions.

gmartineza year ago

Sorry, I was lost. Thanks Anton.

gmlmainoa year ago

is this new only, or also the old token?