Closed LudovicoRighi closed 3 months ago
Are you observing the plugin's own native logs? See Wiki Debugging and learn to use the method .emailLog
. Also see API docs Logger
.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
react-native -v
):// import {useProfile} from '../../../context/ProfileContext';
const Geolocator = () => { const [enabled, setEnabled] = React.useState(false); const [location, setLocation] = React.useState(''); const [lastGeofenceEvent, setLastGeofenceEvent] = React.useState('none');
useEffect(() => { const geofences = [ { identifier: 'MY OFFICE', radius: 450, latitude: 47.383156511956315, longitude: 8.528031749979121, notifyOnEntry: true, notifyOnExit: true, extras: { radius: 450, center: { latitude: 47.383156511956315, longitude: 8.528031749979121, }, }, }, // { // identifier: 'CENTRAL TRAM STATION', // radius: 200, // latitude: 47.37734323917535, // longitude: 8.543918305474431, // notifyOnEntry: true, // notifyOnExit: true, // extras: { // radius: 200, // center: { // latitude: 47.37734323917535, // longitude: 8.543918305474431, // }, // }, // }, ];
}, []);
/// 3. start / stop BackgroundGeolocation React.useEffect(() => { if (enabled) { BackgroundGeolocation.startGeofences().catch(err => console.log(err)); } else { BackgroundGeolocation.stop().catch(err => console.log(err)); setLocation(''); } }, [enabled]);
return (
); };
const styles = StyleSheet.create({ container: {flex: 1, marginLeft: 16}, });
export default Geolocator;