nickoneill / PermissionScope

Intelligent iOS permissions UI and unified API
MIT License
4.85k stars 507 forks source link

Static status methods (except bluetooth & motion) #156

Open retendo opened 8 years ago

retendo commented 8 years ago

Added the ability to get permission statuses (except bluetooth & motion) without creating a PermissionScope instance. This prevents crashes, when trying to get a status from a different thread than the main thread, as it doesn't try to do any view stuff.

retendo commented 8 years ago

I also added jetbrains product files to the .gitignore. Sorry for not keeping this separate.

nickoneill commented 8 years ago

Hi @retendo, some questions about the motivation for this:

How were you accessing this on a background thread where it was crashing? Does PermissionScope().statusLocationAlways() (or equivalent) not work for you?

And please remove the jetbrains ignores. These should be in your global git ignore, not in the ignores for any project you use.

retendo commented 8 years ago

There are a few reasons for static status checking methods:

nickoneill commented 8 years ago

Can you send over an example that crashes when off the main thread? I'm interested if this is our own issue or something particular to native permissions requests.

I totally get where you're coming from in terms of what should and should not be a static. I'm just not sure that shoehorning it in like this is the right solution when (if we can not crash) can do it just as well without.