Baseflow / flutter-permission-handler

Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
https://baseflow.com
MIT License
2.02k stars 836 forks source link

locationAlways permission isGranted returns true when location permission is set to "while using" #1011

Open noah-depriest opened 1 year ago

noah-depriest commented 1 year ago

๐Ÿ› Bug Report

First off, thank you for taking the time to support this plugin. It's been a huge help for us and I know handling permissions on multiple platforms and versions is a pain.

We've been having some trouble around the locationAlways permission, and for us we're stuck on this problem on iOS: If the app's location permission is set to "while using", the result of await Permission.locationAlways.isGranted will return true.

Expected behavior

The expected behavior is that if the location permission is set to anything other than "always" (including "while using"), then await Permission.locationAlways.isGranted should return false.

Reproduction steps

  1. Request location in your app and select the "while using" option
  2. Run the following statement after this final isGranted = await Permission.locationAlways.isGranted
  3. Confirm that isGranted has a value of true

Configuration

Version: permission_handler - 10.2.0

Platform:

noah-depriest commented 1 year ago

Update on this: After updating iOS to version 16 I can't seem to reproduce the issue anymore. Maybe the update cleared out some weird state on the phone, or maybe something incompatible with that version? Leaving open for now in case anyone else has had problems with iOS 15.

MrLongg71 commented 1 year ago

I have the same problem. How to fix it?

lasted version permission_handler: ^10.4.5

Reproduce step:

iOS: 16.4 flutter version: 2.10.3

christianwbc commented 11 months ago

Experiencing the same problem on the latest version of permission_handler

andy-weinstein commented 10 months ago

I am also seeing this behavior on the simulator for iOS 16.2 using permission_handler 11.0.1

i-jared commented 8 months ago

I have this on ios 17.2.1 permission_handler 11.1.0

2ChanWoo commented 8 months ago

I still have this on ios 17.1.2 & 16.6.2 permission_handler 11.1.0

JaeHeee commented 7 months ago

@mvanbeusekom Please check this case. ๐Ÿ™

iOS 17.2 permission_handler : 11.2.0

I've been testing for the Permission.locationAlwaysstatus.

Before calling Permission.locationAlways.requset(), I called Permission.location.requset()or Permission.locationWhenInUse.requset() and the value of Permission.locationAlways status was different depending on what I did.

  1. Permission.location.requset()was called first and Permission.locationAlways.requset() was called. 1-1. Select Allow Once return denied 1-2. Select Allow While Using App return granted

  2. Permission.locationWhenInUse.requset() was called first and Permission.locationAlways.requset() was called. 2-1. Select Allow Once return denied 2-2. Select Allow While Using App show locationAlways dialog

  3. Permission.locationAlways.requset()was called first 2-1. Select Allow Once return granted 2-2. Select Allow While Using App return granted

Thank you.