Scrungepipes
Scrungepipes

Reputation: 37580

What is the maximum number of regions that can be monitored with startMonitoringForRegion:region desiredAccuracy:accuracy?

The documentation says there's a limit to the number of regions that can be monitored with-

(void)startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy

but I couldn't find what that limit is, does anybody know?

Upvotes: 12

Views: 5172

Answers (6)

Shaik Riyaz
Shaik Riyaz

Reputation: 11462

it is clearly mentioned in the documentation that maximum regions are 20 .

Link

Upvotes: 3

Leon
Leon

Reputation: 3746

As of iOS 9.2.1 there has been no change to the limit of 20 regions. It may be worth pointing out that the first 20 are stored and not overwritten. If an attempt is made to add more, these are simply ignored.

Upvotes: 1

ingconti
ingconti

Reputation: 11656

only for info:

  • startMonitoringForRegion:desiredAccuracy: is DEPRECATED.

no such API in swift.

Upvotes: 0

user3111343
user3111343

Reputation:

I think the allowed region is 10 to 20.

Upvotes: 1

Oriol Blanc
Oriol Blanc

Reputation: 151

I've been testing and have reached the same conclusion. For some reason the maximum is 20 monitored regions.

Upvotes: 3

Bill Burgess
Bill Burgess

Reputation: 14164

I have explored this a few times, and Apple intentionally doesn't say. All regions for the device go into one giant pool of monitored regions. So any regions you add have to be shared with other applications. I think the most I've heard successfully monitored is 20. But it is not an exact science. The OS will purge out any old regions if some other app needs to add newer regions. And likewise, your app could push out regions for other apps too.

It would be nice to have some better defined documentation on this for sure. If you download the console app, and add a bunch of regions from your app and say Notifications, there is a display log that will show you region count that runs on a pretty frequent basis. Remove a region, and you can see the count drop. Might come in helpful if you want to test out how many regions you can safely add. Good luck.

Upvotes: 7

Related Questions