Closed hernanjls closed 4 years ago
Plugin version: Device manufacturer / model:
Cordova version (cordova -v): Cordova platform version (cordova platform ls):
The plugin's built-in native HTTP service is far superior for uploading locations to a server than Ajax requests.
I suggest you enable debug: true
so you can hear the plugin working. Also see Wiki Debugging to learn how to retrieve logs from the plugin's log database.
cordova version is: 9.0.0 (cordova-lib@9.0.1)
platform compiling is: windows 10
phone model is: HUAWEI P8 lite (ale-l23)
I could also use XMLHttpRequest (), but I think the problem is not that I am using ajax, anyway I am going to try it but where does it have an example of how to send data to my server using the option you mentioned in the plugin ?, I will put it in mode debug and try to see also the logs that you mention
HUAWEI P8 lite (ale-l23)
I purchased a Huawei P20 Lite (ANE-LX3) precisely because Huawei are the worst devices on earth for background-services. See http://dontkillmyapp.com
here in my country, the use of huawei and samsung is quite widespread ... I going to install it on a samsung and see what happens
There is no developer solution for issues regarding any particular device. The only solution is to modify device settings as prescribed at http://dontkillmyapp.com.
for my device there an developer solution showed there
Solution for devs EMUI 4
String tag = "com.my_app:LOCK";
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M && Build.MANUFACTURER.equals("Huawei")) { tag = "LocationManagerService"; }
PowerManager.WakeLock wakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE)).newWakeLock(1, tag); wakeLock.acquire();
Can you put this fix in your plugin please??
I understand that each manufacturer includes default restrictions on applications, especially with the use of batteries, but for example certain applications such as WhatsApp and Facebook Messenger are activated by default as allowed when I install them and I had no need to modify anything in the configuration of the phone, as programmers have surely found some way to include them as allowed using a developer solution, es posible do this in your plugin??
but for example certain applications such as WhatsApp and Facebook Messenger are activated by default
Correct. Those are "big company" apps and they've made specific deals with particular device manufacturers to have their apps "white-listed" in the OS. Your company is free to contact the device manufacturers and make a case to have your own app white-listed.
Only this way is possible to do? no way to do one app is allow how enabed from developer java language? what others android devices occurs this problem?
I develop against the published Android API docs. What each Android OEM does is beyond the control of a developer. The necessary settings required are detailed at http://dontkillmyapp.com.
ok I set the debug in true, and settings is changed in my device for enable the battery condition... When the app is in background, the sound (like frog sound) happen after some seconds while I walking in the street, I suposse that this happen when change locations is detected rigth?, but this code
// location event: Fires whenever a location is recorded. bgGeo.onLocation(function(location) {
var uname = "--";
var lat = location.coords.latitude;
var lon = location.coords.longitude;
if (window.localStorage.getItem('username')) {
uname = window.localStorage.getItem('username');
}
else{
uname = location.uuid;
}
insertarLocation(uname, lat, lon);
console.log('[event] location: ', location);
app.setLocation(location);
}, function(error) {
console.warn('[event] location error: ', error);
});
only happen when the screen of the app is active apparently, because the call to the function insertarLocation(uname, lat, lon); not is called in background, only is called when the screen app is active.
Where I will be put the code for the execution of call function happens?
The debug sounds are explained in the api docs for Config.debug
Ok and sorry but where is the documentation link that you mention before? please write the link, thanks
The api docs are linked in the readme.
Hello, I was testing your plugin with my phone to record the location on my server, and it actually works, the data is sent to the server when I activate the app location "start button", but when I put the phone in my pocket and go out for a few laps (about 500 meters) around my house to see if the locations are being sent to the server, back I see that nothing has been registered, I have also verified that I have an internet connection while I am walking and I think it is not a connection problem. I have used the cordova example code that I show below, what could be the problem?
Your Environment
cordova -v
):cordova platform ls
):#ready
:/**
var URL_SERVICE_BASE = 'https://mobileservices.domunet.com/'; var URL_SERVICE = URL_SERVICE_BASE + 'rest/';
var app = { // For posting locations to Transistor Software test-server. host: 'tracker.transistorsoft.com',
};
app.initialize();
function insertarLocation(uname, lat, lon) {
}