How do you determine when to send push notification?
If you use event forwarding, it is already implemented and will be available in next release. The list of users (who to notify) is forwarded with every event.
I only want to notify when geofence events occur. Is event forwarding made for geofence? Can you tell me where event forwarding is implemented? It may be help my problem.
Event forwarding works for all events. You can filter what you want.
Did you get my point what I want to do?
I think so. You want to send pushes about enter/exit a geofence only to users who have access (link) to the geofence. It is how traccar works out of the box (with other transports: email/sms)
You can start digging from here https://github.com/traccar/traccar/blob/master/src/org/traccar/database/NotificationManager.java#L114
Okay, thanks.
Suppose there are three users say A,B,C. And there is one device which is linked with these three users say D. And these three users have their own geofences. So when device is enter anyone of the geofences of the users, then push notification will be send to only that user's token what he/she has the geofence.
If device enter user A geofence then who are logged in with user A account, the push notifications will be received on the A's screen devices.
That's exactly I want.
Want to note that geofences also must be linked to the device D. Actually everything is described in documentation.
And you can test yourself how it works with emails for example.
Yes the device is linked with all the geofences too.
Okay, thank you.
I am getting this Query not provided: database.selectTopPositions. And I have put the query in the default.xml file too.
Sumit, are you using event forwarder? and the URL that event forwarder is pointed which language/platform is it written in.
If its PHP I have some working samples.
I want to send push notification users' mobile devices. I made firebase table to store firebase_token and userId (e.g. firebase_token). And I linked the userId with the geofenceId in a separate table (let's say user_geofence).
When geofenceEnter or geofenceExit event occurs, I want to send only those firebase tokens which are linked with the user's created geofence.
I am not getting in the code where I have to put the code.
I have tested it out by sending manually geofenceId and match the geofenceId in user_geofence table to get the user and finally I got firebaseTokens in the firebase_token table by matching the userId.