nickoneill / PermissionScope

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

Use PermissionScope as Settings (force the dialog to open) #211

Open NinoScript opened 7 years ago

NinoScript commented 7 years ago

Feature request

Add a way to force the dialog to open

Rationale

I have 2 use cases for PermissionScope:

  1. Only ask for permissions that the user hasn't actively accepted or denied, which is fairly easy, I just call addPermission on those whose PermissionStatus is .unknown.

  2. Open a settings window where the user can accept, deny or change previously configured permissions, so I call addPermission on all permissions I'm using, but then, the dialog won't show up by calling show().

I know the second use case isn't the intended use, but it works great!

How to implement it

In my fork, I just made showAlert() public to support that use case.

If this is not an accepted use case, at least this GitHub Issue will document it, and the simple implementation will help anybody who really needs it like myself. 😁

nickoneill commented 7 years ago

Thanks for the note @NinoScript, I'll leave this open until we come to a conclusion on if this is a supported use case. Do you want to link your fork here too?

tedgonzalez commented 7 years ago

Please link the fork, thanks!

NinoScript commented 7 years ago

Sorry, we have it in a private repo, but really, the only change is to make showAlert() public, I guess I'll do it here in GitHub, give me a minute

NinoScript commented 7 years ago

There you go: https://github.com/nickoneill/PermissionScope/pull/234