Geofencing Event Not Triggering When App is Killed and Not Opened After 2-3 Days

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!

Answered by Android22 in 826676022

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.

Thanks for the post and apologies for the delay. Do you have a simple focused app that shows the issue when creating a simple region and then entering the device into the region, you do not get called in the delegate?

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Albert Pascual
  Worldwide Developer Relations.

Accepted Answer

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.

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.

Geofencing Event Not Triggering When App is Killed and Not Opened After 2-3 Days
 
 
Q