-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get locations when in background #126
Comments
Make sure you use startFouregrond and no battery optimization is applied to the app. |
I was using mauron85, but was running into some permission issues, which were fixed when I switched to this one, but its not working in the background. I assume these are the ones you mean: Thanks |
Also battery optimization in the app settings in the OS. |
Ok, will check out the power settings in the OS, hadnt thought of that. I have been using android studio, no real stand out issues. |
Is start and end task required, or just for long IOS tasks? |
Here is what happens in the log when it goes into background: D/CordovaActivity: Paused the activity. |
@HarelM is there a power setting specific to android? The setting I see in the documentation is for IOS, which I have set as well, but wondering if there is something else specific for android? I have the app working in background, but it needs to be connected via USB, which makes me think of your power recommendations. The OS settings are to not optimize for battery and to allow battery usage in background, but still soon as I disconnect from power it no longer records points in background. |
No, just the OS battery optimizing... |
@HarelM Are there different settings for background vs sleep? If I just put the app in the background of the phone, say work on a different app, it still works fine, even disconnected from the usb cable. But if I let the device go dark, if it is not plugged into USB power, it stops working, until you plug it in or open the device back up. |
I'm not aware of different settings. |
@miistakis , have you found something to fix this issue ? I have the same issue. In foreground, I got the entire ride, in background, it stops and resend location when app is resumed. For information, I have disabled the battery optimization from OS and still not working. |
@mrshlle I have a user base of 50k users that uses this plugin and it works as expected. |
@mrshlle No, I found the issue was device specific, or maybe that make model (Umidigi A9), and worked on every other device I tested on, so I just released it as is, and have yet to have a complaint. |
@HarelM yep, @miistakis I see, I will test on other devices then, hoping mine is not used a lot. Thanks for your replies |
I think the issue may be related to mauron85#688 and permissions on new android devices, could that fix be implemented as using this repo does not allow always on some of our devices. If you think possible I'll give it a go. |
I don't have issues in my App, so I can't relate to this issue. |
@HarelM The Sync API is not receiving list of Locations. I have updated the url and syncurl in parameters. |
Hi @HarelM, I am trying to use this plugin again because being able to track location when app is killed is really usefull. For the moment, I use @capacitor-community/background-geolocation plugin. I know you are not facing this issue, so I just would like to know if you can help me finding the approximate same method, that is called when it's time to pause the plugin. (In the other plugin, you can find it on this file, line 329) |
Sorry, I can't help unfortunately. |
Some Manufacturers have very aggressive battery saving apps, that tend to disable any background app they dont know about. So first of all it is better to check battery saver app (instruction on how to do this depends on manufacturer of the phone). |
This can be fixed by just adding cordova-plugin-diagnostics plugin to request permissions and by adding required permissions to your config file |
My solution is to push a high-priority Firebase message and location permission is always allowed. |
This is on an Andriod os 10, using the 1.1 plugin as the app isnt andriodx enabled.
Everything works great in foreground, but soon as it goes into background it suspends activity, until I bring it back to foreground. Any suggestions on what to try would be appreciated.
The text was updated successfully, but these errors were encountered: