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

Permissions.CheckStatusAsync<Permissions.Bluetooth> on iOS returns Granted when don't allow is chosen #22070

Open
ckrutsinger opened this issue Apr 26, 2024 · 4 comments
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@ckrutsinger
Copy link

ckrutsinger commented Apr 26, 2024

Description

status = await Permissions.CheckStatusAsync<Permissions.Bluetooth>();
is returning PermissionStatus.Granted even though I choose Not Allowed.

Steps to Reproduce

iOS ONLY

  1. Include this in Info.plist:
	<key>NSBluetoothAlwaysUsageDescription</key>
	<string>app collects location data to enable vehicle services including current location and event location</string>
  1. Upon app install, you should be prompted for Bluetooth permission, choose "Don't Allow". If not prompted, use Settings app to disallow Bluetooth for app
  2. After app launches, call await Permissions.CheckStatusAsync<Permissions.Bluetooth>() and response will be PermissionStatus.Granted instead of PermissionStatus.Denied Demo app will put the permission status into the click me button upon being clicked

Link to public reproduction project repository

demo app

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17.4

Did you find any workaround?

No workaround found.

Relevant log output

no relevant logs
@ckrutsinger ckrutsinger added the t/bug Something isn't working label Apr 26, 2024
@phillippschmedt
Copy link

@ckrutsinger You could try if you also get the issue with the latest MAUI version of 8.0.21: #22059

@ksoftllc
Copy link

Today I tried on 8.0.21 and 8.0.14. Both still exhibit returning Granted even if Don't Allow is chosen at install. I wonder if the issue has anything to do with the presence of both permission tags in Info.plist:

	<key>NSBluetoothPeripheralUsageDescription</key>
        ...
	<key>NSBluetoothAlwaysUsageDescription</key>

On first launch after install, the app prompts with the string for Always usage. There is no prompt for the now deprecated Peripheral usage permission. So it is the Always usage I am not allowing. Is the permission check returning the Peripheral permission, which apparently doesn't require explicit authorization? await Permissions.CheckStatusAsync<Permissions.Bluetooth>(); doesn't have an option to inquire about the Always permission.

@ckrutsinger
Copy link
Author

I have added a demo project which replicates the bug on latest MAUI version. See MainPage.xaml.cs

@QianaJiao
Copy link
Collaborator

Verified this issue with Visual Studio 17.10 Preview 5 (8.0.21&8.0.7). Can repro on iOS platform with sample project.

@QianaJiao QianaJiao added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 30, 2024
@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants