capacitor-background-geolocation: [Bug]: IOS After a few days of the app being killed, it can no longer record the location or send it to the server.
Required Reading
- Confirmed
Plugin Version
“@transistorsoft/capacitor-background-fetch”: “^6.0.1”, “@transistorsoft/capacitor-background-geolocation”: “6.1.4”,
Cap Doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/core: 6.1.2
@capacitor/cli: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2
[success] iOS looking great! 👌
[success] Android looking great! 👌
Mobile operating-system(s)
- iOS
- Android
Device Manufacturer(s) and Model(s)
iPhone 15 Prm, Ip 14 plus, Ip 13
Device operating-systems(s)
ios 18.1.1
What happened?
Issue occurring on iOS: I built an application that records the user’s location when traveling by car, with each trip being at least 1 km.
For the first 24 hours after the app is killed, everything works as expected. However, after a few days, the app stops recording locations and no longer sends new location data to the server.
Plugin Code and/or Config
{
activityRecognitionInterval = 10000;
activityType = 1;
authorization = {
};
autoSync = 1;
autoSyncThreshold = 1;
batchSync = 1;
debug = 0;
desiredAccuracy = "-1";
desiredOdometerAccuracy = 10;
didDeviceReboot = 0;
didLaunchInBackground = 0;
didRequestUpgradeLocationAuthorization = 1;
disableAutoSyncOnCellular = 0;
disableElasticity = 1;
disableLocationAuthorizationAlert = 1;
disableMotionActivityUpdates = 0;
disableStopDetection = 0;
distanceFilter = 200;
elasticityMultiplier = 1;
enableTimestampMeta = 0;
enabled = 1;
extras = {
};
geofenceInitialTriggerEntry = 1;
geofenceProximityRadius = 2000;
geofenceTemplate = "";
headers = {
};
heartbeatInterval = 60;
httpRootProperty = location;
httpTimeout = 60000;
iOSHasWarnedLocationServicesOff = 0;
isFirstBoot = 0;
isMoving = 1;
lastLocationAuthorizationStatus = 3;
locationAuthorizationAlert = {
cancelButton = Cancel;
instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings";
settingsButton = Settings;
titleWhenNotEnabled = "Background location is not enabled";
titleWhenOff = "Location services are off";
};
locationAuthorizationRequest = Always;
locationTemplate = "{\"latitude\":<%= latitude %>, \"longitude\":<%= longitude %>, \"speed\":<%= speed %>, \"is_moving\":<%= is_moving %>, \"timestamp\":\"<%= timestamp %>\", \"activityType\":\"<%= activity.type %>\" }";
locationTimeout = 60;
locationsOrderDirection = ASC;
logLevel = 4;
logMaxDays = 3;
maxBatchSize = 10;
maxDaysToPersist = 2;
maxRecordsToPersist = "-1";
method = POST;
minimumActivityRecognitionConfidence = 70;
odometer = 0;
params = {
"os_info" = "0.6.0.22 - iPhone13,3 - iOS - 18.1.1";
"user_i
Relevant log output
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (15 by maintainers)
This issue has nothing to do with Android.
Completely DELETE the following options:
Change
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSEMisspelled. The option is named
distanceFilterNOTDistanceFilter