can we add battery percentage?
Personally I'am fan of UNIX philosophy.
Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".
So, what would be the added value comparing to just using dedicated plugin https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-battery-status/?
yes, i do agree with that, but it would be better to add battery % and weather charging or not in the location collection, otherwise for only this thing user has to install the above mentioned plugin, as well he has to write some code so that it can be embedded with location collection.
Hopefully this makes some sense.
Make sense. Will consider adding. Also accepting PR.
@mauron85 Thanks for your reply, i will love to do that but currently i don't have much understanding with java but i will try.
+1
@mauron85 Any updates on this?
Hello, in my opinion there is no need to add such enhancement to this plugin.
There is https://github.com/apache/cordova-plugin-battery-status that covers exactly what is requested in this issue.
Please do not pollute more this plugin with requeriments that has nothing to do with geolocation.
I think with version 3.0.0 one can integrate cordova-plugin-battery-status nicely:
window.addEventListener("batterystatus", onBatteryStatus, false);
function onBatteryStatus(status) {
BackgroundGeolocation.configure({ postTemplate: { battery: status, lat: '@latitude', ... } };
}
Closing. Use my advice above as solution. Keep in mind that it's limited to stopOnTerminate: true. If you kill app you cannot track percentage anymore. However I think it's fair though. Tracking users silently is bad. As such I don't really want to add any more power.
@mauron85 "Tracking users silently is bad"
If this were true, one wouldn't need background geolocation too. Anyways, if you just go through the issues a lot of them have been about battery percentage. I think this is a must have feature and should be a part of this plugin.
Most helpful comment
I think with version 3.0.0 one can integrate cordova-plugin-battery-status nicely: