Release 4.17.6 results in Android permissions dialogs appearing out of order and locking the UI
Your Environment
- Plugin version: 4.17.6
- Platform: Android
- OS version: 11
- Device manufacturer / model: Pixel 2 XL
- React Native version (
react-native -v): 73.9 - Plugin config
{
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 50,
disableElasticity: true,
debug: false,
logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
stopOnTerminate: false,
stopTimeout: STOP_TIMEOUT,
startOnBoot: true,
enableHeadless: true,
backgroundPermissionRationale: {
// Android only
title: 'Allow App access to your location in the background?',
message: 'In order to track your trip in the background, please select "{backgroundPermissionOptionLabel}"',
positiveAction: 'Change to {backgroundPermissionOptionLabel}',
negativeAction: 'Cancel',
},
locationAuthorizationAlert: {
// iOS only
titleWhenNotEnabled: 'Location services are disabled',
titleWhenOff: 'Location Services are off',
instructions:
'App requires location services to be set to "always" so that your trips can be recorded.',
cancelButton: 'Cancel',
settingsButton: 'Settings',
},
showsBackgroundLocationIndicator: true,
locationAuthorizationRequest: 'Always',
notification: {
title: 'App is using location',
text: 'This is required to automatically record your trips',
},
}
Expected Behavior
We have been using the library in a production app and recently updated to v4.17.6 from v4.17.4 We are asking for Always permission when the user installs the app for the first time This was working fine in earlier versions the permission dialogs are shown in the correct sequence and the user can give permission and continue with the app
Actual Behavior
With the latest version when it comes to asking for permission the dialogs appear out of sequence which locks up the UI and you need to force close the app to continue. It shows
- "Allow
to access the devices location?" -> While using the app - It then switches to the "Location permission" "Allow all the time" and when you press back it returns to the app there is another permission modal and the whole screen is unresponsive
- "Allow
access to your location in the background?" -> "change to All all the time" This modal is unresponsive and the app must be quit to continue.
Downgrading to v4.17.5 the modals are shown in the correct order with the (3) "Allow location in background" modal is shown before switching to the "Location permission"
Steps to Reproduce
- As per above - request location in background permission 2. 3. 4.
Context
No change to our code was made between upgrading from 4.17.4-> 4.17.6
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
Oh thanks ! Some users (Android only) of my app reported the same weird issue this weekend. With your description, I can finaly reproduce. It happen only the first time, when the permission is asked.
Here my notes :
-> Android only -> It freeze only partially the screen UI (like an invisible overlay) -> back button "unfreeze" the UI.
To reprocude, one subtility is to call start immediatly after ready() success .
- call ready()
- call start() in the success ready promise
=> bug, UI is freeze.
- call ready()
- add a switch button to trigger the "start()"
=> no bug
- call ready()
- wrap start with a setTimeout(.., 1000) in the success ready promise
=> no bug.
Downgrade to 4.17.5 fix the issue.
I cannot reproduce on Pixel 6 @ 15 nor Samsung Galaxy S20 @ 13
nor Pixel 3a @ 11.
React.useEffect(() => {
BackgroundGeolocation.ready({
reset: true,
debug: true,
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
stopOnTerminate: false,
enableHeadless: true
}).then((state) => {
BackgroundGeolocation.start();
})
}, []);
More infos :
- tested on Samsung Galaxy Note 10+ with Android 12.
- new arch / old arch (same problem)
- React native 0.76
- both in dev mode / prod mode
I may missing something, it's not straightforward as I tought, because I just did another quick test =>
With your code, it seems fine (to confirm) With this code for me it's KO (first attempt on the fresh install was OK, and after changing settings permission, the second attemps was KO).
import React from 'react';
import { Alert } from 'react-native';
import BackgroundGeolocation from 'react-native-background-geolocation';
import { Button, View } from '@/ui';
export const About = () => {
const [enabled, setEnabled] = React.useState(false);
const [location, setLocation] = React.useState('');
React.useEffect(() => {
BackgroundGeolocation.ready({
// Geolocation Config
locationAuthorizationRequest: 'WhenInUse',
foregroundService: true,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
locationUpdateInterval: 1000,
fastestLocationUpdateInterval: 1000,
distanceFilter: 0,
// Activity Recognition
stopTimeout: 9999999,
disableStopDetection: true,
pausesLocationUpdatesAutomatically: false,
disableMotionActivityUpdates: true,
speedJumpFilter: 300,
// Application config
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
stopOnTerminate: true, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: false, // <-- Auto start tracking when device is powered-up.
// HTTP / SQLite config
url: Env.API_GEOLOCATION_UPDATE,
httpTimeout: 45000,
batchSync: true, // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
autoSyncThreshold: 300,
autoSync: true,
maxBatchSize: 600,
desiredOdometerAccuracy: 10,
maxDaysToPersist: 30,
stationaryRadius: 25,
headers: {
// <-- Optional HTTP headers
},
extras: {
// <-- Optional HTTP params append to each HTTP request
},
locationTemplate:
'{"la":<%= latitude %>,"lng":<%= longitude %>,"t":"<%= timestamp %>","s":<%= speed %>, "a":<%= accuracy %>, "al":<%= altitude %>, "ala":<%= altitude_accuracy %>, "b":<%= battery.level %>}',
locationAuthorizationAlert: {
titleWhenNotEnabled: 'localized_string',
titleWhenOff: 'localized_string',
instructions: 'localized_string',
cancelButton: 'localized_string',
settingsButton: 'localized_string',
},
/*locationAuthorizationAlert: {
titleWhenNotEnabled: translate(
'live.permissions.localization_alert.title_when_not_enabled'
),
titleWhenOff: translate(
'live.permissions.localization_alert.title_when_not_enabled'
),
instructions: translate(
'live.permissions.localization_alert.instruction'
),
cancelButton: translate('layout.cancel'),
settingsButton: translate('layout.settings'),
},*/
}).then((state) => {
BackgroundGeolocation.start();
});
}, []);
return (
<View>
<Button
label="button1"
variant="primary"
style={{ position: 'absolute', top: 0, left: 0 }}
onPress={() => {
Alert.alert('button 1');
}}
/>
<Button
variant="primary"
style={{ position: 'absolute', top: 50, left: 0 }}
label="button2"
onPress={() => {
Alert.alert('button 2');
}}
/>
<Button
variant="primary"
style={{ position: 'absolute', top: 120, left: 20 }}
label="button3"
onPress={() => {
Alert.alert('button 3');
}}
/>
</View>
);
};
When I press on the "freeze" UI, logcat tell me :
2024-11-26 16:51:17.797 22685-22685 ViewRootIm...TSLocationManagerActivity] xx.xx I ViewPostIme pointer 0
My config:
2024-11-26 17:06:55.770 25628-25875 TSLocationManager xx.xxx.xx I [c.t.l.logger.LoggerFacade$a a]
╔═════════════════════════════════════════════
║ TSLocationManager version: 3.6.3 (438)
╠═════════════════════════════════════════════
╟─ samsung SM-N975U1 @ 12 (react)
{
"activityRecognitionInterval": 10000,
"allowIdenticalLocations": false,
"authorization": {},
"autoSync": true,
"autoSyncThreshold": 300,
"backgroundPermissionRationale": {
"title": "Allow {applicationName} to access this device's location even when closed or not in use?",
"message": "[CHANGEME] This app collects location data for FEATURE X and FEATURE Y.",
"positiveAction": "Change to \"{backgroundPermissionOptionLabel}\"",
"negativeAction": ""
},
"batchSync": true,
"configUrl": "",
"crashDetector": {
"enabled": false,
"accelerometerThresholdHigh": 20,
"accelerometerThresholdLow": 4.5,
"gyroscopeThresholdHigh": 20,
"gyroscopeThresholdLow": 4.5
},
"debug": true,
"deferTime": 0,
"desiredAccuracy": -1,
"desiredOdometerAccuracy": 10,
"disableAutoSyncOnCellular": false,
"disableElasticity": false,
"disableLocationAuthorizationAlert": false,
"disableMotionActivityUpdates": true,
"disableProviderChangeRecord": false,
"disableStopDetection": true,
"distanceFilter": 0,
"elasticityMultiplier": 1,
"enableHeadless": false,
"enableTimestampMeta": false,
"extras": {},
"fastestLocationUpdateInterval": 1000,
"foregroundService": true,
"geofenceInitialTriggerEntry": true,
"geofenceModeHighAccuracy": false,
"geofenceProximityRadius": 1000,
"geofenceTemplate": "",
"headers": {},
"headlessJobService": "com.transistorsoft.rnbackgroundgeolocation.HeadlessTask",
"heartbeatInterval": -1,
"httpRootProperty": "location",
"httpTimeout": 45000,
"isMoving": false,
"locationAuthorizationRequest": "WhenInUse",
"locationTemplate": "{\"la\":<%= latitude %>,\"lng\":<%= longitude %>,\"t\":\"<%= timestamp %>\",\"s\":<%= speed %>, \"a\":<%= accuracy %>, \"al\":<%= altitude %>, \"ala\":<%= altitude_accuracy %>, \"b\":<%= battery.level %>}",
"locationTimeout": 60,
"locationUpdateInterval": 1000,
"locationsOrderDirection": "ASC",
"logLevel": 5,
"logMaxDays": 3,
"maxBatchSize": 600,
"maxDaysToPersist": 30,
"maxMonitoredGeofences": 97,
"maxRecordsToPersist": -1,
"method": "POST",
"minimumActivityRecognitionConfidence": 75,
"motionTriggerDelay": 0,
"notification": {
"layout": "",
"title": "",
"text": "Location Service activated",
"color": "",
"channelName": "TSLocationManager",
"channelId": "",
"smallIcon": "",
"largeIcon": "",
"priority": -1,
"sticky": false,
"strings": {},
"actions": []
},
"params": {},
"persist": true,
"persistMode": 2,
"schedule": [],
"scheduleUseAlarmManager": false,
"speedJumpFilter": 300,
"startOnBoot": false,
"stationaryRadius": 25,
"stopAfterElapsedMinutes": 0,
"stopOnStationary": false,
"stopOnTerminate": true,
"stopTimeout": 9999999,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
"url": "https:\/\/url\/",
"useSignificantChangesOnly": false,
"enabled": true,
"schedulerEnabled": false,
"trackingMode": 1,
"odometer": 0,
"isFirstBoot": false,
"didLaunchInBackground": false,
"didDeviceReboot": false
}
"
Log before / after the authorization is shown:
2024-11-26 16:54:47.317 23532-23711 TSLocationManager xx.xx I [c.t.l.u.LocationAuthorization withBackgroundPermission]
🔵 LocationAuthorization: Requesting Background permission
2024-11-26 16:54:47.353 23532-23702 TSLocationManager xx.xx I [c.t.l.http.HttpService flush]
ℹ️ HttpService is busy
2024-11-26 16:54:47.353 23532-23709 TSLocationManager xx.xx I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 24)
╠═════════════════════════════════════════════
2024-11-26 16:54:47.539 23532-23532 TSLocationManager xx.xx D [c.t.l.g.TSGeofenceManager$d run] evaluation buffer timer elapsed
2024-11-26 16:54:48.205 23532-23532 TSLocationManager xx.xx D [c.t.l.l.LifecycleManager onPause] ☯️ onPause
2024-11-26 16:54:52.213 23532-23532 TSLocationManager xx.xx I [c.t.l.u.LocationAuthorization$j onPermissionGranted]
✅ LocationAuthorization: Permission granted
2024-11-26 16:54:52.216 23532-23709 TSLocationManager xx.xx I - Enable: false → true, trackingMode: 1
2024-11-26 16:54:52.218 23532-23709 TSLocationManager xx.xx I [c.t.l.g.TSGeofenceManager start]
🎾 Start monitoring geofences
2024-11-26 16:54:52.226 23532-23709 TSLocationManager xx.xx D [c.t.l.http.HttpService startMonitoringConnectivityChanges]
🎾 Start monitoring connectivity changes
2024-11-26 16:54:52.234 23532-23709 TSLocationManager xx.xx D [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
🎾 Start monitoring powersave changes
2024-11-26 16:54:52.246 23532-23754 TSLocationManager xx.xx I [c.t.l.service.HeartbeatService stop]
🔴 Stop heartbeat
2024-11-26 16:54:52.254 23532-23754 TSLocationManager xx.xx I [c.t.l.service.TrackingService changePace]
🔵 setPace: false → false
2024-11-26 16:54:52.255 23532-23754 TSLocationManager xx.xx I [c.t.l.p.TSProviderManager a]
╔═════════════════════════════════════════════
║ Location-provider change: true
╠═════════════════════════════════════════════
╟─ GPS: true
╟─ Network: true
╟─ AP Mode: false
2024-11-26 16:54:52.256 23532-23754 TSLocationManager xx.xx D [c.t.l.http.HttpService a]
╔═════════════════════════════════════════════
║ 📶 Connectivity change: connected? true
╠═════════════════════════════════════════════
2024-11-26 16:54:52.263 23532-23709 TSLocationManager xx.xx I [c.t.l.service.HeartbeatService stop]
🔴 Stop heartbeat
2024-11-26 16:54:52.266 23532-23709 TSLocationManager xx.xx I [c.t.l.service.TrackingService changePace]
🔵 setPace: false → false
2024-11-26 16:54:52.286 23532-23532 TSLocationManager xx.xx D [c.t.l.l.LifecycleManager onResume] ☯️ onResume
2024-11-26 16:54:52.290 23532-23709 TSLocationManager xx.xx I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 24)
╠═════════════════════════════════════════════
2024-11-26 16:54:52.298 23532-23532 TSLocationManager xx.xx W [c.t.l.l.TSLocationManager onSingleLocationResult]
ℹ️ Failed to find SingleLocationRequest. Request ignored.
2024-11-26 16:54:52.307 23532-23532 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager a]
╔═════════════════════════════════════════════
║ providerchange LocationResult: 2 (237267ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 44.895612,5.021515 hAcc=9.738 et=+8d7h5m55s693ms alt=257.9000244140625 vAcc=4.2335844 vel=0.0 sAcc=1.5 {Bundle[{}]}], time: 1732636255036
2024-11-26 16:54:52.341 23532-23532 TSLocationManager xx.xx D [c.t.l.l.TSLocationManager a] Median accuracy: 9.738
2024-11-26 16:54:52.352 23532-23532 TSLocationManager xx.xx I [c.t.l.u.LocationAuthorization withPermission]
🔵 LocationAuthorization: Requesting permission
2024-11-26 16:54:52.353 23532-23532 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 3 (237316ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 44.895612,5.021515 hAcc=9.738 et=+8d7h5m55s693ms alt=257.9000244140625 vAcc=4.2335844 vel=0.0 sAcc=1.5 {Bundle[{}]}], time: 1732636255036
2024-11-26 16:54:52.355 23532-23532 TSLocationManager xx.xx D [c.t.l.l.TSLocationManager a] Median accuracy: 9.738
2024-11-26 16:54:52.363 23532-23532 TSLocationManager xx.xx I [c.t.l.u.LocationAuthorization withPermission]
🔵 LocationAuthorization: Requesting permission
2024-11-26 16:54:52.451 23532-23532 TSLocationManager xx.xx I [c.t.l.u.LocationAuthorization$j onPermissionGranted]
✅ LocationAuthorization: Permission granted
2024-11-26 16:54:52.470 23532-23532 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 2
2024-11-26 16:54:52.502 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
🎾 start [LocationRequestService startId: 1, eventCount: 1]
2024-11-26 16:54:52.506 23532-23709 TSLocationManager xx.xx I [c.t.l.l.SingleLocationRequest startUpdatingLocation]
🔵 [SingleLocationRequest start, action: 3, requestId: 2]
2024-11-26 16:54:52.507 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
🎾 start [LocationRequestService startId: 2, eventCount: 2]
2024-11-26 16:54:52.508 23532-23702 TSLocationManager xx.xx I [c.t.l.l.SingleLocationRequest startUpdatingLocation]
🔵 [SingleLocationRequest start, action: 1, requestId: 3]
2024-11-26 16:54:52.508 23532-23709 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 1, eventCount: 1, sticky: true]
2024-11-26 16:54:52.511 23532-23702 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 2, eventCount: 0, sticky: true]
2024-11-26 16:54:52.514 23532-23532 TSLocationManager xx.xx I [c.t.l.s.TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
2024-11-26 16:54:52.547 23532-23532 TSLocationManager xx.xx I [c.t.l.s.TSScheduleManager oneShot]
⏰ Oneshot TERMINATE_EVENT is already pending
2024-11-26 16:54:52.567 23532-23702 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO allWithLocking]
✅ Locked 24 records
2024-11-26 16:54:52.568 23532-23702 TSLocationManager xx.xx I [c.t.l.http.HttpService a]
🔵 HTTP POST batch (24)
2024-11-26 16:54:52.574 23532-23532 TSLocationManager xx.xx D [c.t.l.a.TSLocationManagerActivity a] locationsettings
2024-11-26 16:54:52.574 23532-23532 TSLocationManager xx.xx D [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
2024-11-26 16:54:52.607 23532-23532 ViewRootIm...rActivity] xx.xx I setView = com.android.internal.policy.DecorView@34b7dda TM=true
2024-11-26 16:54:52.619 23532-23532 TSLocationManager xx.xx D [c.t.l.a.TSLocationManagerActivity a] locationsettings
2024-11-26 16:54:52.620 23532-23532 TSLocationManager xx.xx D [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
2024-11-26 16:54:52.647 23532-23532 ViewRootIm...rActivity] xx.xx I setView = com.android.internal.policy.DecorView@9e15f42 TM=true
2024-11-26 16:54:52.650 23532-23532 TSLocationManager xx.xx D [c.t.l.a.TSLocationManagerActivity c] eventCount: 1
2024-11-26 16:54:52.664 23532-23532 ViewRootIm...rActivity] xx.xx I Relayout returned: old=(0,85,1080,2154) new=(540,1119,540,1119) req=(0,0)0 dur=7 res=0x7 s={true -5476376619132638880} ch=true fn=-1
2024-11-26 16:54:52.666 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11420 android.view.ViewRootImpl.performTraversals:4193 android.view.ViewRootImpl.doTraversal:2919
2024-11-26 16:54:52.667 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] pdf(0) 1 android.view.ViewRootImpl.performDraw:5207 android.view.ViewRootImpl.performTraversals:4212 android.view.ViewRootImpl.doTraversal:2919
2024-11-26 16:54:52.667 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] rdf()
2024-11-26 16:54:52.667 23532-23532 ViewRootIm...rActivity] xx.xx D reportDrawFinished (fn: -1)
2024-11-26 16:54:52.682 23532-23532 ViewRootIm...rActivity] xx.xx I Relayout returned: old=(0,85,1080,2154) new=(540,1119,540,1119) req=(0,0)0 dur=11 res=0x7 s={true -5476376619132516800} ch=true fn=-1
2024-11-26 16:54:52.684 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11420 android.view.ViewRootImpl.performTraversals:4193 android.view.ViewRootImpl.doTraversal:2919
2024-11-26 16:54:52.685 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] pdf(0) 1 android.view.ViewRootImpl.performDraw:5207 android.view.ViewRootImpl.performTraversals:4212 android.view.ViewRootImpl.doTraversal:2919
2024-11-26 16:54:52.685 23532-23532 ViewRootIm...rActivity] xx.xx I [DP] rdf()
2024-11-26 16:54:52.685 23532-23532 ViewRootIm...rActivity] xx.xx D reportDrawFinished (fn: -1)
2024-11-26 16:54:52.686 23532-23532 TSLocationManager xx.xx D [c.t.l.a.TSLocationManagerActivity c] eventCount: 0
2024-11-26 16:54:52.718 23532-23532 ViewRootIm...rActivity] xx.xx I stopped(false) old=false
2024-11-26 16:54:52.725 23532-23532 ViewRootIm...rActivity] xx.xx I handleAppVisibility mAppVisible=true visible=false
2024-11-26 16:54:52.727 23532-23532 ViewRootIm...rActivity] xx.xx I MSG_WINDOW_FOCUS_CHANGED 0 1
2024-11-26 16:54:52.728 23532-23532 ViewRootIm...rActivity] xx.xx I MSG_WINDOW_FOCUS_CHANGED 0 1
2024-11-26 16:54:52.742 23532-23532 ViewRootIm...rActivity] xx.xx I Relayout returned: old=(540,1119,540,1119) new=(540,1119,540,1119) req=(0,0)8 dur=3 res=0x5 s={false 0} ch=true fn=1
2024-11-26 16:54:52.743 23532-23532 ViewRootIm...rActivity] xx.xx I MSG_WINDOW_FOCUS_CHANGED 1 1
2024-11-26 16:54:52.747 23532-23532 ViewRootIm...rActivity] xx.xx I stopped(true) old=false
2024-11-26 16:54:52.756 23532-23532 TSLocationManager xx.xx D [c.t.l.a.TSLocationManagerActivity onDestroy]
2024-11-26 16:54:52.758 23532-23532 ViewRootIm...rActivity] xx.xx I dispatchDetachedFromWindow
2024-11-26 16:54:52.932 23532-23851 TSLocationManager xx.xx W [c.t.l.http.HttpService$f onResponse]
⚠️ Response: 401,
2024-11-26 16:54:52.934 23532-23851 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO unlock]
✅ UNLOCKED (24)
2024-11-26 16:54:52.937 23532-23851 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 2
2024-11-26 16:54:53.262 23532-23702 TSLocationManager xx.xx I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 24)
╠═════════════════════════════════════════════
2024-11-26 16:54:53.306 23532-23532 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 3
2024-11-26 16:54:53.315 23532-23702 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO allWithLocking]
✅ Locked 24 records
2024-11-26 16:54:53.315 23532-23702 TSLocationManager xx.xx I [c.t.l.http.HttpService a]
🔵 HTTP POST batch (24)
2024-11-26 16:54:53.550 23532-23851 TSLocationManager xx.xx W [c.t.l.http.HttpService$f onResponse]
⚠️ Response: 401,
2024-11-26 16:54:53.552 23532-23851 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO unlock]
✅ UNLOCKED (24)
2024-11-26 16:54:53.555 23532-23851 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 3
2024-11-26 16:54:53.871 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
🎾 1:3 [LocationRequestService startId: 3, eventCount: 1]
2024-11-26 16:54:53.877 23532-23702 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 3 (108ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 44.895600,5.021501 hAcc=20.0 et=+8d7h9m54s424ms alt=257.9000244140625 vAcc=4.5511384 {Bundle[{}]}], time: 1732636493767
2024-11-26 16:54:53.879 23532-23702 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: false
2024-11-26 16:54:53.879 23532-23702 TSLocationManager xx.xx D [c.t.l.l.TSLocationManager a] Median accuracy: 9.738
2024-11-26 16:54:53.885 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
🎾 3:2 [LocationRequestService startId: 4, eventCount: 2]
2024-11-26 16:54:53.905 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService b]
🎾 STOP [LocationRequestService startId: 5, eventCount: 3]
2024-11-26 16:54:53.906 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 5, eventCount: 2, sticky: false]
2024-11-26 16:54:53.929 23532-23702 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 3, eventCount: 1, sticky: false]
2024-11-26 16:54:53.929 23532-23532 TSLocationManager xx.xx D [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
ℹ️ Cannot monitor stationary-region with 'WhenInUse' authorization
2024-11-26 16:54:53.931 23532-23703 TSLocationManager xx.xx I [c.t.l.d.s.SQLiteLocationDAO persist]
✅ INSERT: 85df7ccb-1271-4086-b7b4-8257eaa1741c
2024-11-26 16:54:53.934 23532-23709 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager a]
╔═════════════════════════════════════════════
║ providerchange LocationResult: 2 (164ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 44.895600,5.021501 hAcc=20.0 et=+8d7h9m54s424ms alt=257.9000244140625 vAcc=4.5511384 {Bundle[{}]}], time: 1732636493767
2024-11-26 16:54:53.935 23532-23703 TSLocationManager xx.xx I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 25)
╠═════════════════════════════════════════════
2024-11-26 16:54:53.940 23532-23709 TSLocationManager xx.xx I [c.t.l.l.TSLocationManager onSingleLocationResult]
🔵 Acquired providerchange position
2024-11-26 16:54:53.941 23532-23709 TSLocationManager xx.xx D [c.t.l.l.TSLocationManager a] Median accuracy: 14.8689995
2024-11-26 16:54:53.950 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
🎾 motionchange [TrackingService startId: 1, eventCount: 1]
2024-11-26 16:54:53.952 23532-23532 TSLocationManager xx.xx I [c.t.l.service.TrackingService k]
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════
2024-11-26 16:54:53.954 23532-23703 TSLocationManager xx.xx I [c.t.l.d.s.SQLiteLocationDAO persist]
✅ INSERT: 276b8c01-876e-41ff-8455-c892108c8b9d
2024-11-26 16:54:53.955 23532-23709 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 4, eventCount: 0, sticky: false]
2024-11-26 16:54:53.959 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: false]
2024-11-26 16:54:53.965 23532-23532 TSLocationManager xx.xx D [c.t.l.l.TSLocationManager$c onLocation]
ℹ️ Distance from last location: 4998031.0
2024-11-26 16:54:53.965 23532-23532 TSLocationManager xx.xx D [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
ℹ️ Cannot monitor stationary-region with 'WhenInUse' authorization
2024-11-26 16:54:53.970 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService b]
🎾 STOP [LocationRequestService startId: 6, eventCount: 1]
2024-11-26 16:54:53.970 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService a]
⚙️︎ FINISH [LocationRequestService startId: 6, eventCount: 0, sticky: false]
2024-11-26 16:54:53.980 23532-23532 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 4
2024-11-26 16:54:53.984 23532-23703 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO allWithLocking]
✅ Locked 26 records
2024-11-26 16:54:53.984 23532-23703 TSLocationManager xx.xx I [c.t.l.http.HttpService a]
🔵 HTTP POST batch (26)
2024-11-26 16:54:54.086 23532-23851 TSLocationManager xx.xx W [c.t.l.http.HttpService$f onResponse]
⚠️ Response: 401,
2024-11-26 16:54:54.088 23532-23851 TSLocationManager xx.xx D [c.t.l.d.s.SQLiteLocationDAO unlock]
✅ UNLOCKED (26)
2024-11-26 16:54:54.092 23532-23851 TSLocationManager xx.xx I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 4
2024-11-26 16:54:54.165 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService f]
⚙️︎ TrackingService.stopSelfResult(1): true
2024-11-26 16:54:54.166 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService onDestroy]
🔴 TrackingService stopped
2024-11-26 16:54:54.175 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService f]
⚙️︎ LocationRequestService.stopSelfResult(6): true
2024-11-26 16:54:54.175 23532-23532 TSLocationManager xx.xx D [c.t.l.service.AbstractService onDestroy]
🔴 LocationRequestService stopped
2024-11-26 16:54:56.022 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 0
2024-11-26 16:54:56.089 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 1
2024-11-26 16:54:57.591 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 0
2024-11-26 16:54:57.663 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 1
2024-11-26 16:54:58.058 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 0
2024-11-26 16:54:58.131 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 1
2024-11-26 16:54:58.380 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 0
2024-11-26 16:54:58.472 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 1
2024-11-26 16:55:01.036 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 0
2024-11-26 16:55:01.125 23532-23532 ViewRootIm...rActivity] xx.xx I ViewPostIme pointer 1
2024-11-26 16:55:10.039 23532-23703 TSLocationManager xx.xx I [c.t.l.scheduler.ScheduleEvent a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
2024-11-26 16:55:10.041 23532-23703 TSLocationManager xx.xx D [c.t.l.event.TerminateEvent$a onChange]
ℹ️ TERMINATE_EVENT ignored (MainActivity is still active).
It's all I have.
I hope it can help you to reproduce
May be @joneswah can help more.
You probably don't need to do a re-install to test this. Just go to your app settings and change location to "Ask every time".
Yes, that's what I do to test. I just reinstalled once to initial quick test it (I had downgraded 4.17.5 , then upgraded the version again for the test to 4.17.6).
If I can have consistent reproduction, it can be fixed. I had tweaked something related to this recently.
I see you're requesting locationAuthorizationRequest: "WhenInUse". Does that cause it (vs "Always")? I can't see how that'd be the case.
I understand. For now, I think I may missing something to reproduce EVERY time. I will have more time this week-end or next week to investigate (side project).
In my case with "Always" : I dont't see the problem.
@joneswah can confirm/unconfirm this behavior ? bring more info may be ?
I am facing the same issue on Android. When the user selects "Allow only while using the app," a location authorization alert appears (with "Change all the time" and "Cancel" buttons). Now, if the user clicks the "Cancel" button, the app freezes and an overlay appears. There are no logs or errors, and the app becomes unresponsive.
This issue is reproducible on my end, and it's affecting the production version of the app. I'm using "react-native-background-geolocation": "^4.16.5".
If you would like, I can provide a video to demonstrate the issue. Could you please help urgently?
I can provide a video to demonstrate the issue
Videos are useless. Provide logs from $ adb logcat *:S TSLocationManager:V while reproducing this.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.