react-native-background-geolocation: Unable to fetch location
Your Environment
-
Plugin version: 2.14.1
-
Platform: Android
-
OS version: Android 8.1.0
-
Device manufacturer / model: OPPO A3s
-
React Native version (
react-native -v): 0.57.4 -
Plugin config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, stationaryRadius: 25, distanceFilter: 10, stopTimeout: 5, foregroundService:true, debug: false, logLevel: BackgroundGeolocation.LOG_LEVEL_OFF, stopOnTerminate: false,
startOnBoot: true,
Expected Behavior
Plugin should fetch location updates
Actual Behavior
react-native-background geolocation was unable to fetch location. Logs file attached below.
Steps to Reproduce
NA
Context
I was testing tracking on OPPO A3s android phone. As I can see from the logs file below,I continuously got the error code 408 which I understand occurs when there is case of timeout. I was on the field for approximately 1.5 hours and I didn’t get even a single location from the plugin. I never destroyed the app during this time
Debug logs
{ “activityRecognitionInterval”: 10000, “allowIdenticalLocations”: false, “autoSync”: true, “autoSyncThreshold”: 0, “batchSync”: false, “debug”: true, “deferTime”: 0, “desiredAccuracy”: -1, “desiredOdometerAccuracy”: 100, “disableElasticity”: false, “disableStopDetection”: false, “distanceFilter”: 10, “elasticityMultiplier”: 1, “enableHeadless”: false, “enableTimestampMeta”: false, “extras”: {}, “fastestLocationUpdateInterval”: 10000, “forceReloadOnBoot”: false, “forceReloadOnGeofence”: false, “forceReloadOnHeartbeat”: false, “forceReloadOnLocationChange”: false, “forceReloadOnMotionChange”: false, “forceReloadOnSchedule”: false, “foregroundService”: true, “geofenceInitialTriggerEntry”: true, “geofenceProximityRadius”: 1000, “geofenceTemplate”: “”, “headers”: {}, “headlessJobService”: “com.transistorsoft.rnbackgroundgeolocation.HeadlessTask”, “heartbeatInterval”: -1, “httpRootProperty”: “location”, “httpTimeout”: 60000, “isMoving”: true, “locationTemplate”: “”, “locationTimeout”: 60, “locationUpdateInterval”: 1000, “locationsOrderDirection”: “ASC”, “logLevel”: 5, “logMaxDays”: 3, “maxBatchSize”: -1, “maxDaysToPersist”: 1, “maxRecordsToPersist”: -1, “method”: “POST”, “minimumActivityRecognitionConfidence”: 75, “notificationColor”: “”, “notificationLargeIcon”: “”, “notificationPriority”: 0, “notificationSmallIcon”: “”, “notificationText”: “Location Service activated”, “notificationTitle”: “”, “params”: {}, “persist”: true, “schedule”: [], “startOnBoot”: true, “stationaryRadius”: 25, “stopAfterElapsedMinutes”: 0, “stopOnStationary”: false, “stopOnTerminate”: false, “stopTimeout”: 5, “triggerActivities”: “in_vehicle, on_bicycle, on_foot, running, walking”, “url”: “”, “enabled”: true, “schedulerEnabled”: false, “trackingMode”: 1, “odometer”: 0, “isFirstBoot”: true } Attachments area
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 34 (18 by maintainers)
You will get a 408 if you set device settings Location Mode to Device Only (ie GPS only) and attempt to get a location while indoors, where GPS doesn’t work.
You could have problems if device WiFi is disabled and attempt to get a location while indoors, as well.
408 is returned after
locationTimeout (default 60 s).Device location API is like a tap of water – the plugin provides an API for you to turn on the taps and adjust the flow (
distanceFilter) and heat (desiredAccuracy).The plugin holds a cup of water beneath the tap and delivers the water to you.
When
408fires, the plugin turned on the tap and waited for water to flow from the native location API. No water came out. When no water flows, it’s the fault of the City’s water system (Device / OS).