Expo Location: Geofencing Exit event is triggered on app startup/reload

  1. SDK Version: 42.0.1
  2. Platforms(Android/iOS/web/all): Android Emulator

Hello,

Whenever I start or reload my app with my current location outside of all the regions, the event GeofencingEventType.Exit is triggered for all the regions. Im not sure why this event is being triggered since Im not actually leaving the regions. Any help would be much appreciated.

TaskManager:

TaskManager.defineTask(GEO_LOC, ({ data: { eventType, region }, error }) => {

if (error) {

  // check `error.message` for more details.

  return;

}

if (eventType === Location.GeofencingEventType.Enter) {

  console.log("You've entered region:", region.identifier);

  socket.emit('court:create', region.identifier)

}

if (eventType === Location.GeofencingEventType.Exit) {

  console.log("You've left region:", region.identifier);

  socket.emit('court:create', 'left')

}

});

Geofencing:

useEffect(() => {

(async () => {

  await Location.startGeofencingAsync(GEO_LOC, region)

})();

}, );

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.