Closed alihasan21987 closed 1 month ago
Plugin version: 4.9.5
First-of-all, you’re using an old version. See the CHANGELOG.
https://github.com/transistorsoft/react-native-background-geolocation/blob/master/CHANGELOG.md
second, I’ve been running the demo app on my device for nearly 10 years and i don’t experience unusual battery drain.
Plugin version: 4.16.5 Platform: iOS or Android IOS OS version:17.5.1 Device manufacturer / model: IPhone 13 React Native version (react-native -v): 0.70.6 Plugin config
BackgroundGeolocation.ready({ debug: false, locationAuthorizationRequest: 'Always', showsBackgroundLocationIndicator: false, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, desiredAccuracy: desiredAccuracy ? desiredAccuracy : BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: distanceFilter ? distanceFilter : 10, stopOnTerminate: false, disableMotionActivityUpdates: true, startOnBoot: true, heartbeatInterval: 10, enableHeadless: true, locationAuthorizationAlert: { titleWhenNotEnabled: t('title_when_not_enabled'), titleWhenOff: t('title_when_off'), instructions: t('location_auth_alert_instructions'), cancelButton: t('location_auth_alert_cancel'), settingsButton: t('location_auth_alert_settings'), }, stopTimeout: 5, desiredOdometerAccuracy: 10, backgroundPermissionRationale: { title: 'Allow "App" to use your location?', message: 'Please select "Change to Always Allow" below so App can access your location even when you are not using the app.', positiveAction: 'Change to "Always Allow"', negativeAction: 'Cancel', }, }) .then((state) => { if (!state.enabled) { return BackgroundGeolocation.start() .then(() => payload) .catch((error) => Promise.reject(JSON.stringify(error))); } }) .catch((err) => { console.error('Background Geop Location Error : ', err); });
showsBackgroundLocationIndicator: false,
I suggest you set that to true
.
How mush battery % should be used when the app is on driving mode, for an hour with above settings & we are using socket.io to send the real-time location to server?
I have no idea. I do not experience anything unusual with the demo app I've been running on my device for nearly 10 years.
I suggest you disable your socket.io code and compare performance without it.
@christocracy Could you please answer the above questions?
1- How much battery % should be used when the app is on driving mode, for an hour with above settings & we are using socket.io to send the real-time location to server? Please provide some stats or numbers?
2- Why is the device heating up with the new library version ?
3- How can we reduce the battery drain?
I have no idea. I do not experience anything unusual with the demo app I've been running on my device for nearly 10 years.
I suggest you disable your socket.io code and compare performance without it.
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.
Your Environment IOS
react-native -v
): 0.70.6Expected Behavior
Using above Config for Background Geolocation and still battery is consuming more on IOS Devices. I have build install on IOS Device IPhone 13, and it is draining a lot of battery even app is in background or terminated state.
Actual Behavior
How can I solve this problem as I have tried with above config but still it is draining too much battery even on background & terminated state on IOS.
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
Logs
``` PASTE_YOUR_LOGS_HERE ```