-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scanning stops after app in background for 5 minutes (iOS) #189
Comments
Also I have enabled background modes as described here: And requested Location Always permission. The events do work on background for the first 5 minutes, then it suddenly stops. |
Hi, I also encountered this problem and was indeed able to counter it. if (Platform.OS === 'ios') {
Beacons.requestAlwaysAuthorization();
Beacons.startUpdatingLocation();
BackgroundGeolocation.ready({
reset: true,
preventSuspend: true // Make the app run continuously in background
}, (state) => {
console.log("- BackgroundGeolocation is configured and ready: ", state.enabled);
if (!state.enabled) {
// Start the backgroundGeolocation service
BackgroundGeolocation.start(function () {
console.log("- Start success");
});
}
});
} The service is started when I start the beacons monitoring and stopped when it is ended, so the app only runs in background when it needs to. I only use it on the iOS app with the condition check. To stop it, you do it like that : if (Platform.OS == "ios") {
BackgroundGeolocation.stop();
} Since I didn't publish my app, I'm not 100% sure if Apple will allow this usage during its review process. Normally it should, because the app indeed uses locations for the beacons and it is an acceptable use case for performing background tasks. |
Version
1.0.7
Platform
iOS
OS version
iOS 13.3
Steps to reproduce
Expected behavior
Expect the events to continue while app is in background
Actual behavior
Almost exactly on 5 minutes the events stop being dispatched.
Not sure if this is related to iOS background limits or something with CLBeaconRegion.
Android working as expected in background.
Any help appreciated!
The text was updated successfully, but these errors were encountered: