Simple geofencing library for React Native. Supports currently only iOS.
$ yarn add https://github.com/santervo/react-native-geofences.git
Adding geofence:
import Geofences from "react-native-geofences";
Geofences.addGeofence({
id: "Helsinki",
latitude: 60.185745,
longitude: 24.936266,
radius: 150
});
Removing geofence:
Geofences.removeGeofence("Helsinki");
Listening to geofence events:
Geofences.onEnterRegion(id => console.log(`Enter region ${id}`));
Geofences.onExitRegion(id => console.log(`Exit region ${id}`));