react-native-background-geolocation
react-native-background-geolocation copied to clipboard
The background geolocation takes a long time to start when I keep the app in the killed state, and it doesn't start when I am walking. However, when I am riding a bike, then coordinates are received
Your Environment
- Plugin version: 4.12.1
- Platform: iOS
- OS version: 16.7.2
- Device manufacturer / model: iphone 11
- React Native version (
react-native -v): 0.64.0 - Plugin config
const state = await BackgroundGeolocation.ready({
url: API_URL + API_ENDPOINTS.SAVELOCATION,
//debug: true,
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: 10,
// locationUpdateInterval: interval,
stopTimeout: 5,
locationTemplate:
'{"Latitude":<%= latitude %>,"Longitude":<%= longitude %>,"TimeStamp": "<%= timestamp %>"}',
locationAuthorizationRequest: 'Always',
backgroundPermissionRationale: {
title:
"Allow {applicationName} to access this device's location even when closed or not in use.",
message:
'This app collects location data to enable recording your trips to work and calculate distance-travelled.',
positiveAction: 'Change to "{backgroundPermissionOptionLabel}"',
negativeAction: 'Cancel',
},
headers: {
authorization: 'Bearer ' + getToken.data.Token,
source: source,
},
params: {
ClientId: respo_storage.data.ClientId,
},
batchSync: true,
autoSync: true,
maxDaysToPersist: 14,
stopOnTerminate: false,
startOnBoot: true,
enableHeadless: true,
// preventSuspend:true
});
Expected Behavior
it should give us the coordinates that we are posting in api after going to killed state
Actual Behavior
its giving the coordinates after some time dont know why this is happening
Steps to Reproduce
- after giving all the permissions like always allow to location go to killed state
- now you are unable to see the location icon for some time and after some time it will start showing dont know its based on distance as i am walking but when i go somewhere on bike it starts showing the icon and coordinates being saved
Context
Actually when i go to killed state in android its working fine like we are getting the coordinates but in case of ios in foreground state it works fine but when the app is in killed state it starts giving coordinates after some time i dont know its depend on time or distance
Debug logs
I am unable to reproduce logs as i am checking it in killed state in foreground state its working fine
PASTE_YOUR_LOGS_HERE
There are some conditions for iOS
- When an iOS app is terminated you get no data.
- When the device moves about 200 meters after being terminated, the OS will automatically relaunch your app in the background (just as if launched by the user from the home-screen) and tracking resumes. Your app is no longer terminated, it is now running in the background.
- OS itself will take care of re-booting the device behind the scene and also user won't be seeing it in the background apps on his/her device. So, for the user app is still terminated and for OS, it's in the background.
- iOS needs Wifi enabled so it can use the geolocation of detected wifi routers to evaluate geofences. It doesn't mean the device needs to actually be authenticated with a router.
This package is not working on some android and ios devices and we are unable to find the devices as they are live users may i know the device names on which this package doesn't support or the minimum api level and os version please?
This package is not working on some android
See https://dontkillmyapp.com
Performance of iOS is consistent across all device models.
The plug-in works on a remarkably wide range of OS:
- Android: 4.4.4+ (including latest 14)
- iOS: 8.3+
Will the latest version 4.14.4 will perfectly work with react native version 0.64.0 if i try to update the latest plugin version?
I have no idea. I use 0.72.4. It probably works.
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.