Closed 4ty711 closed 4 years ago
Sounds normal to me. Read the wiki “Philosophy of Operation” then go outside for a nice 1km walk.
Btw, you don’t need Cordova-plugin-geolocation. This plugin has its own #getCurrentPosition method.
We have read the Wiki '' Philosophy of Operation ''. But it does not work anyway. We only get the first event when we are in a geofence region. Then we drove several times with the car and the running debugger. But we get neither the Exit Event and no further Motion Events. It just does not happen anymore. When we restart the app it is that we only ever get an event and nothing else. The creation of geofences works. We have already exchanged the GetCurrentlocation. Also without change.
Huawei devices are the worst devices on earth for background operation. The OS is like a “nanny state”.
One of my 11 test devices is a Huawei P20 Lite. I got it to work by following the directions on the link above.
Hello, thank you for your very fast answer. But so we can´t use your nice plug in for all mobile phones ? We have test on huawei tablet media pad 5 and on a ulefone node 7. thx for your help.
You can use it for any phone, the user must follow the instructions at http://dontkillmyapp.com. As you can see there: “No Developer Solution”.
The fault is entirely with the device manufacturer violating the Android API and how the docs say things are supposed to work.
I regularly field test using the following devices:
We only get one motion event and then the service stops. If we start with driving the motion event don´t change to driving state. Now we have test with 4 mobile phones. thx for your help.
If we start with driving the motion event don't change to driving state
Yes, that's what Huawei's device do until you modify the device's settings according to http://dontkillmyapp.com. The OS swallows events from the Motion API and refuses to pass them on to the app. You'll find that those events actually do come through later when you next unlock the device. Of course by then, those events are useless.
Follow the directions for you device in http://dontkillmyapp.com and you can make it work.
You think we should implement this Api in our app or we must change manually the settings in the settions section of android ?
The directions at http://dontkillmyapp.com are very clear. The user much perform those actions in the settings of the device. Huawei devices are the worst. They break Android background services. Google is full of other developers having the same problem
Now we have tested and we have detect the following. If we starts Google Maps in the background and we see the android location icon on the top bar the app works fine and we get motion events !?
My Huawei P20 works perfectly after following the directions in http://dontkillmyapp.com. I don't run any other apps and I don't even use the device. I simply place it in my backpack, along with my other 10 test-devices and go. The plugin does not require have some other app running for it to work.
Hello Chris, first of all thank you for your quick answers. We have implemented your note and removed the current location from the API. Also, we have changed the settings as described in http://dontkillmyapp.com. But only if Google Maps is open will we receive motion events. Can you please look again in our code if there is something wrong from your point of view? We have a big project and we want to start soon. thx
There's nothing wrong with your code.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.
Your Environment
cordova -v
): 9-0-0cordova platform ls
): android 8.1.0Plugin config provided to
#ready
:Expected Behavior
Motionchange and Location Events should be fired
Actual Behavior
After the first start(), one location and motionchange event ist fired, then it seems to stop tracking the location.
Debug logs
There are no errors or warnings...