I’m using this plugin: permission_handler: ^10.4.3
Because I need to scan for nearby WiFi networks, which requires location permission. However, in my existing project that I’ve.
I’ve simultaneously applied for location, locationWhenInUse, and locationAlways permissions, but only the locationAlways permission is taking effect.
However, in a newly created project, I am able to request all of these permissions successfully.
2
Answers
For permission to handle things, you may need to write some platform-specific code into their respective Android/iOS folder.
Android (write in AndroidManifest.xml):
iOS (write in Info.plist):
Reference link: https://pub.dev/packages/permission_handler
I tested this permission handling on Pixel 6a (API 33) Android 13. & it is working as documented & expected. That says that depending on the platform & version, the result may differ or vary.
Android (write in AndroidManifest.xml):
Lib (write in any .dart file):