Geofence on Ionic 4 with Cordova or Capacitor not working

Hi friends!

Has anyone had any success implementing geofencing in Ionic 4 or Capacitor on Android? I have tried the three plugins below using Ionic 4 with Cordova and Android and then trying Ionic 4 with Capacitor.

It appears the one open-source Cordova Geofencing plugin does not work because of an outdated implementation.

For Capacitor the two plugins listed I can’t seem to get to work. The first has no additional code aside from the boilerplate echo method. The second, FancyGeo, will not work after registering in my and importing into my component.

The three plugins in question are:


Capacitor (no android code)

Have a great weekend!

please check the Troubleshooting Section

Wow thank you so much for adding those steps. Will give it a try this morning. Have a great day. :+1:

Did you manage to make it work for iOs?

Im having trouble in iOs. The xcode gives me 300+ errors for the geofence plugin.

You can see my ionic info below.

*In android the plugin works just fine

1 Like

@andreasapostolou0 I am having the same issue.

It seems that the Geofencing feature is currently unusable?

Does anyone have a workaround?

One workaround might be to use geolocation.watchPosition and then calculate the distance between the location you want to geofence and where the user is currently, and trigger a callback when the boundary is crossed. Of course, that’ll only work if the app is running…