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

Bluetooth perm request only shows denied alert once #227

Closed gumbypp closed 3 years ago

gumbypp commented 3 years ago

Thanks for a great lib.

I just tested the latest release (5.5.7). If you deny access to Bluetooth and press the allow button, you'll see the "go to settings" alert. But if you press it again (without restarting the app), nothing happens. I think that this is due to the SPPermissionBluetoothHandler.shared singleton such that a second call to request:

    func request(completion: @escaping ()->()?) {
        SPPermissionBluetoothHandler.shared.completion = completion
    }

does nothing. My proposed fix for the original issue (https://github.com/ivanvorobei/SPPermissions/issues/202#issuecomment-831679464) seems to work properly in this respect, but there might be a better solution.

ivanvorobei commented 3 years ago

Thanks for reported, checking it.

ivanvorobei commented 3 years ago

Fixed in5.5.8.