1)Geofence是什么
According to wikipedia, Geofence(也称地理围栏), “A geo-fence is a virtual perimeter for a real-world geographic area.”
A geo-fence could be dynamically generated—as in a radius around a store or point location. Or a geo-fence can be a predefined set of boundaries, like school attendance zones or neighborhood boundaries. Custom-digitized geofences are also in use.
2) Geofence可以用来做什么呢?
Geofencing, used with child location services, can notify parents when a child leaves a designated area.
当小孩离开预设的范围时,可以触发某个事件,比如发短信或者邮件告警。
These geo-fences when crossed by an equipped vehicle or person can trigger a warning to the user or operator via SMS or Email.
3)如何实现
A)
一种方式是采用别个写好的sdk,比如location-labs的sdk,包括android和iOS版本:
http://geofence.locationlabs.com/code.html
B)
一种方式就是自己实现相应的功能。
iOS5已经内置对Geofencinig的支持,
比如调用 startMonitoringForRegion:desiredAccuracy:
method of your CLLocationManager
object.
android通过调用 LocationManager里面的 requestLocationUpdates 等函数。
自己实现,也不复杂。
4)参考资料
还有些Geolocation相关的API,参见: 5 Geolocation APIs You May Not Have Heard Of