question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GeoFencing isn't working when the app is killed/closed (not in the background)

See original GitHub issue

Environment iPhone iOS 12.4

npmPackages: expo: 34.0.0 “react”: “16.9.0”, “react-native”: “https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz”, “expo-location”: “~6.0.0”, “expo-task-manager”: “~6.0.0”,

Steps to Reproduce

Testing GeoFencing. Running on a stand alone device. Everything works correctly when the app is in the foreground (open) or in the background. However, as soon as I swipe up the app and kill it. GeoFencing stops working. No event notifications are received when either entering or exiting the specified location.

Relevant Code

In App.js (in global scope, not inside a component)

TaskManager.defineTask(GEO_TRACK_LOCATION, (args) => {
    Segment.trackWithProperties('GEO_TRACK_' + args.data.eventType, args);
});
Location.startGeofencingAsync(GEO_TRACK_LOCATION, regions)
.then(result => console.log(`${GEO_TRACK_LOCATION} started`));

Expected Behavior

App should wake up when entering or exiting a specified location and fire off an update.

Actual Behavior

No geofencing updates are sent when the app is killed/closed Works as expected when app is open/foreground/background

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vjsinghcommented, Oct 2, 2019

Any updates on this? Seems like it makes the geofencing behavior fairly useless on iOS

0reactions
github-actions[bot]commented, Feb 17, 2022

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My Geofences aren't working on Android - Simple In/Out
Open the app, go to Settings -> Automatic Status Updates -> ... Do not 'Force stop' or 'Force kill' the app from the...
Read more >
iOS - CoreLocation and geofencing while app is closed
yes it can still be obtained. As long as the app is kept running in the background and provided programmer has coded in...
Read more >
Geofences in Android do not work [218335535] - Issue Tracker
The only workaround is to have an app opened which requests location updates through LocationManager. Indeed if the user wouldn't open the Google...
Read more >
[SOLVED] Problem getting geofences to work in later versions ...
Start in geoence: I started the app with me and the devices in the geofence zone, put the app in the background and...
Read more >
Inconsistency in Region Montoring | Apple Developer Forums
Generally speaking, when the user explicitly terminates an app, that app is not launched again in the background. There are some exceptions to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found