PermissionsKit icon indicating copy to clipboard operation
PermissionsKit copied to clipboard

Suggestion: add callback method to determine whether to authorize status

Open GPX-NSlog opened this issue 3 years ago • 1 comments

Steps to reproduce:

  1. Open the app for the first time and request notification permission. Click Allow
  2. Manually open the system settings page and turn off the App notification permission
  3. Open the app again and request notification permission. Calling the request method will still take the request callback scheme
image

GPX-NSlog avatar Aug 19 '22 03:08 GPX-NSlog

Got bug. will research it.

ivanvorobei avatar Aug 20 '22 09:08 ivanvorobei

I think you should completion (granted, error) in this code:

public override func request(completion: @escaping () -> Void) {
        let center = UNUserNotificationCenter.current()
        center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in
            DispatchQueue.main.async {
                completion()
            }
        }
    }

lexuanquynh avatar Jul 04 '23 04:07 lexuanquynh

It's stored by system. can't update it. same troubles with location, system not provide right data always

ivanvorobei avatar Jul 04 '23 09:07 ivanvorobei