Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ivanvorobei/SPPermissions i…
Browse files Browse the repository at this point in the history
…nto main
  • Loading branch information
ivanvorobei committed Jun 6, 2021
2 parents 709ac1f + 275d4f8 commit 10bdb38
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/SPPermissionsBluetooth/SPBluetoothPermission.swift
Expand Up @@ -41,7 +41,15 @@ public class SPBluetoothPermission: SPPermissions.Permission {
open var usageDescriptionKey: String? { "NSBluetoothAlwaysUsageDescription" }

public override var status: SPPermissions.PermissionStatus {
if #available(iOS 13.0, tvOS 13, *) {
if #available(iOS 13.1, tvOS 13.1, *) {
switch CBCentralManager.authorization {
case .allowedAlways: return .authorized
case .notDetermined: return .notDetermined
case .restricted: return .denied
case .denied: return .denied
@unknown default: return .denied
}
} else if #available(iOS 13.0, tvOS 13.0, *) {
switch CBCentralManager().authorization {
case .allowedAlways: return .authorized
case .notDetermined: return .notDetermined
Expand Down

0 comments on commit 10bdb38

Please sign in to comment.