nickoneill / PermissionScope

Intelligent iOS permissions UI and unified API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

detectAndCallback needs to be called in other situations

rspreen opened this issue · comments

Currently, when the PermissionScope dialog is shown, and the user leaves the app using the "Show me" alert option to go to Settings, PermissionScope observes "UIApplicationDidBecomeActive" so that it can re-analyze the permissions (using the "detectAndCallback()" method) to sense and display changes when the user returns.

However, if, while the dialog is shown, the user manually leaves the app (using the Home button) and goes to the settings and changes something, when the user returns to the app, the dialog will not detect any change.

I see 2 possible fixes to this. The best way would be for PermissionScope to create that observer whenever the dialog is shown, not just when the "Show me" button is hit. That way, PermissionScope will be triggered to re-analyze permissions whenever the app returns.

The second way, which is not as preferable but was a minimal change I could make to "hack" my local copy to fix this situation, was to make the "detectAndCallback()" method public, so that I can call it manually when my app senses that it has become active. Again, this is not a preferable solution, but perhaps there are other reasons for an app to have access to "detectAndCallback()".

Thanks for a great library, by the way!