Beacons have been all the buzz around Radius Networks, but sometimes they are not quite the right tool for the job. Sometimes, the problem at hand is better solved with good old geofences. The problem is geofences don’t always work how you’d initially expect. So we did some testing.
Below is a map around Radius Networks HQ. The circle is a 60 meter radius geofence around our building. The blue pins are where the phone was triggered.
This just shows a small sample of the tests we ran. Personally, I preferred the ones conducted around our favorite taco joint.
The test was configured using two iPhones (5s and 6) with two apps monitoring location.
We ran about 100 test triggers with this configuration. Out of those both apps triggered nearly every time within 30 seconds.
|Both Apps||Reminders Only||Campaign Kit Only|
Not bad. We are still not sure why the minor discrepancies occurred, but they happened infrequently enough that it was very difficult to figure out why. In the end, we were satisfied with the consistency of the behavior we were seeing
The best performance and accuracy can be had by using
kCLLocationAccuracyBestForNavigation, however Apple is likely to reject the app unless includes functionality that requires that mode. Most geofence use-cases don’t fall under that.
Wi-Fi makes a big difference. Disabling Wi-Fi means the phone falls back to using cell towers to detect major location changes. The problem is a typical phone has enough power to reach a cell tower up to 45 miles (72 kilometers) away. That means there is a pretty good chance for your phone to connect to a distant tower giving a false-positive.
This is reinforced by Apple’s Documentation:
The specific threshold distances are determined by the hardware and the location technologies that are currently available. For example, if Wi-Fi is disabled, region monitoring is significantly less accurate. However, for testing purposes, you can assume that the minimum distance is approximately 200 meters.
Our testing was done with a 60 meter radius, and, honestly, this was probably too small. Geofencing should be used for fairly large areas, normally about 200 meters. Anything less and you are unlikely to get a trigger.
Our test was based on comparing the Apple Reminders.app with Campaign Kit, so we copied the default settings that Reminders uses for geofences. By default, the Reminders app generates a 60 meter radius. This is at odds with their documentation, but we wanted to be consistent with their app behavior.
This test was explicitly run with the app in the background and the phone locked with a dark screen. But as we’ve discovered through many fumbled tests if you wake up the phone it will respond much faster. We believe that the operating system uses this as an opportunity to scan for Wi-Fi and cell towers. Taking advantage of that information will trigger any apps that happen to be monitoring.
There are some unexpected conclusions discovered in this testing. But it appears that most of the caveats are there to help the all-important battery life of the phone.