-
Notifications
You must be signed in to change notification settings - Fork 406
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
Android location access: User cannot choose "Allow all the time" #688
Comments
Yes, that appears to be the fix. See: |
The possible correction of speckro in combination with the comment of spinninghamster solved the problem for us. However, it only worked for Android 10. Android <= 9 also requested permission, but can no longer start the background process. EDIT: After applying the fix of speckro the backgroundgeolocation plugin throws following after giving permissions on Android 9: |
What if you target API level 28 instead of 29? |
The problem remained the same. However we were able to resolve the issue by adding following lines inside of BackgroundGeolocationFacade.java :
... and by changing the public void start() function in the same file to :
We also added following in the AndroidManifest.xml file: |
Hi guys, thanks for that fix ! But now I have the notification "Background Tracking ENABLED" which is always there, like #699 Do you know how to clear it ? |
Hi Guys, thanks too. It also fixed it for me. @dabaaaz If I "swipe" my app (close complete). My notification disappears (if stopOnTerminate: true). Cheers |
There's also the service type that this docs describe: |
@DominikMair do you have a fork with your fix by any chance? |
Sent a PR, I hope it will be merged... |
@DominikMair thanks for your fix. Work as I expected |
@OstapBO @DominikMair does this code still working fine ? |
After deeply looking into this subject and looking for info I found this great lecture: <service android:enabled="true" android:exported="false" android:name="com.marianhello.bgloc.service.LocationServiceImpl"/> I still don't have most of the answers as this still requires testing... |
Reading the plugin info, and Android description for permissions (https://developer.android.com/training/location/permissions?hl=fr) i think no need background persimission. |
This is only in the case where you set |
@chacabuk: You are right. When your app enters the background and you start a foreground service with a notification, your app is considered to be in the foreground and you don't need permission ACCESS_BACKGROUND_LOCATION. An exception is when you use the geofence service. Then you need permission ACCESS_BACKGROUND_LOCATION as noted here. |
@HarelM can you extend your comment? |
Part of the configuration API is this flag - where you define the provider, interval, distance etc. Let me know if you can't find it and I'll send you a link to my project... |
@HarelM |
My mistake, the name of the property is: |
@HarelM, Thanks for your time. My source code is realy simple:
|
Two comments:
|
@HarelM |
The link doesn't work, but yes: |
hello ;it's still not working for me , |
First I want to thank you for providing this plugin!
Environment
Android API level 29
Context
When the user is asked how the device is allowed to access the location, no option "Allow all the time" is shown.
Expected Behavior
The following location access options should be shown to the user:
Actual Behavior
The following location access options are currently shown to the user:
Possible Fix
Update array PERMISSIONS inside file BackgroundGeolocationFacade.java
Also see Android docs. "If your app targets Android 10 or higher, you must declare the ACCESS_BACKGROUND_LOCATION permission ...".
Steps to Reproduce
Use plugin with Android API level 29 and check location access dialog.
The text was updated successfully, but these errors were encountered: