Baseflow / Baseflow/flutter-permission-handler

Motion permission isGranted sometimes return FALSE on iOS even though the permission is granted by the user

Open
#1,294 12 comments 2 reactions 1 assignee Claimed by @mvanbeusekom View on GitHub
platform: ios
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)

- [ ] Android
- [X] iOS
- [ ] Windows

### Steps to reproduce

1. Request motion sensor on iOS
2. Check if permission is granted

### Expected results

await Permission.sensors.isGranted;

Should return correct bool value.

### Actual results

await Permission.sensors.isGranted;

On rare occasions FALSE is returned even though user granted permission.

### Code sample

Request sensor for iOS

```dart
if (Platform.isIOS) {
await Permission.sensors.request();
}
```

Check granted status for iOS

```dart
bool checkDeviceMotion = await Permission.sensors.isGranted;
```

### Screenshots or video

Screenshots or video demonstration

[Upload media here]

### Version

11.3.0

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.3.1 23D60 darwin-x64, locale en-RS)
• Flutter version 3.19.3 on channel stable at /Users/admin/Flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ba39319843 (3 weeks ago), 2024-03-07 15:22:21 -0600
• Engine revision 2e4ba9c6fb
• Dart version 3.3.1
• DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/admin/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_SDK_ROOT = /Users/admin/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15C500b
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.87.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.84.0

[✓] Connected device (3 available)
• iPhone 12 mini (mobile) • 1B3193E4-B683-4907-B557-B2B0F2F637BC • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 14.3.1 23D60 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.58

[✓] Network resources
• All expected network resources are available.

• No issues found!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.