Push Notification issue.

khushbugarg2 years ago

I have tested push notification on traccar manager app and i was successfully receiving all the notifications but my main aim is to receive those notifications on my another app. So for that i changed the notificationtokens value to that of my app as suggested in one of the forum's topic but i am not receiving any notification there. What is going wrong? pls suggest.

Anton Tananaev2 years ago

Where did you get the token from? It should be set automatically and you shouldn't really change it manually.

khushbugarg2 years ago

that token is for my app to which i want to send notifications. Ok I get that but then how I am supposed to get the notifications onto my app?

Anton Tananaev2 years ago

You have to configure Firebase key in the server config and your app has to set device token in the user attributes. Check how official app works.

khushbugarg2 years ago

But how will my app will be able to do that, I mean access and set user attributes?

Anton Tananaev2 years ago

Through the API. The same way the official app does. And that's why I recommend you to look at it first before asking for more help.

khushbugarg2 years ago

Thank you Anton. Push notification is working flawlessly. There's one more thing i wanted to ask that whether it is possible to send notification of different devices to different users keeping all those devices under one account. user1 gets notification of only device1 and so on and keeping the user(on traccar like: admin admin) same.

Anton Tananaev2 years ago

Not sure if I understand it correctly, but why not?

khushbugarg2 years ago

Thanks for the quick reply. i have a user admin on traccar and I have multiple devices added on this account, I want to send notification of device1 onto mobile1 and for device2 onto mobile2. Since I am proving only one token in attributes, I am receiving notifications of the all devices simultaneously on mobile1. So how can I send notification of a particular device onto a particular mobile?

Anton Tananaev2 years ago

You need to create separate user accounts and each one will have their own device.

khushbugarg2 years ago

Thank you Anton