Mendix geofencing application

Hi guys! I want to make a geofencing application in Mendix where a user gets a push notification when he enters a “danger zone”. And I was wondering what the best way would be to do this. I tough of making a “server API” where the client keeps pushing its geolocation and when it’s in between a specific zone it gets a certain push notification. Would this be the best way or does anyone have suggestions for doing this in Mendix. Thanks alot!
3 answers

I would look at integrating a React Native module that implements geofencing into your app. There are quite a few options out there. This one in particular piqued my interest as it is quite simple and likely exactly what you need:

You’ll also want notifications

Steps to implement:

  • First, you won’t be able to use the Make it Native app to test this functionality, You’ll have to build your app, so read up on the Native Builder
  • Add the react-native-boundary module to your native app project
  • In Studio Pro, create JavaScript actions for the Boundary.add and Boundary.remove, as well as event handlers for the enter and exit boundary events. On those events, you could send notifications. See the NativeMobileActions.DisplayNotification javascript action for example code there.



Does your client app only need to send it's location data when it's actually being used. and thus open on the screen Or also when it's running in the background?

With the latter there are also some third party solutions you can use. But from what i heard it's not always easy and drains the battery quickly.

Here's an earlier asked question with an answer where Traccar was used to monitor a user's location while the app was running in the background.


With these widgets: you should be able to get what you want. 
Based on your (geo)location (used from your mobile device) you should be able to find out if the user is entering and predefined ‘danger zone’. Once you have determined that you can use common Mendix logic to sent out a push notification to you user.

Getting the Geolocation is default functionality of Mendix 8