Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

detectAndCallback needs to be called in other situations #223

Open
rspreen opened this issue Mar 10, 2017 · 0 comments
Open

detectAndCallback needs to be called in other situations #223

rspreen opened this issue Mar 10, 2017 · 0 comments

Comments

@rspreen
Copy link

rspreen commented Mar 10, 2017

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant