{ "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.
Same zones run on your mobile app, your IoT device, and your server. Define once. Evaluate anywhere.
- Flutter
- React Native
- Embedded C
- REST API
- CLI
Open hardware · MIT licensed core · 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. Nothing else is written — we check the location that triggered it, then throw it away, unless you switch retention on.
Written to your account
device_id is a name you give the device — our firmware uses a board slug and three bytes of the chip’s MAC. Either way we never learn 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
Nothing here polls on a timer. Still is two minutes. Driving 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. Every interval above is a default the library fills in.
What it takes to start
From an empty file to your first event.
Flutter, React Native, embedded C, or REST. Four complete programs — every line that runs, and no line that doesn’t.
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 →
Prefer to skip the code? Flash a reference board — WiFi, USB, cellular or LoRa. Browse reference boards →