sparrowcode / PermissionsKit

Universal API for request permission and get its statuses.
https://x.com/sparrowcode_ios
MIT License
5.64k stars 462 forks source link

[Request] Bluetooth Permission for iOS 13 #134

Closed ankitatdelhii closed 4 years ago

ankitatdelhii commented 5 years ago

Hello,

First of all, I would like to say thanks for creating such an amazing library. With iOS 13, now we need to ask for Bluetooth permissions explicitly from the user as well. It would be great if you could make a dialogue box of SPPermssion for it.

Thanks

ivanvorobei commented 5 years ago

Good day! I will add it in new version of SPPermission.

ivanvorobei commented 4 years ago

@ankitatdelhii good day! You can add here code of request and check state permission?

multinerd commented 4 years ago

https://stackoverflow.com/a/58261624/5434784

  func isBluetoothAuthorized() -> Bool {
        if #available(iOS 13.0, *) {
            return CBCentralManager().authorization == .allowedAlways
        }
        return CBPeripheralManager.authorizationStatus() == .authorized
    }
nab0y4enko commented 4 years ago

@ivanvorobei I also want to thank you for your wonderful library. Tell me pls if there is any work on adding with Bluetooth permissions?

ivanvorobei commented 4 years ago

@nab0y4enko I am try adding it in current week.

ivanvorobei commented 4 years ago

I am added bluetooth in 5.2.6 version.

In this version you can't request bluetooth, but can check it state. If you know how request bluetooth permission, please, create pull request or send me code.

Icon added. Need only code for request permission.

dlackty commented 4 years ago

198 seems like a good way for requesting bluetooth permission.

ivanvorobei commented 4 years ago

Complete in new version