Open mivewi opened 5 years ago
Huawei phones by default have agressive power management , you have to disable it for your app else it will shut it down regardless of what you do.
https://help.runtastic.com/hc/en-us/articles/212633165-Help-for-GPS-Problems-on-Android-Phones
Thanks for the answer.
I came from the cordova world and used a similar plugin on the same phone, which I did not shut down in background and the underlaying is still android, so is there any settings I could set on the plugin or do something different, to keep it on longer?
None that I or any of the major running apps (go on there sites) know about. It's a general android issue on more modern devices.
Okay I did what it said under huawei, I'm gonna test it and post back here on my findings.
Still goes out after a few minutes. I'm sure somethings wrong...
Mine just ran 24hrs in the background. Must be an issue in the way you wrote the notification service.
Thanks for the reply. Can you share your project so I could test exactly that on my phone? Maybe by sending it in an email?
It's a commercial application, was a soak test. Did you try running a third party app like runkeeper ? If that keeps working it's your app, if it doesn't it's your phone.
You could look to see how we do it here: https://github.com/Azure-Samples/MyDriving/tree/master/src/MobileApps/MyDriving
Bug Information
Version Number of Plugin: 4.5.0.6 Device Tested On: Huawei P Smart Simulator Tested On: Version of VS: 2017 - 15.9.7 Version of Xamarin: 3.6.0.264807 Versions of other things you are using: Microsoft.CSharp: 4.5.0 Xamarin.Essentials: 1.0.1 Newtonsoft.Json: 12.0.2
Steps to reproduce the Behavior
1# Implement service as "Klewerro" did in: https://github.com/jamesmontemagno/GeolocatorPlugin/issues/272 2# Start app 3# Set app in background 4# Shut off devices screen
Expected Behavior
Actual Behavior
After 5 mins:
Code snippet
My service code are:
It uses a ViewModel which is is implemented like this:
I call the service through a interface:
I call the service like this:
Screenshots
Not really applicable.
Other
I'm new to Xamarin and services, and the mydriving app is way to complicated for me, thats why I've used Android background updates SIMPLE example #272
Thanks a lot for looking into my case, I've used a lot of time even getting it to run.