Open kevinmcody opened 7 months ago
Are you "awaiting" the promise when calling start?
window.BackgroundGeolocation.start().then(result => { debugger; window.BackgroundGeolocation.checkStatus(function (state) { debugger; }); });
At the first debugger; result = "OK" At the second, state.isRunning = false
Hello @HarelM,
Do you have any update on the issue?
I'm facing the exact same issue
I don't know how to reproduce this. I would advise to attach a debugger and see what went wrong...
Hello @HarelM,
I think I've found the problem.
We are migrating all the plugins and code to be compatible with Android 14 and MABS 10.
One of the changes we did, was changing the Android Target SDK to 34. By doing this the application stopped running in the background and it was returning the value IsRunning=false.
I've downgraded the target SDK version to 33 and it solve the issue. The value IsRunning=true and the notification is shown on the phone tray.
By investigating a little bit more on the issue I come to the conclusion that the plugin is not prepared to handle the ACCESS_BACKGROUND_LOCATION permission if the app is pointing to SDK 34.
Is it possible to include the option to access the location "All the Time"?
You have all it's needed in this link: https://developer.android.com/develop/sensors-and-location/location/permissions#background-dialog-target-sdk-version
See my comments here:
There might be a different bug related to sdk 34, but I would like to avoid adding this permission and I'm hoping this permission is not required for sdk 34. But feel free to investigate. I haven't yet moved my app to sdk 34, so that can explain why I haven't seen this issue.
For now Google, Android SDK 33 is the required version if we want to submit a new build to the stores.
I think in the end of the year 2024 we will need to move to SDK 34 and do the upgrade on the code.
If all that's missing is the permission, then you can do it now, externally, as I wrote in the linked issue. I hope there's a different solution to this issue though.
Is the plugin being upgraded to target Android SDK 34 again? I've just started using this and I also noticed that status.isRunning is always FALSE even after a start() call.
And I'm not sure, but I think this is also affecting the stop() function. The success and failure handlers for the stop promise aren't being called, and I'm guessing this has something to do with it.
Which version can I use that still targets 33?
I personally am not using isRunning but I do use it with SDK 34, so if this is something that you need fixed please investigate and open a PR. Thanks!
Describe the bug After I call the start() method, a subsequent call to checkStatus returns: authorization:1 hasPermissions:true isRunning:false locationServicesEnabled:true
I then tried to get log entries, using the getLogEntries method, and received the following error: code: 1003, message: 'Getting logs failed', cause: Value INFO at 1 of type java.lang.String cannot be converted to int
To Reproduce Steps to reproduce the behavior:
Expected behavior I would expect isRunning: to be true. I would also expect getLogEntries to not throw an error
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.