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

Internal state were not reset after user's privacy settings reset #20

Closed
bezigon opened this issue Jan 22, 2015 · 13 comments
Closed

Internal state were not reset after user's privacy settings reset #20

bezigon opened this issue Jan 22, 2015 · 13 comments

Comments

@bezigon
Copy link

bezigon commented Jan 22, 2015

Solution?

For microphone I changed code to

case AVAudioSessionRecordPermissionUndetermined: {
            ISHPermissionState currentState = [self internalPermissionState];
            if (currentState != ISHPermissionStateAskAgain || currentState != ISHPermissionStateDoNotAskAgain) {
                [self setInternalPermissionState:ISHPermissionStateUnknown];
            }
            return [self internalPermissionState];
        }
@felixLam
Copy link
Member

The problem is more generally, that the system does not inform apps about the privacy reset (other than changing the values of particular values, which might also be triggered by individual requests by the user).

See also my question here:
http://stackoverflow.com/questions/24487660/determine-programmatically-if-the-users-privacy-settings-were-reset

@felixLam
Copy link
Member

So unfortunately I would say that there is very little one can do. We currently do not use the ISHPermissionStateDoNotAskAgain option and instead only over: Not now (permission is asked again later), Deny & Allow (both trigger the system dialogue). This allows us to direct the user to the system preferences. If you never ask for permission, the user cannot grant the permissions in settings.

@felixLam
Copy link
Member

We leave the method changePermissionStateToDontAskFromSender: in there, in case someone would like to use it and because we believe that users in the "wild" will unlikely reset the entire privacy settings very often. Again we advise not use it. I should maybe make this more clear in the docs.

@felixLam felixLam reopened this Jan 22, 2015
@felixLam
Copy link
Member

Or did I misunderstand your point?

@bezigon
Copy link
Author

bezigon commented Jan 22, 2015

I agree, I don't use these methods. I'm just practicing the possible behaviors of the user.
If in ISHPermissionKit alert user agreed, but in native alert refused, and the code took this refusal to the NSUserDefaults.
Next, after the user has reset all privacy settings, he no longer gets ISHPermissionKit alerts in the app. From the user's point, he would like to receive alerts again?

@bezigon
Copy link
Author

bezigon commented Jan 22, 2015

Indirectly, the reset can be determined by some key constants, for example, for a microphone is AVAudioSessionRecordPermissionUndetermined.

felixLam added a commit that referenced this issue Jan 22, 2015
@felixLam
Copy link
Member

This needs to be handled on a case by case basis for each permission category. As there is no general way to determine that a reset occurred.

@felixLam
Copy link
Member

I will look over the other categories to see if other changes are required. At least location request seem to have a similar issue in the edge case where whenInUse was granted and always permissions are requested.

@felixLam
Copy link
Member

Meanwhile feel free t look over the linked pull request and check if that fixes your issue. I wanted to avoid resetting the internal state in a getter as this seems to be a bit counter-intuitive.

@felixLam
Copy link
Member

The PR #21 also avoids setting the internal state in the first state on iOS8+ as it is no longer needed.

@felixLam
Copy link
Member

@bezigon Did you have time to test this issue against the linked PR #21?

@bezigon
Copy link
Author

bezigon commented Jan 26, 2015

Yes, I tested in particular with a microphone, seems no complaints. Thanks!

@felixLam
Copy link
Member

#21 has been merged. which should fix this issue.

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

No branches or pull requests

2 participants