delba / Permission

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

[Location] Listen to location permission changes always #17

Closed sunshinejr closed 8 years ago

sunshinejr commented 8 years ago

Hey Damien!

I've noticed stranger behaviour. When you request your Location for the first time, the notifications with status of permission is followed (so when you change from authorized to denied, the closure still updates for each change of permission).

I don't know if it was intended or not, but in this PR I think I've solved this problem, even though I don't know if this is the good way to go. With these small changes I'm getting Location permission updates even after relaunching the app with e.g. Authorized status. When I go back to settings and change it, then come back to app, it works as I expected.

Let me know what do you think about it and thanks again for great lib! 🎉

delba commented 8 years ago

Hey Luke!

I'm glad you bring this up because that's a part of the lib I wanted to fix.

It should behave exactly like the other permission types and only trigger the callback when the permission is explicitly requested.

The fix I was thinking about is:

I might fix it later today but tell me if you want to take a stab at it :smiley:

sunshinejr commented 8 years ago

Oh, I see. I can try with the PR, so I think this one can be closed for now 🐼