flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

[Bug]: Issue with `Permission.location.request()` Returning `isPermanentlyDenied` on iPhone 13 Mini with iOS 17.5.1

Open SD19767 opened this issue 1 year ago • 1 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [ ] Android
  • [X] iOS
  • [ ] Windows

Steps to reproduce

  1. add necessary permissions are deployed in the app’s Info.plist file as outlined below: image image

  2. call

dart 
  Future<bool> requestLocationPermission() async {
    var status = await Permission.location.request();
    return status.isGranted;
  }
  1. Build and run the project on an iPhone 13 Mini with iOS 17.5.1.

Expected results

The app should successfully return the WiFi name and BSSID of the connected network.

Actual results

PermissionStatus always return permanentlyDenied.

Code sample

Code sample
  Future<bool> requestLocationPermission() async {
    var status = await Permission.location.request();
    print('status: $status');
    return status.isGranted;
  }

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.3.1

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.22.4-0.0.pre.1, on macOS 14.5 23F79 darwin-arm64, locale
    zh-Hant-TW)
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google
    Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.92.2)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for Alvin的iPad. Ensure the device is
      unlocked and attached with a cable or associated with the same local area network as
      this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

SD19767 avatar Aug 26 '24 02:08 SD19767

Dear @SD19767,

I think that you forgot to add the required macros to the podfile. Please check 'Setup' 'iOS' section in the README. I'll close this issue for now.

Kind regards,

TimHoogstrate avatar Aug 26 '24 10:08 TimHoogstrate

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.

github-actions[bot] avatar Sep 09 '24 11:09 github-actions[bot]