Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Denied Permissions to Display ISHPermissionRequestViewController again #14

Open
MPiccinato opened this issue Sep 8, 2014 · 2 comments

Comments

@MPiccinato
Copy link

Currently when a permission is in the denied state, according to the system, I can not re-display the ISHPermissionRequestViewController. It would be preferred that this is easily over written so a controller can be displayed that is configured to guide them to the application settings, which would essentially be the same controller as the initial prompt but with a "Settings" button instead of "Allow". As far as I can tell I have to subclass a couple different classes to determine if a ISHPermissionRequestViewController should be allowed to be displayed.

@felixLam
Copy link
Member

felixLam commented Sep 8, 2014

That is a very good idea. However the recovery is only really possible in iOS8, before that opening the settings wasn't really possible, or am I missing something? In that case the view controller should probably provide some instructions for the user on how to open the settings. The content of which would probably be outside of the scope of this framework ... for now.

We could also upon pressing the settings button, check if the user has previously chosen the state ISHPermissionStateDoNotAskAgain. In that case the user must be asked for permissions before the permission even shows up in the settings.

I would suggest to implement this as an optional ISHPermissionsViewControllerDataSource method that provides a recovery view controller. The method would provide a view controller that is a subclass of some new ISHPermissionRecoveryViewController class, which would provide methods indicating if recovery is possible and would "force" ask for permissions (even if the user did not want to be asked) before presenting the settings (if possible).

The data source may choose to return nil for individual permission categories if they are not as important or if the recovery view would be too distracting in some situations. Not implementing that method would yield the same behavior as it does now.

@MPiccinato
Copy link
Author

That is correct in regards to iOS 8 being the only version in which an app can open its settings.

It seems a bit much to add a new class to handle the recovery when it could be incorporated into ISHPermissionRequestViewController since it would either give the developer an option to open settings or allow the ISHPermissionsViewControllerDataSource to provide a view with the correct instructions. Possibly - (IBAction)displayRecoveryOption:(id)sender;. No override would run the default for iOS 8 and take the user to the applications settings. The developer could override to then instead display a view with the instructions for iOS 7.

I might not being thinking of this correctly because I currently have an object to bypass the use of the ISHPermissionsViewController class to display a subclass of ISHPermissionRequestViewController to make use of a custom transition.

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

No branches or pull requests

2 participants