[Bug]: Hello, I have encountered a problem,Android phones request communication permissions from users,"Permission.phone.request()", but always return "granted"
Please check the following before submitting a new issue.
- [X] I have searched the existing issues.
- [X] I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- [X] Android
- [ ] iOS
- [ ] Windows
Steps to reproduce
- Execute 'var status=await Permission. phone. status;', status returns' denied'
- 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
bool hasPhonePermission = await requestPermissions(Permission.phone);
Future<bool> 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
i have a similar issue. All the same, but var status = await Permission.microphone.request(); returns denied.
on Andriod 14 i manually revoked camera and mic permission and try to set permission with the request() method.
camera request works fine, i have native popup to grant or deny, but the microphone request doesn't work for me, there is no pop up and response - denied.
PS
permission_handler: ^11.3.0
Hi @Yolanda2001820,
Thank you for submitting this issue. To look into this issue it would be nice if you could also supply the following information:
- Do you experience this issue on a particular device or many Android versions? If only on a particular device can you provide us with the make and model and the Android version it is running?
- Did you declare the permissions (as mentioned in the Android section of the README.md file) in the your
android/app/src/main/AndroidManifest.xmlfile? Could you include the contents of theAndroidManifest.xmlfile to this issue?
Hi @Yolanda2001820,
Thank you for submitting this issue. To look into this issue it would be nice if you could also supply the following information:
- Do you experience this issue on a particular device or many Android versions? If only on a particular device can you provide us with the make and model and the Android version it is running?
- Did you declare the permissions (as mentioned in the Android section of the README.md file) in the your
android/app/src/main/AndroidManifest.xmlfile? Could you include the contents of theAndroidManifest.xmlfile to this issue?
Hello, thank you for your reply. Currently,Xiaomi phones with Android 13 and above and its sub brand Redmi phones have this issue. Other brands .
This is my AndroidManifest.xml file
i meet the same problem