mirror of
https://github.com/inthehand/32feet.git
synced 2026-10-28 14:06:34 +08:00
28 lines
958 B
C#
28 lines
958 B
C#
using static Microsoft.Maui.ApplicationModel.Permissions;
|
|
|
|
namespace InTheHand.Permissions
|
|
{
|
|
/// <summary>
|
|
/// BluetoothPermissions (.NET MAUI on iOS).
|
|
/// </summary>
|
|
public partial class BluetoothPermissions : BasePlatformPermission
|
|
{
|
|
public override Task<PermissionStatus> CheckStatusAsync()
|
|
{
|
|
switch (CoreBluetooth.CBManager.Authorization)
|
|
{
|
|
case CoreBluetooth.CBManagerAuthorization.AllowedAlways:
|
|
return Task.FromResult(PermissionStatus.Granted);
|
|
|
|
case CoreBluetooth.CBManagerAuthorization.Denied:
|
|
return Task.FromResult(PermissionStatus.Denied);
|
|
|
|
case CoreBluetooth.CBManagerAuthorization.Restricted:
|
|
return Task.FromResult(PermissionStatus.Restricted);
|
|
|
|
default:
|
|
return Task.FromResult(PermissionStatus.Unknown);
|
|
}
|
|
}
|
|
}
|
|
} |