Hello,
I’m facing an issue with geofencing events in my app. When the app is killed and not opened for 2–3 days, the geofencing event is not triggering when I re-enter the geofenced area. I’ve made sure that all necessary permissions (location, background refresh, etc.) are properly set in the app settings.
Has anyone else experienced this? Is there a solution or workaround to ensure that geofencing works as expected even after the app has been killed for several days?
Any help or insight would be greatly appreciated!
Thanks in advance!
Hi @DTS Engineer,
Thank you for your response.
First of all, we need to clarify two things. We tested the app in two scenarios: killing the app with no other apps in use and killing the app with heavy other app usage.
** Killing the app with no other apps in use on an iOS device:**
When we set the region and tested the app with no other apps in use (i.e., no other apps open), the geofencing enter and exit flow worked perfectly for 7 continuous days without any issues. It works as expected in this scenario.
** Killing the app with heavy other app usage on an iOS device:**
When we set the region and tested the app while using heavy apps (e.g., opening 15-20 apps), the geofencing enter and exit flow stopped working after 2-4 hours.
Based on our findings, we observed that when the app is killed and there is no other app usage, the geofencing events (enter and exit) are triggered, and we receive the data. However, when the app is killed and there is heavy app usage, no data is received from the geofencing enter/exit events.
It seems like when there is heavy app usage on an iOS device, the system may kill the app process to optimize battery life or performance. Is this behavior due to iOS killing the app to save resources, or should we handle this scenario with a background service?
Thank you in advance.