Closed Nayank9 closed 18 hours ago
See Wiki Debugging and learn to fetch logs from the plugin using the method .emailLog
.
@christocracy can you please share that plugin link if you have, I have searched for emailLog plugin but I didn't find anything.
It’s a Method of this plugin.
search the api docs for “emailLog”.
you’re reading the api docs, right?
@christocracy I have added emailLog method but I didn't receive any email, you can see in console log
That’s between your device mail client and the receiving mail server.
background-geolocation.log @christocracy can you please check attached log file
Have you looked at this file yourself?
@christocracy Yes I have checked but I didn’t get what's the wrong in it, can you please let me know what might be the issue in my code
You've provided ~45 min worth of logs.
What is the timestamp within that 45min where you experienced your issue "Background location stops updating to firebase as well as own server after 10-12 min"?
@christocracy When app goes to background probably after 10-12 min it stops executing following code
let newData = this.ref.child('DRIV-' + this.driv_id; newData.set({ userId: this.driv_id, uuid: uuid, latitude: lat, longitude: long, heading: heading, time: time, online: onlineStatus, name: driverProfile.firstName, });
Throughout the 45min of the logs you've posted, the plugin is in the stationary state.
You should not expect the plugin to record locations while in the stationary state.
Are you aware of this plugin's Philosophy of Operation, where it only turns on location-services to track location when the device is detected to be moving? When the device is stationary, the plugin has turned off location-services to conserve energy.
🔵 Acquired motionchange position, isMoving: false
Only when you go outside and move (eg: a 1km walk) should you expect the plugin to turn on location-services and record location.
@christocracy I tested outside when app goes to background it stops sending location to firebase & when app opens it is sending cached location, as per my requirement location should update if app goes to background.
tested outside when app goes to background it stops sending location to firebase
Now fetch your logs and tell me the exact timestamp range where your problem occurred.
@christocracy as you requested, please check attached log file. background-geolocation_2010.log
“and tell me the exact timestamp range where your problem occurred”
@christocracy I think it works when device is moving but I have another requirement where app should send current location within 15 min time interval. I'm using heartbit interval but it's not working please check my following code
BackgroundGeolocation.ready({ locationAuthorizationRequest: 'Always', backgroundPermissionRationale: { title: "Allow {applicationName} to access to this device's location in the background?", message:
This app sends your location data to your employer whenever your job clock is activated, even when the app is closed or not in use., positiveAction: "Change to {backgroundPermissionOptionLabel}", negativeAction: "Cancel" }, reset: true, debug: true, logLevel: BackgroundGeolocation.LOG_LEVEL_INFO, desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 15, // url: 'http://my.server.com/locations', heartbeatInterval: 60 * 15, preventSuspend: true, autoSync: true, stopOnTerminate: false, startOnBoot: true }, (state) => { //console.log('[ready] BackgroundGeolocation is ready to use'); if (!state.enabled) { // 3. Start tracking. BackgroundGeolocation.start(); } });
I suggest you decrease your heartbeatInterval to a lower value to test.
@christocracy okay I will check, also what is the use of BackgroundFetch configuration.
what is the use of BackgroundFetch configuration.
Read its readme. It’s perfectly explained there.
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
cordova -v
):cordova platform ls
):Expected Behavior
Actual Behavior
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
Logs
``` PASTE_YOUR_LOGS_HERE ```