[Location Plugin] Execute an action when Geofence is triggered

[Location Plugin] Execute an action when Geofence is triggered

  
Forge Component
(11)
Published on 2016-12-15 by OutSystems R&D
11 votes
Published on 2016-12-15 by OutSystems R&D

In our app we created a Geofence with this Plugin. The Plugin creates a notification, this works properly, but we want to execute a action or call a webservice when the geofence is triggered instead of the notification (when the app itself is not running). Is this possible?

Hello, Mathias,

As far as I know, there is no way to do it with the Location plugin out-of-the-box. Actions would require the app to be open, since the generated JavaScript code is only runnable there.

Calling a web service, however, would be possible, but you would need to customize what happens when the Geofence is triggered, using iOS and Android code to call them. My suggestion is picking up an existing Geofences plugin (such as this one) and customize the notification trigger parts to directly invoke the desired web services. Here's an example for Android, from the plugin maintainers.

Please let us know if you have further questions!

Best regards,

Carlos Simões