Oscar Apeland
Oscar Apeland

Reputation: 6662

How does geofences behave when there are overlapping CLRegions

I can't seem to find any information on how Core Location handles overlapping geofences. In my particular case I was wondering if a smaller geofence would be registered over a bigger, overlapping region. Does someone know this?

Upvotes: 5

Views: 1338

Answers (1)

MSU_Bulldog
MSU_Bulldog

Reputation: 3519

Core Location will register when you enter a geofenced area whether you are currently in another area or not. Consider this example for a clear understanding.

If I set a geofence around the entire United States and a smaller geofence around the state of Florida.

When I Enter the United States it will register that I entered the United States geofence. When I enter Florida, it will register that I entered the Florida geofence, but I don't leave the United States geofence; I am now in both geofences. If I go to Georgia, it will register that I exited the Florida geofence, but I am still in the United States Geofence. If I exit Florida through the ocean and leave Florida and the United States, it will register that I have exited both the United States and Florida geofences.

So, no. Smaller geofences are not registered over a bigger overlapping region. They are both registered as if they know nothing about the other geofences that are being monitored.

Upvotes: 7

Related Questions