Baseflow / Baseflow/flutter-permission-handler
[Bug]: Hello, I have encountered a problem,Android phones request communication permissions from users,"Permission.phone.request()", but always return "granted"
- Dominant language
- Dart
- Stars
- 2.2k
- Forks
- 970
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 2
Description
### Please check the following before submitting a new issue.
- [X] I have searched the [existing issues](https://github.com/baseflow/flutter-permission-handler/issues).
- [X] I have carefully [read the documentation](https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler/README.md) and verified I have added the required platform specific configuration.
### Please select affected platform(s)
- [X] Android
- [ ] iOS
- [ ] Windows
### Steps to reproduce
1. Execute 'var status=await Permission. phone. status;', status returns' denied'
2. Afterwards, execute the code "status=await Permission. phone. request();". At this point, the application does not apply for permission from the user, but directly returns the "granted" status
### Expected results
Apply for corresponding permissions from users
### Actual results
Directly return 'granted'
### Code sample
```dart
bool hasPhonePermission = await requestPermissions(Permission.phone);
Future requestPermissions(Permission service) async {
var status = await service.status;
if (status == PermissionStatus.granted || status == PermissionStatus.limited) {
return true;
} else {
// status = await Permission.location.request();
status = await service.request();
if (status == PermissionStatus.granted || status == PermissionStatus.limited) {
return true;
} else {
return false;
}
}
}
```
### Screenshots or video
_No response_
### Version
11.0.1
### Flutter Doctor output
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3 22E252 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
[✓] VS Code (version 1.87.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
Contributor guide
Assessment
This issue has not been assessed yet.