Closed formatCvt closed 4 years ago
This is an interesting feature which we should implement. Official documentation can be found here: https://developer.android.com/about/versions/10/privacy/changes#app-access-device-location
any news?
@formatCvt Been working on this a few days now and can say you might see something at the end of the week.
@StijnWoerkom Awesome! Thanks!
any news?
@formatCvt The LocationPermissionLevel respects now granted permissions, but until I am done with the whole update there is nothing available yet. I will make a push request when I'm done and I will let you know.
Pull request is out for code review. I Will let you know when the new features are available.
Any progress here?
Still working on the pull-request. Some things need a bit more attention before we are able to push the new updates to the master branch.
Still working on the pull-request. Some things need a bit more attention before we are able to push the new updates to the master branch.
Any updates?
Working on final touches since the pull request missed some important points. I am trying to release an update this week. I will let you know when there is something available.
Any news?
Guys, any updates?
Today I am releasing an update on previous pull-request. I will let you know when the code is reviewed and when there is an update available.
@formatCvt The Permissions Plugin has permission requests for foreground and background permissions. Google changed its regulations for the permissions in Android 10. For your case, you should involve the background permissions in your manifest. We have made the plugin compatible with the background location access.
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && permission.equals(Manifest.permission.ACCESS_BACKGROUND_LOCATION))
Here a little bit more detailed information, this issue is supported since the last official version of the plugin. Depending on what you have listed in your AndroidManifest.xml
file you can request permissions to access location services.
Depending on the supplied enum value you request the following permissions:
ACCESS_COARSE_LOCATION
and / or ACCESS_FINE_LOCATION
permissions in your AndroidManifest.xml file (on Android Q this means "Keep while in use");ACCESS_BACKGROUND_LOCATION
permissions on Android Q and newer. Otherwise it defaults back to the old permission system;AndroidManifest.xml
file and which permissions the user selected in the dialog (on Android Q and newer). Otherwise it will default back to the old behaviour.PermissionStatus geolocationPermissionStatus = await _locationPermissions.requestPermissions(permissionLevel: LocationPermissionLevel.locationWhenInUse);
returns PermissionStatus.granted
but after that
final PermissionStatus geolocationPermissionStatus = await _locationPermissions.checkPermissionStatus(level: LocationPermissionLevel.locationWhenInUse);
returns PermissionStatus.denied
On my manifest I have only this
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@DenisBogatirov I have created a new issue (#29 ) for your request. Hopefully we can continue the discussion there.
Launching lib\main.dart on TECNO K7 in debug mode... Running Gradle task 'assembleDebug'... C:\Program Files\flutter.pub-cache\hosted\pub.dartlang.org\location_permissions-2.0.5\android\src\main\java\com\baseflow\location_permissions\LocationPermissionsPlugin.java:284: error: cannot find symbol || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && permission.equals(Manifest.permission.ACCESS_BACKGROUND_LOCATION)); ^ symbol: variable Q location: class VERSION_CODES C:\Program Files\flutter.pub-cache\hosted\pub.dartlang.org\location_permissions-2.0.5\android\src\main\java\com\baseflow\location_permissions\LocationPermissionsPlugin.java:284: error: cannot find symbol || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && permission.equals(Manifest.permission.ACCESS_BACKGROUND_LOCATION)); ^ symbol: variable ACCESS_BACKGROUND_LOCATION location: class permission C:\Program Files\flutter.pub-cache\hosted\pub.dartlang.org\location_permissions-2.0.5\android\src\main\java\com\baseflow\location_permissions\LocationPermissionsPlugin.java:310: error: cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && hasPermissionInManifest(Manifest.permission.ACCESS_BACKGROUND_LOCATION, context)) { ^ symbol: variable Q location: class VERSION_CODES C:\Program Files\flutter.pub-cache\hosted\pub.dartlang.org\location_permissions-2.0.5\android\src\main\java\com\baseflow\location_permissions\LocationPermissionsPlugin.java:310: error: cannot find symbol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && hasPermissionInManifest(Manifest.permission.ACCESS_BACKGROUND_LOCATION, context)) { ^ symbol: variable ACCESS_BACKGROUND_LOCATION location: class permission C:\Program Files\flutter.pub-cache\hosted\pub.dartlang.org\location_permissions-2.0.5\android\src\main\java\com\baseflow\location_permissions\LocationPermissionsPlugin.java:311: error: cannot find symbol permissionNames.add(Manifest.permission.ACCESS_BACKGROUND_LOCATION); ^ symbol: variable ACCESS_BACKGROUND_LOCATION location: class permission 5 errors
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':location_permissions:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 8s Finished with error: Gradle task assembleDebug failed with exit code 1
Is there any updates on why app on "Allowed Only While in Use " gives GeolocationStatus.denied
I think its because am using android 10 SDK plugin to build my app ...and there was breaking changes on location on android 10 api 29
On Apr 9, 2020 14:15, "Bikash Katwal" notifications@github.com wrote:
Is there any updates on why app on "Allowed Only While in Use " gives GeolocationStatus.denied
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Baseflow/flutter-permission-plugins/issues/21#issuecomment-611473116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGI4AZXXGW6IINPB6HGO7HTRLWU6LANCNFSM4JCVB3FQ .
🚀 Feature Requests
Add permissions levels support for the Android platform
Contextualize the feature
The LocationPermissions().checkPermissionStatus(level: LocationPermissionLevel.locationWhileInUse) is always returning PermissionStatus.denied on Android 10 and doesn't respect granted permissions.
Describe the feature
Utilize LocationPermissionLevel enum on the Android platform
Platforms affected (mark all that apply)