GeofencePlugin icon indicating copy to clipboard operation
GeofencePlugin copied to clipboard

Would CrossGeofenceListener (IGeofenceListener) callbacks work on iOS if app is killed

Open asehgal123 opened this issue 6 years ago • 1 comments

I am using this plugin for Android and it working well except for the System.InvalidCastException: Specified cast is not valid. bug which someone provided the workaround for. My question is for iOS. If app is killed and a georegion is entered/exited would CrossGeofenceListener callbacks still be called?

asehgal123 avatar Nov 29 '18 02:11 asehgal123

Yes, they do. In iOS, the geofencing API uses StartMonitoringSignificantLocationChanges which relaunches the app into the background if a new event arrives, IE a geofence event occurs. This is when the app is killed from memory too. You can read this. In Android, the provided service runs the geofencing triggers when the app is closed as well. In my testing, android 8 and above you have to use StartForgroundService instead of StartService, or else you'll get an exception due to google limiting starting services in the background.

patkozlowski avatar Jan 24 '19 22:01 patkozlowski