delba / Permission

A unified API to ask for permissions on iOS
MIT License
2.91k stars 324 forks source link

LocationAlways callback when selecting locationWhenInUse #122

Open sipanhf opened 6 years ago

sipanhf commented 6 years ago

Hi.

I am developing an app that asks the users for permission locationAlways. The problem I am experiencing is: asking the locationAlways permission will present the permissions dialog. First time the dialog is presented one of the options is "Only While Using the App". The callback function does however not get called when selecting this option.

This is my code

        let permission = .locationAlways
        permission.request({ (status) in
            print("\(status.rawValue)")  // closure never gets called
            if status == .authorized{
                // do something
            }else{
                // do something else
            }
        })