nickoneill / PermissionScope

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

Handling restart of app after switching permissions #168

Closed tuxtux59 closed 8 years ago

tuxtux59 commented 8 years ago

Hi, I'm facing a problem but this issue could be like a question. When user access to device settings to switch permissions and back to the app, the app restarted without keeping it's state. So if user was in a deep state of the app he has to go back to this deep state to continue the process i tried to do before app ask him to allow some permissions. Is there a code for permissionscope to let app restart from the previous state where show() function was called? I think that we won't have to store app state in something like user preferences and test it on start!

I'm fan of this library and I think this function (if it's not already present) could be great for futures integrations.

Thanks

bre7 commented 8 years ago

Hi tux,

Why not just call show() again ? PScope will just need to re-check the configured permissions' current status

tuxtux59 commented 8 years ago

My problem is that show is called from a deep screen of the app ( like third or fourth screen) so I can't call show() again from a restart of the app due to haven't the previous behavior. I hope this is understandable !

nickoneill commented 8 years ago

Permissionscope doesn't manage the state of your app so we can't restore it to the state where you left off when changing something like contacts permission. Luckily this only occurs if a user denies contacts permissions and then has to re-enter settings to turn it on, not on the initial ask.