What is a geofence?
A geofence is a virtual fence or a perimeter around a physical location. Geofencing is a tool to connect the virtual experience with the offline world’s physical location. When an object enters this area, something happens. Easy way to think about it a fence around your home. When someone enters your yard, the burglar alarm is activated. What should happen in such circumstance? You probably want to send an alarm to the security company? Send an SMS to you? Start the burglar alarm?
Typically the geofencing use cases are not that brutal. Geofencing is a term that can be used in many different contexts, but the most popular one is the ability to detect a phone entering the area, and triggering something either in the device itself – or somewhere externally. For example, when you walk past your favourite grocery store, you get a discount coupon. This mobile-based geofencing is also the use case this blog post is focusing on. Geofencing does not require you to build anything physical in the real world – it all happens digitally. In essence you draw an area on top of map and define in your code what you want to happen, when someone walks into that area. That being said, in some cases you might want to add some hardware in the real world to improve the positioning accuracy, but more of that later on in the post.