flutter-permission-handler
flutter-permission-handler copied to clipboard
[Bug]: Request permission returns `permanentlyDenied` when iOS app minimized while permission dialog is open
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)
- [ ] Android
- [X] iOS
- [ ] Windows
Steps to reproduce
- Request for notifications permission on iOS (when current status is
.deniedmeaning that it was not asked yet) - Minimize the application by clicking home button/sliding up
Expected results
The dialog should either remain open or the PermissionStatus should stay as .denied.
Actual results
Dialog closes and Permission.notification.request() returns PermissionStatus.permanentlyDenied.
After refreshing the app the status is PermissionStatus.denied again
Code sample
Code sample
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: TextButton(
onPressed: () async {
final result = await Permission.notification.request();
print(result);
},
child: const Text('Request Permission'),
),
),
),
);
}
}
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
11.3.1
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.0.1 24A348 darwin-arm64, locale
en-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.95.3)
[✓] Connected device (5 available)
[✓] Network resources
• No issues found!