{ "id": "zn_7c4a1f", "name": "Felixstowe · Yard 8", "type": "polygon", "polygon": [ { "lat": 51.95303, "lng": 1.3253 }, …5 ] }
evaluating
The geofence layer
One geofence layer.
Everywhere your product runs.
Give your app a list of zones, circles or polygons, and get an event when a phone or device enters or leaves one. The same zones run in your mobile app, on your own hardware and on your server.
- Flutter
- React Native
- Embedded C
- REST API
- CLI
MIT-licensed SDKs · Free during Early Access
What we keep
A crossing tells you which device, which zone, which way and when. Never the route in between.
Every event lands as one row. The location that triggered it is checked, then thrown away, unless you switch retention on.
Written to your account
device_id is a name you give the device. Our firmware builds one from the chip family and three bytes of a hardware ID. Either way we never ask who is holding it.
Evaluated, then dropped
Position retention is off by default. We see a device id. You see your customer.
What the cap limits
iOS gives your app twenty geofences. Not twenty per library. Twenty.
The operating system’s geofence budget is a wake-up service, not the detector. Polyfence hands it the nearest few and evaluates the rest itself, in your process, on every fix.
The default is the ceiling: there is no headroom to hand out. Which twenty is your problem, and it changes as the user moves.
These are registrations, not memory. Play Services drops every one of them on reboot.
Every zone, on every fix. Nothing was handed out, so nothing can be taken back.
What it costs to watch
With intelligent mode on Android, standing still is two minutes and moving near a zone is five seconds.
“Saves battery” is a promise you cannot check. The sampling interval is not. It is a table of constants in the shipped config, and it moves by 24× depending on what the phone thinks you are doing.
Until you ask for it, the strategy is continuous: a fix every ten seconds wherever you are and whatever you are doing. The intervals above are the library’s built-in values for intelligent mode. They apply on Android once intelligent mode is given its proximity, movement and battery settings; iOS trades accuracy and distance filter instead of a timer.
What it takes to start
From an empty file to your first event.
Flutter, React Native, embedded C, or REST. The shortest code that gets you a first event in each; platform setup is in each README.
import 'package:polyfence/polyfence.dart';
await Polyfence.instance.initialize();
await Polyfence.instance.requestPermissions();
await Polyfence.instance.addZone(Zone.circle(
id: 'depot-north',
name: 'Depot North',
center: PolyfenceLocation(latitude: 51.95724, longitude: 1.30962),
radius: 230,
));
Polyfence.instance.onZoneEnter.listen((event) {
print('Entered: ${event.zoneName}');
});
await Polyfence.instance.startTracking();
npm i -g polyfence-cli lists, creates and exports zones from a terminal. It manages your account rather than shipping inside your product, so it answers a different question than the four above.What it’s for
The verb never changes.
The thing moving is yours. The line is yours. What happens when they meet is the part we do.
A vancrossesa depot gateand dispatch knows.Fleet & delivery
A collarcrossesa paddock lineand the farm knows.Livestock & agriculture
A tagcrossesa fence lineand the site knows.Perimeter security
A carcrossesa low-emission zoneand the driver knows.Compliance zones
A shoppercrossesa shop doorwayand the shop knows.Retail, tourism & events
A kidcrossesthe school gateand a parent knows.Family & personal safety
six sentences · one verbone row in your event log, whichever line is yoursall six, and what each would take to build →
Prototyping on hardware? Reference boards for WiFi, USB, cellular and LoRa run the same engine. Browse reference boards →