Geofence support for other moving objects
Our usecase is that, a large number of users need to track the position of a moving bus. Those users will be notified if the bus has reached near the location marked by them.
In summary, there are three personas here:
- User (who is on mobile)
- geo fence (could be a different location than user)
- bus (whose location is fed into the context)
Scenarios:
- user is stationary and bus is moving
- user and bus are moving
We want to fire geo-fence (entry, exit) action when the bus hits the geo-fence set by the user rather than users current location. Could you please help on how we can go after the scenario? We understand when both user and bus are the same object, it can be easily handled.
Is there an app on the Bus that you have control over (eg: able to send a Push request)?
Yes, there is a device in the bus with the app that can trigger a push notification.
So send a "silent" push request (ie: JSON payload only) to the bus with JSON of the geofence to add:
Capture this push on the Bus and interact with the plugin to add the geofence with supplied data, eg:
{
"extra": {
"command": "addGeofence",
"params": {
"latitude": 23.2342323,
"longitude": 37.232323,
"radius": 200,
"identifier": "23dfasdf7qf987asd9f87asdfasd",
"notifyOnEntry": true
}
}
}
Or simply interrogate incoming locations from the bus at the server against geofences requested by the users (no need for device geofencing on the bus).
Is there an option to send the geo location of bus to users and match fencing ? The user geo fence at this moment can't be sent to server or to the bus driver (privacy issues and we have to work with our customer to see if this is an option at all)
As such, bus location can be broadcasted, but users location or geo-fences have to live in their own device.
Is there an option to send the geo location of bus to users and match fencin
It’s up to your server to send bus location to your own users.
Geofences are handled by the operating system, trigger by the location of the device monitoring them.
It is impossible to “simulate” a bus geofence on a user device.
You will have to perform geofencing on the server by analyzing incoming locations from bus, sending push requests to subscribed users.