-
Notifications
You must be signed in to change notification settings - Fork 245
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
In background mode on iOS, plugin freeze the app #1388
Comments
See wiki “Debugging”. Use LOG_LEVEL_VERBOSE. Learn to fetch logs using method .emailLog. I have never experienced this behaviour with the /example app in this repo. I field-test almost every day for years. |
2024-11-30 15:43:26.219 ✅-[BackgroundTaskManager createBackgroundTask] 20 2024-11-30 15:43:26.229 ✅-[TSHttpService schedulePost] LOCKED: 3651F591-BC8E-4E0C-9FF7-CE6CEF496B55 2024-11-30 15:43:35.574 2024-11-30 15:43:36.411
} 2024-11-30 15:43:36.426 ✅-[TSHttpService post:]_block_invoke UNLOCKED: 3651F591-BC8E-4E0C-9FF7-CE6CEF496B55 2024-11-30 15:43:36.426 2024-11-30 15:43:36.426 ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 20 OF ( 2024-11-30 15:43:38.143 2024-11-30 15:43:48.456 2024-11-30 15:44:01.012 2024-11-30 15:44:01.012 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-11-30 15:44:01.334 2024-11-30 15:44:01.334 ℹ️-[TSLocationManager resetMotionTriggerTimer] 2024-11-30 15:44:02.946 2024-11-30 15:44:02.946 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-11-30 15:44:03.586 2024-11-30 15:44:03.586 ℹ️-[TSLocationManager resetMotionTriggerTimer] 2024-11-30 15:44:11.966 2024-11-30 15:44:11.966 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-11-30 15:44:12.287 2024-11-30 15:44:12.287 ℹ️-[TSLocationManager resetMotionTriggerTimer] 2024-11-30 15:44:13.256 2024-11-30 15:44:13.256 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-11-30 15:44:13.575 2024-11-30 15:44:13.575 ℹ️-[TSLocationManager resetMotionTriggerTimer] 2024-11-30 15:44:22.271 2024-11-30 15:44:23.561 2024-11-30 15:44:23.561 🔵-[TSLocationManager startMotionTriggerTimer] Motion-trigger timer engaged: Stop-detection will trigger in 10 seconds... 2024-11-30 17:28:33.516 ℹ️-[TSDBLogger db_delete] maxAge: 259200 2024-11-30 17:28:33.517 ℹ️-[TSLocationManager init] 2024-11-30 17:28:33.520 ℹ️-[GeofenceDAO init] CREATE TABLE IF NOT EXISTS geofences (id INTEGER PRIMARY KEY AUTOINCREMENT, identifier TEXT NOT NULL UNIQUE, latitude DOUBLE NOT NULL, sin_latitude DOUBLE NOT NULL, cos_latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, sin_longitude DOUBLE NOT NULL, cos_longitude DOUBLE NOT NULL, radius DOUBLE NOT NULL, notifyOnEntry BOOLEAN NOT NULL DEFAULT 0, notifyOnExit BOOLEAN NOT NULL DEFAULT 0, notifyOnDwell BOOLEAN NOT NULL DEFAULT 0, loiteringDelay DOUBLE NOT NULL DEFAULT 0, extras TEXT, vertices TEXT) 2024-11-30 17:28:33.520 ℹ️-[GeofenceDAO init] CREATE index IF NOT EXISTS identifier ON geofences (identifier);CREATE index IF NOT EXISTS latitude ON geofences (latitude);CREATE index IF NOT EXISTS longitude ON geofences (longitude);CREATE index IF NOT EXISTS sin_latitude ON geofences (sin_latitude);CREATE index IF NOT EXISTS cos_latitude ON geofences (cos_latitude);CREATE index IF NOT EXISTS sin_longitude ON geofences (sin_longitude);CREATE index IF NOT EXISTS cos_longitude ON geofences (cos_longitude); 2024-11-30 17:28:33.567 🔵-[TSLocationManager locationManager:didChangeAuthorizationStatus:] status 3 2024-11-30 17:28:33.574 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-11-30 17:28:33.575 🔵-[PolygonGeofencingService locationManager:didChangeAuthorizationStatus:] 3 2024-11-30 17:28:33.575 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-11-30 17:28:33.575 🔵-[BackgroundTaskManager locationManager:didChangeAuthorizationStatus:] 3 2024-11-30 17:28:33.575 🔵-[LocationManager locationManager:didChangeAuthorizationStatus:] 3 2024-11-30 17:28:33.588 ℹ️+[LocationAuthorization run:onCancel:] status: 3 Here in 17:28:33.588 is the last log when freezes. |
Show me all your |
if (Platform.isAndroid) {
LocationService.state = await bg.BackgroundGeolocation.ready(
LocationService.buildLocationConfig());
kfromBackgroundLocationAppStarted_ =
LocationService.state?.didLaunchInBackground ?? false;
} else if (!kfromBackgroundLocationAppStarted_) {
kfromBackgroundLocationAppStarted_ =
await Notifications.checkBackgroundStart() ?? false;
if (kfromBackgroundLocationAppStarted_) {
LocationService.state = await bg.BackgroundGeolocation.ready(
LocationService.buildLocationConfig());
if (LocationService.state?.enabled == false) {
bg.BackgroundGeolocation.start();
}
} else {
LocationService.state = await bg.BackgroundGeolocation.ready(
LocationService.buildLocationConfig());
kfromBackgroundLocationAppStarted_ =
LocationService.state?.didLaunchInBackground ?? false;
if (kfromBackgroundLocationAppStarted_) {
if (LocationService.state?.enabled == false) {
bg.BackgroundGeolocation.start();
}
}
}
}
LocationService.geoCallbacks(false);
|
What is this? You seem to have added some sort of wrapper around the plugin's API. Perhaps you have a problem there. I suggest you temporarily remove all this logic around this " |
Your Environment
flutter doctor
):Expected Behavior
When I turn off the application, the plugin turns on in the background and works as it should, it turns on and off by the system when necessary.
Actual Behavior
When I force quit the application, the plugin turns on in the background and works as it should, it turns on and off by the system when necessary, BUT after some time, I can assume that iOS turns off the application as unnecessary in the background and after a while, due to a small movement, the plugin tries to turn on and writes in the debug notification: "Authorization status changed 3" and that's it, after this happens, if I enter the app then it just freezes on the splash screen and nothing happens. It doesn't happen often, but it does.
Steps to Reproduce
Context
Debug logs
Logs
The text was updated successfully, but these errors were encountered: