I am currently trying to get my app to monitor particular regions using CoreLocation
however I am finding that it does not seem to work as expected, it seems to
I like the answers by both Michael and Nevan. I would like to add more information from my personal experience/opinion in developing Location Based iOS Application with Region Monitoring and also highlight some important points:-
Be realistic on Region Monitoring
Region Monitoring is using Global Positioning System (GPS), Wifi and other technologies to determine if the device is inside or outside the monitored region. Don't forget that our earth is 510 square kilometers and about 30% are land (149 million km2). It is a huge area. Remember the recent MH370 missing case? Our current most advance technology could not even pinpoint an estimated region of that missing plane.
If you want to monitor for a small region with only 10 meter radius. It could possibly work inside a highly dense city with a lot of cell towers and wifi connected areas. But at the same time, the signal might be blocked by high rise towers which might cause the signal loss for a few seconds/minutes which caused the delay in delivering the notification.
So, you really have to consider the above information before deciding how big is the region that you want to monitor. Personally I think 10 meter radius is too small.
Be Realistic on the Number of Monitored Regions
The current Core Location technology can only monitors up to maximum 20 regions on a single app. Make sure that the monitored regions are not too close to each other as well.
I personally have tested 3 regions that are about 100 meters in radius which are about 200 meters aways from each others. Sometimes I can get notifications from all these 3 regions when I am driving through them, but sometimes, I can only get the notification from the First region only. What could be the reason? I could not know. The regions might be too close to each other. Or the cell towers decide that my device does not actually inside the monitored region.
There was one person on StackOverFlow who wants to monitor 1800 points on our Earth. Don't be like him as he is quite unrealistic and probably does not understand the limitation of current Core Location
technology. Link: Check if the user location is near of some points
Fine Tune The LocationManager
If your app needs to monitor a small area or needs the location update frequently. Here are the potential properties of your location Manager.
self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
self.locationManager.distanceFilter = kCLDistanceFilterNone;
self.locationManager.activityType = CLActivityTypeAutomotiveNavigation;
kCLLocationAccuracyBestForNavigation
will consume more battery compare with kCLLocationAccuracyBest
. But, it will be more accurate.
I found a glitch in region monitoring in iOS 7 when there are multiple notifications triggered at the same time in different monitored regions. I have found a solution to filter out this glitch. For more info, please visit: Region Monitoring Glitch on iOS 7 - Multiple Notifications at the same time
Don't Be Over Ambitious
You might have used some apps which can monitor a small region and are very accurate and able to notify your the same second you step into the region. And you have the inspiration to develop the exact same app to compete with them. But do you understand what happens behind scene? What additional technologies that they are using? And what partners that they are collaborating with?
I have done some research on that and found out that some of the technologies that they use are not available publicly. Some of those companies are heavily funded and could pay a premium to the telecommunication companies in order to get the best location accuracy for the best user experience. I do not understand the details on how it works. I believe most of the location determination is actually on the server end (back end), not the mobile (front end).
So, the apps that are developed by those companies not only can pinpoint the best accurate location but also does not consume a lot of battery.
NOTE: I just want to share my 2 cents. The above information consists of my experience and personal opinion. It might not be 100% accurate as I am still learning Core Location and Region Monitoring.
Sounds like even 1 meter should work (and work better on iPhone 4S+ devices):
startMonitoringForRegion:
(...)
In iOS 6, regions with a radius between 1 and 400 meters work better on iPhone 4S or later devices. (In iOS 5, regions with a radius between 1 and 150 meters work better on iPhone 4S and later devices.) On these devices, an app can expect to receive the appropriate region entered or region exited notification within 3 to 5 minutes on average, if not sooner.
I do agree with Michael G. Emmons, and want to share my experience too:
I tested my code with three regions as shown in the image below:
Explaining the behaviour:
Expected Behaviour: - Enter/Exit event should be triggered only when i am crossing the boundary of regions, or inside the regions, not before 500 meter from the region.
My Assumption:
So i think that all the regions inside 5000 meters are being detected, and as user moves away 10 km from detected region, its Exit event will be fired. otherwise if user is inside the 5Km range, it will never call it Enter/Exit events again.
Please update me on, if anyone has fixed this issue, or Apple documents anywhere about this issue.