Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Request permission returns permanentlyDenied when iOS app minimized while permission dialog is open #1423

Open
3 of 5 tasks
piotruela opened this issue Dec 23, 2024 · 0 comments

Comments

@piotruela
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

  1. Request for notifications permission on iOS (when current status is .denied meaning that it was not asked yet)
  2. 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant