flutter-permission-handler
flutter-permission-handler copied to clipboard
Got permanentlyDenied when location service is disabled
🐛 Bug Report
The Permission.locationWhenInUse.status
method is returning permanentlyDenied
if the location service was disabled in iPhone.
On Android it's working fine.
Expected behavior
I've created a logic in these steps:
- Request permission status
- If is denied, call my request permission method
- My request permission method will check if service is disabled (if has a service)
- If service is disabled, this method will return a specific error and, in some cases, I can request the user to enabled the service, opening the app settings
I believe that returning a permanentlyDenied
status just for iOS is not correct. Should keep the same behavior for Android/iOS.
Reproduction steps
- Disable the iOS location service
- Request Permission.locationWhenInUse.status
Configuration
Version: 8.1.6
Platform:
- [X] :iphone: iOS
- [ ] :robot: Android
I'm running into something similar; however, I didn't deny the location request. The app's permission is set to "While Using the App"; however, Permission.location.request()
always returns permanentlyDenied
.
This started after updating to 8.2.2
from 6.0.0
. For now, I've reverted back to 6.1.3
and everything is working as expected.
The same with await Permission.photos.request()
return permanentlyDenied
:
ios 14.4
This is working again on version 8.2.5; iOS 15.0.
Just tried with version 8.2.5 and got the same problem...
@emersonsiega, what version of iOS are you testing on?
iOS 14.8
There were some changes in location permissions made in iOS 15. Perhaps those changes somehow fixed the issue with this plugin.
any update on this? i still got this issue in iOS 15 using 9.2.0 version
I'm resolving it by adding the following items to podfile: config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1',
]
Any update? I still have an issue on iPhone 7 with iOS 15.4.1.
any update to this issue, still getting same errror permanentlyDenied